svn commit: samba r17264 - in branches/SAMBA_4_0/source/lib/talloc: .

metze at samba.org metze at samba.org
Wed Jul 26 17:34:52 GMT 2006


Author: metze
Date: 2006-07-26 17:34:50 +0000 (Wed, 26 Jul 2006)
New Revision: 17264

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=17264

Log:
- remove unused includes from talloc
- check explicit check for varargs.h as fallback from stdarg.h
  and fail the build if both are not present

metze
Modified:
   branches/SAMBA_4_0/source/lib/talloc/config.m4
   branches/SAMBA_4_0/source/lib/talloc/talloc.c


Changeset:
Modified: branches/SAMBA_4_0/source/lib/talloc/config.m4
===================================================================
--- branches/SAMBA_4_0/source/lib/talloc/config.m4	2006-07-26 17:32:47 UTC (rev 17263)
+++ branches/SAMBA_4_0/source/lib/talloc/config.m4	2006-07-26 17:34:50 UTC (rev 17264)
@@ -1,3 +1,6 @@
+AC_CHECK_HEADERS(stdarg.h vararg.h)
+
+dnl 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);],
@@ -6,8 +9,17 @@
     AC_DEFINE(HAVE_VA_COPY,1,[Whether va_copy() is available])
 fi
 
+if test x"$samba_cv_HAVE_VA_COPY" != x"yes"; then
+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_CHECK_TYPE(intptr_t, unsigned long long)
-AC_CHECK_HEADERS(stdint.h stdarg.h unistd.h sys/types.h)
 AC_CHECK_SIZEOF(size_t,cross)
 AC_CHECK_SIZEOF(void *,cross)
 

Modified: branches/SAMBA_4_0/source/lib/talloc/talloc.c
===================================================================
--- branches/SAMBA_4_0/source/lib/talloc/talloc.c	2006-07-26 17:32:47 UTC (rev 17263)
+++ branches/SAMBA_4_0/source/lib/talloc/talloc.c	2006-07-26 17:34:50 UTC (rev 17264)
@@ -37,24 +37,14 @@
 #include <string.h>
 #include <errno.h>
 
-#ifdef HAVE_SYS_TYPES_H
-#include <sys/types.h>
-#endif
-
-#ifdef HAVE_UNISTD_H
-#include <unistd.h>
-#endif
-
-#ifdef HAVE_STDARG_H
+#if defined(HAVE_STDARG_H)
 #include <stdarg.h>
-#else
+#elif defined (HAVE_VARARGS_H)
 #include <varargs.h>
+#else
+#error "no var arg header"
 #endif
 
-#ifdef HAVE_STDINT_H
-#include <stdint.h>
-#endif
-
 #include "talloc.h"
 
 /* use this to force every realloc to change the pointer, to stress test



More information about the samba-cvs mailing list