svn commit: samba r18335 - in branches/SAMBA_4_0/source/lib/replace: .

tridge at samba.org tridge at samba.org
Sun Sep 10 12:23:47 GMT 2006


Author: tridge
Date: 2006-09-10 12:23:47 +0000 (Sun, 10 Sep 2006)
New Revision: 18335

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

Log:

more portable bool tests

Modified:
   branches/SAMBA_4_0/source/lib/replace/libreplace.m4
   branches/SAMBA_4_0/source/lib/replace/replace.h


Changeset:
Modified: branches/SAMBA_4_0/source/lib/replace/libreplace.m4
===================================================================
--- branches/SAMBA_4_0/source/lib/replace/libreplace.m4	2006-09-10 12:12:24 UTC (rev 18334)
+++ branches/SAMBA_4_0/source/lib/replace/libreplace.m4	2006-09-10 12:23:47 UTC (rev 18335)
@@ -81,7 +81,16 @@
 #endif]
 )
 
+AC_CHECK_TYPE(_Bool, 
+[AC_DEFINE(HAVE__Bool, 1, [Whether the _Bool type is available])],,
+[
+AC_INCLUDES_DEFAULT
+#ifdef HAVE_STDBOOL_H
+#include <stdbool.h>
+#endif]
+)
 
+
 AC_CACHE_CHECK([for working mmap],samba_cv_HAVE_MMAP,[
 AC_TRY_RUN([#include "$libreplacedir/test/shared_mmap.c"],
            samba_cv_HAVE_MMAP=yes,samba_cv_HAVE_MMAP=no,samba_cv_HAVE_MMAP=cross)])

Modified: branches/SAMBA_4_0/source/lib/replace/replace.h
===================================================================
--- branches/SAMBA_4_0/source/lib/replace/replace.h	2006-09-10 12:12:24 UTC (rev 18334)
+++ branches/SAMBA_4_0/source/lib/replace/replace.h	2006-09-10 12:23:47 UTC (rev 18335)
@@ -310,12 +310,23 @@
 
 #ifdef HAVE_STDBOOL_H
 #include <stdbool.h>
-#elif !defined(HAVE_BOOL)
+#endif
+
+#if !defined(HAVE_BOOL)
+#ifdef HAVE__Bool
+#define bool _Bool
+#else
 #define __bool_true_false_are_defined
 typedef int bool;
-#define false (0)
+#endif
+#endif
+
+#ifndef true
 #define true (1)
 #endif
+#ifndef false
+#define false (0)
+#endif
 
 #ifndef HAVE_FUNCTION_MACRO
 #ifdef HAVE_func_MACRO



More information about the samba-cvs mailing list