mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-09-04 10:41:11 +02:00
Back out 12814.
This commit is contained in:
parent
fcaa17f396
commit
0d96dc0879
3 changed files with 1 additions and 96 deletions
74
Src/compat.c
74
Src/compat.c
|
@ -407,80 +407,6 @@ zchdir(char *dir)
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef HAVE_ASPRINTF
|
|
||||||
/**/
|
|
||||||
# ifndef USE_VARARGS
|
|
||||||
/**/
|
|
||||||
mod_export int
|
|
||||||
zasprintf(char **strp, const char *format, int arg1, int arg2)
|
|
||||||
{
|
|
||||||
char *buf;
|
|
||||||
|
|
||||||
buf = (char *)zalloc(PATH_MAX);
|
|
||||||
|
|
||||||
snprintf(buf, PATH_MAX, format, arg1, arg2);
|
|
||||||
*strp = buf;
|
|
||||||
return strlen(buf);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**/
|
|
||||||
# else
|
|
||||||
|
|
||||||
/**/
|
|
||||||
# ifdef PREFER_STDARG
|
|
||||||
|
|
||||||
/**/
|
|
||||||
mod_export int
|
|
||||||
zasprintf(char **strp, const char *format, ...)
|
|
||||||
{
|
|
||||||
|
|
||||||
/**/
|
|
||||||
# else
|
|
||||||
|
|
||||||
/**/
|
|
||||||
# if __GNUC__ > 1
|
|
||||||
/* Doing this the "right way" will effect a broken compat.epro file. *
|
|
||||||
* This kludge should work with gcc2 until a better solution is available */
|
|
||||||
|
|
||||||
/**/
|
|
||||||
mod_export int
|
|
||||||
zasprintf(char **strp, const char *format, __builtin_va_alist_t __builtin_va_alist, __va_ellipsis)
|
|
||||||
{
|
|
||||||
|
|
||||||
/**/
|
|
||||||
# else
|
|
||||||
# error varargs prototyping kludge failed
|
|
||||||
/**/
|
|
||||||
# endif
|
|
||||||
|
|
||||||
/**/
|
|
||||||
# endif
|
|
||||||
va_list arg;
|
|
||||||
|
|
||||||
char *buf;
|
|
||||||
|
|
||||||
buf = (char *)zalloc(PATH_MAX);
|
|
||||||
|
|
||||||
# ifdef PREFER_STDARG
|
|
||||||
va_start(arg, format);
|
|
||||||
# else
|
|
||||||
va_start(arg);
|
|
||||||
# endif
|
|
||||||
|
|
||||||
#ifdef HAVE_VSNPRINTF
|
|
||||||
vsnprintf(buf, PATH_MAX, format, arg);
|
|
||||||
#else
|
|
||||||
#error You have varargs but no vsnprintf
|
|
||||||
#endif
|
|
||||||
va_end (arg);
|
|
||||||
|
|
||||||
*strp = buf;
|
|
||||||
return strlen(buf);
|
|
||||||
}
|
|
||||||
/**/
|
|
||||||
# endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* How to print out a 64 bit integer. This isn't needed (1) if longs
|
* How to print out a 64 bit integer. This isn't needed (1) if longs
|
||||||
* are 64 bit, since ordinary %ld will work (2) if we couldn't find a
|
* are 64 bit, since ordinary %ld will work (2) if we couldn't find a
|
||||||
|
|
20
Src/system.h
20
Src/system.h
|
@ -227,26 +227,6 @@ struct timezone {
|
||||||
# define zopenmax() ((long) OPEN_MAX)
|
# define zopenmax() ((long) OPEN_MAX)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined (__STDC__) && defined (HAVE_STDARG_H)
|
|
||||||
# define PREFER_STDARG
|
|
||||||
# define USE_VARARGS
|
|
||||||
# include <stdarg.h>
|
|
||||||
#else
|
|
||||||
# ifdef HAVE_VARARGS_H
|
|
||||||
# define PREFER_VARARGS
|
|
||||||
# define USE_VARARGS
|
|
||||||
# include <varargs.h>
|
|
||||||
# endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef HAVE_ASPRINTF
|
|
||||||
# ifdef __GNUC__
|
|
||||||
# define zasprintf(X,F,A...) asprintf(X,F, ## A)
|
|
||||||
# else
|
|
||||||
# define zasprintf asprintf
|
|
||||||
# endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef HAVE_FCNTL_H
|
#ifdef HAVE_FCNTL_H
|
||||||
# include <fcntl.h>
|
# include <fcntl.h>
|
||||||
#else
|
#else
|
||||||
|
|
|
@ -451,7 +451,7 @@ AC_CHECK_HEADERS(sys/time.h sys/times.h sys/select.h termcap.h termio.h \
|
||||||
limits.h fcntl.h libc.h sys/utsname.h sys/resource.h \
|
limits.h fcntl.h libc.h sys/utsname.h sys/resource.h \
|
||||||
locale.h errno.h stdlib.h unistd.h sys/capability.h \
|
locale.h errno.h stdlib.h unistd.h sys/capability.h \
|
||||||
utmp.h utmpx.h sys/types.h pwd.h grp.h poll.h sys/mman.h \
|
utmp.h utmpx.h sys/types.h pwd.h grp.h poll.h sys/mman.h \
|
||||||
linux/tasks.h netinet/in_systm.h stdarg.h varargs.h)
|
linux/tasks.h netinet/in_systm.h)
|
||||||
if test $dynamic = yes; then
|
if test $dynamic = yes; then
|
||||||
AC_CHECK_HEADERS(dlfcn.h)
|
AC_CHECK_HEADERS(dlfcn.h)
|
||||||
AC_CHECK_HEADERS(dl.h)
|
AC_CHECK_HEADERS(dl.h)
|
||||||
|
@ -860,7 +860,6 @@ AC_CHECK_FUNCS(strftime difftime gettimeofday \
|
||||||
initgroups nis_list \
|
initgroups nis_list \
|
||||||
setuid seteuid setreuid setresuid setsid \
|
setuid seteuid setreuid setresuid setsid \
|
||||||
memcpy memmove strstr strerror \
|
memcpy memmove strstr strerror \
|
||||||
snprintf vsnprintf asprintf \
|
|
||||||
cap_get_proc \
|
cap_get_proc \
|
||||||
getrlimit \
|
getrlimit \
|
||||||
setlocale \
|
setlocale \
|
||||||
|
|
Loading…
Reference in a new issue