r22659: merge from SAMBA_4_0:
authorStefan Metzmacher <metze@samba.org>
Fri, 4 May 2007 06:59:26 +0000 (06:59 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 17:19:53 +0000 (12:19 -0500)
- add AC_GNU_SOURCE macro for systems which don't have it
  (sles8)
- fix compiler warning on some systems

metze

source/lib/replace/autoconf-2.60.m4
source/lib/replace/test/testsuite.c

index 5360fff5d241360a8c04c03971a57e4732a71da8..acdcd38efe6165aebc8ef1cb2322044c7594e2f2 100644 (file)
@@ -1,3 +1,16 @@
+# AC_GNU_SOURCE
+# --------------
+AC_DEFUN([AC_GNU_SOURCE],
+[AH_VERBATIM([_GNU_SOURCE],
+[/* Enable GNU extensions on systems that have them.  */
+#ifndef _GNU_SOURCE
+# undef _GNU_SOURCE
+#endif])dnl
+AC_BEFORE([$0], [AC_COMPILE_IFELSE])dnl
+AC_BEFORE([$0], [AC_RUN_IFELSE])dnl
+AC_DEFINE([_GNU_SOURCE])
+])
+
 # _AC_C_STD_TRY(STANDARD, TEST-PROLOGUE, TEST-BODY, OPTION-LIST,
 #              ACTION-IF-AVAILABLE, ACTION-IF-UNAVAILABLE)
 # --------------------------------------------------------------
index 2d068c559f3f3bb5a96d231a59f63249eb4844c8..54ffd6a66de03c257230b1a30ec3fd0ec300d6e4 100644 (file)
@@ -511,7 +511,7 @@ static int test_inet_ntoa(void)
                       "\tptr: %p - %p = %d != %d\n" \
                       "]\n", \
                       __STRING(func), __location__, __STRING(func), \
-                      str, diff, base, res, _v, _ep, _p, diff - (_ep - _p), diff); \
+                      str, diff, base, res, _v, _ep, _p, (int)(diff - (_ep - _p)), diff); \
                return false; \
        } \
 } while (0)