r14844: Support a stdbool.h replacement in lib/replace/
authorJelmer Vernooij <jelmer@samba.org>
Fri, 31 Mar 2006 23:28:18 +0000 (23:28 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 18:59:41 +0000 (13:59 -0500)
(This used to be commit bccfddcafa1fdb56392e2301bbd404964ad9f7c3)

source4/build/m4/check_types.m4
source4/build/m4/rewrite.m4
source4/client/cifsdd.c
source4/include/core.h
source4/include/includes.h
source4/lib/appweb/mpr/miniMpr.h
source4/lib/replace/README
source4/lib/replace/config.m4
source4/lib/replace/replace.h
source4/param/param.h

index 88ccc7859c8d119732deb76814eba852d5bfad56..41667bd4311b591321bcde7e40f940dc663979f5 100644 (file)
@@ -15,8 +15,6 @@ AC_C_BIGENDIAN
 
 AC_HEADER_STDC
 
-AC_CHECK_HEADERS(stdbool.h)
-
 AC_CHECK_SIZEOF(short,cross)
 AC_CHECK_SIZEOF(int,cross)
 AC_CHECK_SIZEOF(long,cross)
@@ -27,5 +25,3 @@ fi
 if test $ac_cv_sizeof_long_long -lt 8;then
        AC_MSG_ERROR([Sorry we need sizeof(long long) >= 8])
 fi
-AC_CHECK_TYPE(_Bool)
-
index 2e94fb215e9a2a1cdeb4126511ac038d8a3fca4a..fb7ca0f9f749a4abe1d2db40e72a7202a18d028f 100644 (file)
@@ -58,7 +58,7 @@ AC_CHECK_HEADERS(sys/param.h ctype.h sys/wait.h sys/resource.h sys/ioctl.h sys/i
 AC_CHECK_HEADERS(sys/mman.h sys/filio.h sys/priv.h sys/shm.h string.h strings.h stdlib.h)
 AC_CHECK_HEADERS(sys/vfs.h sys/fs/s5param.h sys/filsys.h termios.h termio.h)
 AC_CHECK_HEADERS(fnmatch.h pwd.h sys/termio.h sys/time.h sys/statfs.h sys/statvfs.h stdarg.h)
-AC_CHECK_HEADERS(stdint.h inttypes.h locale.h shadow.h)
+AC_CHECK_HEADERS(locale.h shadow.h)
 AC_CHECK_HEADERS(nss.h nss_common.h ns_api.h sys/security.h)
 AC_CHECK_HEADERS(sys/capability.h sys/acl.h)
 
index a168a9194645834014b760b86d86fc0b6ffdc685..c7e054c3649c45dd50cba775de246928bff34eb1 100644 (file)
@@ -195,7 +195,7 @@ void set_arg_val(const char * name, ...)
                        arg->arg_val.nval = va_arg(ap, uint64_t);
                        break;
                case ARG_BOOL:
-                       arg->arg_val.bval = va_arg(ap, BOOL);
+                       arg->arg_val.bval = va_arg(ap, int);
                        break;
                case ARG_PATHNAME:
                        arg->arg_val.pval = va_arg(ap, char *);
index cb9da4dd87ede843af13d86693872897507ad278..6ca276bf0ec8d59bd5389a677a6dea5c0ff4dead 100644 (file)
 
 #include "libcli/util/nt_status.h"
 
+typedef int BOOL;
+
 #define False (0)
 #define True (1)
-#define Auto (2)
-
-typedef int BOOL;
 
 /* used to hold an arbitrary blob of data */
 typedef struct datablob {
index b8aebf2f148f80f9d217b3dba6a01eb736df1b97..a79a48f377d8bf8fe8dc517afc8320419ccaf119 100644 (file)
@@ -74,14 +74,6 @@ _PUBLIC_ void smb_panic(const char *why) NORETURN_ATTRIBUTE;
 #include <stddef.h>
 #include <sys/time.h>
 
-#ifdef HAVE_STDINT_H
-#include <stdint.h>
-#endif
-
-#ifdef HAVE_INTTYPES_H
-#include <inttypes.h>
-#endif
-
 #ifdef HAVE_STRING_H
 #include <string.h>
 #endif
index d92e50fe891b2a741badae8edcc36e601849032c..30d2103ba89efb638069c04533926ef03dceb9db 100644 (file)
@@ -185,8 +185,10 @@ typedef char*                      MprStr;
 
 #ifndef __cplusplus
 typedef unsigned char  uchar;
+#ifndef __bool_true_false_are_defined
 typedef int                    bool;
 #endif
+#endif
 
 /*
  *     Porters: put other operating system type defines here
index 19364e2faa5edec96d493031fc78acb49caea877..a789f66b8148579d13049e2a1a439eef5150a0da 100644 (file)
@@ -52,6 +52,7 @@ getpass
 readline (the library)
 
 Types:
+bool
 socklen_t
 u_int{8,16,32}_t
 uint_t
index 873e7b2bca43dacaaf1c92201956f631157f4fb7..3c11ac14761b935ee9590737c126b04ab76da57b 100644 (file)
@@ -1,3 +1,4 @@
+AC_CHECK_HEADERS([stdint.h inttypes.h])
 AC_CHECK_TYPE(uint_t, unsigned int)
 AC_CHECK_TYPE(int8_t, signed char)
 AC_CHECK_TYPE(uint8_t, unsigned char)
@@ -127,5 +128,7 @@ LIBS="$SAVE_LIBS"
 AC_CHECK_FUNCS([syslog memset setnetgrent getnetgrent endnetgrent memcpy],,
                           [AC_MSG_ERROR([Required function not found])])
 
+AC_CHECK_HEADERS(stdbool.h)
+
 sinclude(lib/replace/readline.m4)
 sinclude(lib/replace/getpass.m4)
index 24876ffd4ebc07f1ef051d3f2e46d7a31bd622f7..20b73e5b84683ad2fa0c8bbc7f081a53ef73a3a0 100644 (file)
 #define QSORT_CAST (int (*)(const void *, const void *))
 #endif
 
+#ifdef HAVE_STDINT_H
+#include <stdint.h>
+#endif
+
+#ifdef HAVE_INTTYPES_H
+#include <inttypes.h>
+#endif
+
 #ifndef HAVE_STRERROR
 extern char *sys_errlist[];
 #define strerror(i) sys_errlist[i]
@@ -194,4 +202,13 @@ int rep_mkstemp(char *temp);
 #define INT32_MAX _TYPE_MAXIMUM(int32_t)
 #endif
 
+#ifdef HAVE_STDBOOL_H
+#include <stdbool.h>
+#else
+#define __bool_true_false_are_defined
+typedef bool int;
+#define false (0)
+#define true (1)
+#endif
+
 #endif
index 923b06eb864eb118f0da42d2200cafe4c1f5a5c6..dad5f12b156f7310248d6c012e6f58e5f9d5a693 100644 (file)
@@ -41,6 +41,8 @@ struct param_section {
 struct param_context;
 struct smbsrv_connection;
 
+#define Auto (2)
+
 #include "param/proto.h"
 
 #endif /* _PARAM_H */