summaryrefslogtreecommitdiff
path: root/source4/lib/replace
diff options
context:
space:
mode:
Diffstat (limited to 'source4/lib/replace')
-rw-r--r--source4/lib/replace/README1
-rw-r--r--source4/lib/replace/config.m43
-rw-r--r--source4/lib/replace/replace.h17
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