svn commit: samba r18864 - in
branches/SAMBA_3_0/source/lib/replace: .
tridge at samba.org
tridge at samba.org
Sun Sep 24 02:29:13 GMT 2006
Author: tridge
Date: 2006-09-24 02:29:12 +0000 (Sun, 24 Sep 2006)
New Revision: 18864
WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=18864
Log:
merge lib/replace changes from samba4
Modified:
branches/SAMBA_3_0/source/lib/replace/README
branches/SAMBA_3_0/source/lib/replace/libreplace.m4
branches/SAMBA_3_0/source/lib/replace/libreplace_cc.m4
branches/SAMBA_3_0/source/lib/replace/replace.h
Changeset:
Modified: branches/SAMBA_3_0/source/lib/replace/README
===================================================================
--- branches/SAMBA_3_0/source/lib/replace/README 2006-09-24 02:28:28 UTC (rev 18863)
+++ branches/SAMBA_3_0/source/lib/replace/README 2006-09-24 02:29:12 UTC (rev 18864)
@@ -65,6 +65,12 @@
PATH_NAME_MAX
UINT{16,32,64}_MAX
INT32_MAX
+RTLD_LAZY
+HOST_NAME_MAX
+UINT16_MAX
+UINT32_MAX
+UINT64_MAX
+CHAR_BIT
Macros:
va_copy
@@ -72,6 +78,7 @@
__STRING
MIN
MAX
+QSORT_CAST
Prerequisites:
memset (for bzero)
Modified: branches/SAMBA_3_0/source/lib/replace/libreplace.m4
===================================================================
--- branches/SAMBA_3_0/source/lib/replace/libreplace.m4 2006-09-24 02:28:28 UTC (rev 18863)
+++ branches/SAMBA_3_0/source/lib/replace/libreplace.m4 2006-09-24 02:29:12 UTC (rev 18864)
@@ -267,10 +267,10 @@
AC_CHECK_FUNCS(strtoull __strtoull strtouq strtoll __strtoll strtoq)
# this test disabled as we don't actually need __VA_ARGS__ yet
-# AC_TRY_CPP([
-# #define eprintf(...) fprintf(stderr, __VA_ARGS__)
-# eprintf("bla", "bar");
-# ], [], [AC_MSG_ERROR([__VA_ARGS__ is required])])
+AC_TRY_CPP([
+#define eprintf(...) fprintf(stderr, __VA_ARGS__)
+eprintf("bla", "bar");
+], AC_DEFINE(HAVE__VA_ARGS__MACRO, 1, [Whether the __VA_ARGS__ macro is available]))
# Check prerequisites
AC_CHECK_FUNCS([memset printf syslog], [],
Modified: branches/SAMBA_3_0/source/lib/replace/libreplace_cc.m4
===================================================================
--- branches/SAMBA_3_0/source/lib/replace/libreplace_cc.m4 2006-09-24 02:28:28 UTC (rev 18863)
+++ branches/SAMBA_3_0/source/lib/replace/libreplace_cc.m4 2006-09-24 02:29:12 UTC (rev 18864)
@@ -28,7 +28,13 @@
savedCFLAGS=$CFLAGS
AC_PROG_CC
CFLAGS=$savedCFLAGS
+
+dnl don't try for C99 if we are using gcc, as otherwise we
+dnl lose immediate structure constants
+if test x"$GCC" = x"no" ; then
AC_PROG_CC_C99
+fi
+
if test x"$GCC" = x"yes" ; then
AC_MSG_CHECKING([for version of gcc])
GCC_VERSION=`$CC -dumpversion`
@@ -122,5 +128,26 @@
AC_MSG_ERROR([LIBREPLACE needs sizeof(long long) >= 8])
fi
+############################################
+# check if the compiler can do immediate structures
+AC_CACHE_CHECK([for immediate structures],samba_cv_immediate_structures, [
+ AC_TRY_COMPILE([
+#include <stdio.h>],
+[
+ typedef struct {unsigned x;} FOOBAR;
+ #define X_FOOBAR(x) ((FOOBAR) { x })
+ #define FOO_ONE X_FOOBAR(1)
+ FOOBAR f = FOO_ONE;
+ static const struct {
+ FOOBAR y;
+ } f2[] = {
+ {FOO_ONE}
+ };
+],
+ samba_cv_immediate_structures=yes,samba_cv_immediate_structures=no)])
+if test x"$samba_cv_immediate_structures" = x"yes"; then
+ AC_DEFINE(HAVE_IMMEDIATE_STRUCTURES,1,[Whether the compiler supports immediate structures])
+fi
+
AC__LIBREPLACE_ONLY_CC_CHECKS_END
]) dnl end AC_LIBREPLACE_CC_CHECKS
Modified: branches/SAMBA_3_0/source/lib/replace/replace.h
===================================================================
--- branches/SAMBA_3_0/source/lib/replace/replace.h 2006-09-24 02:28:28 UTC (rev 18863)
+++ branches/SAMBA_3_0/source/lib/replace/replace.h 2006-09-24 02:29:12 UTC (rev 18864)
@@ -357,10 +357,10 @@
#endif
#ifndef _TRUE
-#define _TRUE
+#define _TRUE true
#endif
#ifndef _FALSE
-#define _FALSE
+#define _FALSE false
#endif
#ifndef HAVE_FUNCTION_MACRO
More information about the samba-cvs
mailing list