summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2006-09-09 01:49:38 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:18:00 -0500
commitf64b2474be0d4f0f5ad20c511400f02b1cb981f0 (patch)
tree54e7f405882dbd530cb9ccf104c3257365769f4f
parentbcd1d154f38e56bdf46052df9adb79a3e31cf8b1 (diff)
downloadsamba-f64b2474be0d4f0f5ad20c511400f02b1cb981f0.tar.gz
samba-f64b2474be0d4f0f5ad20c511400f02b1cb981f0.tar.bz2
samba-f64b2474be0d4f0f5ad20c511400f02b1cb981f0.zip
r18278: move more header checks and _GNU_SOURCE into libreplace
(This used to be commit 77c442cd469ba881215e025c87ce632c876eb617)
-rw-r--r--source4/include/includes.h16
-rw-r--r--source4/lib/replace/libreplace.m43
-rw-r--r--source4/lib/replace/replace.h8
3 files changed, 12 insertions, 15 deletions
diff --git a/source4/include/includes.h b/source4/include/includes.h
index 5eb49b7f75..dc7db5d3bb 100644
--- a/source4/include/includes.h
+++ b/source4/include/includes.h
@@ -64,24 +64,12 @@
#endif
#endif
-#define _GNU_SOURCE /* Use GNU extensions */
-
/* mark smb_panic() as noreturn, so static analysers know that it is
used like abort */
_PUBLIC_ void smb_panic(const char *why) NORETURN_ATTRIBUTE;
-#include <sys/types.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <stddef.h>
-#include <sys/time.h>
-
-#ifdef HAVE_STRING_H
-#include <string.h>
-#endif
-
-#include <signal.h>
-#include <errno.h>
+#include "system/time.h"
+#include "system/wait.h"
#define _PRINTF_ATTRIBUTE(a1, a2) PRINTF_ATTRIBUTE(a1, a2)
diff --git a/source4/lib/replace/libreplace.m4 b/source4/lib/replace/libreplace.m4
index cdd83113ed..2fe58bf1e8 100644
--- a/source4/lib/replace/libreplace.m4
+++ b/source4/lib/replace/libreplace.m4
@@ -1,5 +1,6 @@
dnl needed before AC_TRY_COMPILE
AC_ISC_POSIX
+AC_USE_SYSTEM_EXTENSIONS
AC_C_INLINE
@@ -57,7 +58,7 @@ AC_FUNC_MEMCMP
AC_CHECK_FUNCS(pipe strftime srandom random srand rand usleep setbuffer)
-AC_CHECK_HEADERS(stdbool.h)
+AC_CHECK_HEADERS(stdbool.h stddef.h)
AC_CHECK_TYPE(bool,
[AC_DEFINE(HAVE_BOOL, 1, [Whether the bool type is available])],,
diff --git a/source4/lib/replace/replace.h b/source4/lib/replace/replace.h
index 1a6e1588cb..3bf884c80c 100644
--- a/source4/lib/replace/replace.h
+++ b/source4/lib/replace/replace.h
@@ -61,6 +61,14 @@
#include <strings.h>
#endif
+#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+
+#ifdef HAVE_STDDEF_H
+#include <stddef.h>
+#endif
+
#ifndef HAVE_STRERROR
extern char *sys_errlist[];
#define strerror(i) sys_errlist[i]