summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Sharpe <sharpe@samba.org>2003-10-24 16:08:03 +0000
committerRichard Sharpe <sharpe@samba.org>2003-10-24 16:08:03 +0000
commitd0833280da45109f881f8f895063b5a6a9372627 (patch)
treef16145521f075ee94a48a4511a49fb8fbaf11c26
parentdebbecb23cf45ef711726ccd18cfc09b64a07e9b (diff)
downloadsamba-d0833280da45109f881f8f895063b5a6a9372627.tar.gz
samba-d0833280da45109f881f8f895063b5a6a9372627.tar.bz2
samba-d0833280da45109f881f8f895063b5a6a9372627.zip
Some spelling mistakes in aclocal.m4 and the va_copy fixups in configure.in
and lib/snprintf. Check for va_copy first, and then look for __va_copy. (This used to be commit 8b592740b6294555c461d7eee003e2bd5f4352a4)
-rw-r--r--source3/aclocal.m44
-rw-r--r--source3/configure.in23
-rw-r--r--source3/lib/snprintf.c4
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