diff options
Diffstat (limited to 'source3')
-rw-r--r-- | source3/aclocal.m4 | 4 | ||||
-rw-r--r-- | source3/configure.in | 23 | ||||
-rw-r--r-- | source3/lib/snprintf.c | 4 |
3 files changed, 22 insertions, 9 deletions
diff --git a/source3/aclocal.m4 b/source3/aclocal.m4 index c7831c58ca..5169eee41b 100644 --- a/source3/aclocal.m4 +++ b/source3/aclocal.m4 @@ -125,11 +125,11 @@ AC_DEFUN(AC_LIBTESTFUNC, # may have different results. # # Note that using directly AS_VAR_PUSHDEF([ac_Lib], [ac_cv_lib_$1_$3]) -# is asking for troubles, since AC_CHECK_LIB($lib, fun) would give +# is asking for trouble, since AC_CHECK_LIB($lib, fun) would give # ac_cv_lib_$lib_fun, which is definitely not what was meant. Hence # the AS_LITERAL_IF indirection. # -# FIXME: This macro is extremely suspicious. It DEFINEs unconditionnally, +# FIXME: This macro is extremely suspicious. It DEFINEs unconditionally, # whatever the FUNCTION, in addition to not being a *S macro. Note # that the cache does depend upon the function we are looking for. # diff --git a/source3/configure.in b/source3/configure.in index 6946ab06b3..e270b1efff 100644 --- a/source3/configure.in +++ b/source3/configure.in @@ -1391,12 +1391,21 @@ if test x"$samba_cv_HAVE_GETTIMEOFDAY_TZ" = x"yes"; then AC_DEFINE(HAVE_GETTIMEOFDAY_TZ,1,[Whether gettimeofday() is available]) fi -AC_CACHE_CHECK([for __va_copy],samba_cv_HAVE_VA_COPY,[ +AC_CACHE_CHECK([for va_copy],samba_cv_HAVE_VA_COPY,[ AC_TRY_LINK([#include <stdarg.h> -va_list ap1,ap2;], [__va_copy(ap1,ap2);], +va_list ap1,ap2;], [va_copy(ap1,ap2);], samba_cv_HAVE_VA_COPY=yes,samba_cv_HAVE_VA_COPY=no)]) if test x"$samba_cv_HAVE_VA_COPY" = x"yes"; then - AC_DEFINE(HAVE_VA_COPY,1,[Whether __va_copy() is available]) + AC_DEFINE(HAVE_VA_COPY,1,[Whether va_copy() is available]) +else + AC_CACHE_CHECK([for __va_copy],samba_cv_HAVE___VA_COPY,[ + AC_TRY_LINK([#include <stdarg.h> + va_list ap1,ap2;], [__va_copy(ap1,ap2);], + samba_cv_HAVE___VA_COPY=yes, + samba_cv_HAVE___VA_COPY=no)]) + if test x"$samba_cv_HAVE___VA_COPY" = x"yes"; then + AC_DEFINE(HAVE___VA_COPY,1,[Whether __va_copy() is available]) + fi fi AC_CACHE_CHECK([for C99 vsnprintf],samba_cv_HAVE_C99_VSNPRINTF,[ @@ -1606,7 +1615,7 @@ dnl Try to find iconv(3) if test "$ICONV_FOUND" = yes; then LIB_ADD_DIR(LDFLAGS, "$i/lib") CFLAGS_ADD_DIR(CPPFLAGS, "$i/include") - LIBS="$save_LIBS $LIBS" + LIBS="$save_LIBS" ICONV_LOCATION=$i export LDFLAGS LIBS CPPFLAGS dnl Now, check for a working iconv ... we want to do it here because @@ -1670,9 +1679,9 @@ dnl ]) LIBS="$ic_save_LIBS" if test x"$samba_cv_HAVE_NATIVE_ICONV" = x"yes"; then - CPPFLAGS=$save_CPPFLAGS - CFLAGS_ADD_DIR(CPPFLAGS, "$i/include") - export CPPFLAGS + CPPFLAGS=$save_CPPFLAGS + CFLAGS_ADD_DIR(CPPFLAGS, "$i/include") + export CPPFLAGS AC_DEFINE(HAVE_NATIVE_ICONV,1,[Whether to use native iconv]) AC_DEFINE_UNQUOTED(DEFAULT_DOS_CHARSET,$default_dos_charset,[Default dos charset name]) AC_DEFINE_UNQUOTED(DEFAULT_DISPLAY_CHARSET,$default_display_charset,[Default display charset name]) diff --git a/source3/lib/snprintf.c b/source3/lib/snprintf.c index a2f9f592db..5b0cfa1ab3 100644 --- a/source3/lib/snprintf.c +++ b/source3/lib/snprintf.c @@ -147,10 +147,14 @@ #ifndef VA_COPY #ifdef HAVE_VA_COPY +#define VA_COPY(dest, src) va_copy(dest, src) +#else +#ifdef HAVE___VA_COPY #define VA_COPY(dest, src) __va_copy(dest, src) #else #define VA_COPY(dest, src) (dest) = (src) #endif +#endif /* * dopr(): poor man's version of doprintf |