diff options
author | Jelmer Vernooij <jelmer@samba.org> | 2006-03-31 23:28:18 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 13:59:41 -0500 |
commit | c50125f6ef127db020bc0fcfdca8ed0b24e4f018 (patch) | |
tree | fb737d6ababb45d094309dcc7a73957f0d812b6e /source4/lib/replace | |
parent | 0697e76440c548910ebab955676114e1e26d7ee3 (diff) | |
download | samba-c50125f6ef127db020bc0fcfdca8ed0b24e4f018.tar.gz samba-c50125f6ef127db020bc0fcfdca8ed0b24e4f018.tar.bz2 samba-c50125f6ef127db020bc0fcfdca8ed0b24e4f018.zip |
r14844: Support a stdbool.h replacement in lib/replace/
(This used to be commit bccfddcafa1fdb56392e2301bbd404964ad9f7c3)
Diffstat (limited to 'source4/lib/replace')
-rw-r--r-- | source4/lib/replace/README | 1 | ||||
-rw-r--r-- | source4/lib/replace/config.m4 | 3 | ||||
-rw-r--r-- | source4/lib/replace/replace.h | 17 |
3 files changed, 21 insertions, 0 deletions
diff --git a/source4/lib/replace/README b/source4/lib/replace/README index 19364e2faa..a789f66b81 100644 --- a/source4/lib/replace/README +++ b/source4/lib/replace/README @@ -52,6 +52,7 @@ getpass readline (the library) Types: +bool socklen_t u_int{8,16,32}_t uint_t diff --git a/source4/lib/replace/config.m4 b/source4/lib/replace/config.m4 index 873e7b2bca..3c11ac1476 100644 --- a/source4/lib/replace/config.m4 +++ b/source4/lib/replace/config.m4 @@ -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) diff --git a/source4/lib/replace/replace.h b/source4/lib/replace/replace.h index 24876ffd4e..20b73e5b84 100644 --- a/source4/lib/replace/replace.h +++ b/source4/lib/replace/replace.h @@ -35,6 +35,14 @@ #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 |