From c50125f6ef127db020bc0fcfdca8ed0b24e4f018 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Fri, 31 Mar 2006 23:28:18 +0000 Subject: r14844: Support a stdbool.h replacement in lib/replace/ (This used to be commit bccfddcafa1fdb56392e2301bbd404964ad9f7c3) --- source4/lib/replace/README | 1 + source4/lib/replace/config.m4 | 3 +++ source4/lib/replace/replace.h | 17 +++++++++++++++++ 3 files changed, 21 insertions(+) (limited to 'source4/lib/replace') 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 +#endif + +#ifdef HAVE_INTTYPES_H +#include +#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 +#else +#define __bool_true_false_are_defined +typedef bool int; +#define false (0) +#define true (1) +#endif + #endif -- cgit