summaryrefslogtreecommitdiff
path: root/m4/system_.h
diff options
context:
space:
mode:
authorGary V. Vaughan <gary@gnu.org>2007-04-02 12:06:23 +0000
committerEric Blake <ebb9@byu.net>2007-10-06 07:08:19 -0600
commit1722215a83e85c5d0edf5e5431925b0a08d1a334 (patch)
tree26cadd676b1822cf0cda4451e868b4c2bc58cb65 /m4/system_.h
parent777142456c1f3fac259fb25af6514980229af818 (diff)
downloadm4-1722215a83e85c5d0edf5e5431925b0a08d1a334.tar.gz
M4 was designed to have a small number of header files defining
the interfaces to several source files each. Keeping this in mind allows us to tidy things up considerably. Having done this, it becomes clear that some of the installed headers reference other headers which are not installed (but that's another patch): * m4/m4private.h (stdio--.h, stdlib--.h, unistd--.h): Moved from here... * m4/system_.h (gnu/stdio--.h, gnu/stdlib--.h, gnu/unistd--.h): ...to here, so client modules can benefit too. (assert.h, errno.h, limits.h, sys/stat.h): Include one here at the lowest level to save doing it multiple times elsewhere. * m4/debug.c (stdio.h): Removed. The portable <gnu/stdio--.h> is already included via m4private.h. * modules/time.c (stdio.h): Ditto. * modules/gnu.c (stdlib.h): Ditto resp <gnu/stdlib--.h>. * modules/stdlib.c (stdlib.h, unistd.h): Ditto resp <gnu/stdlib--.h> and <gnu/unistd--.h>, * m4/m4private.h (m4module.h): Use angle brackets for an installed file. * m4/hash.h (system.h): Ditto. * modules/gnu.c (progname.h): Removed. * src/freeze.c (m4/system.h, m4private.h): Already included vi m4.h. * m4/m4private.h (assert.h, errno.h): Already included via m4/m4module.h. * m4/input.c (ctype.h): Ditto. * m4/module.c (ltdl.h): Ditto. * m4/output.c (errno.h, limits.h, stdio.h, sys/types.h, sys/stat.h) (unistd.h): Ditto. * m4/path.c (config.h, stdlib.h): Ditto. * m4/utility.c (config.h): Ditto. * modules/evalparse.c (assert.h, ctype.h): Ditto. * modules/gnu.c (assert.h, ctype.h, errno.h): Ditto. * modules/import.c (assert.h): Ditto. * modules/m4.c (assert.h, errno.h): Ditto. * modules/modtest.c (assert.h): Ditto. * modules/stdlib.c (sys/types.h): DittAo. * src/m4.h (ctype.h, errno.h, string.h, sys/types.h, ltdl.h): Ditto. * src/stackovf.c (assert.h): Ditto. * modules/gnu.c (m4/m4module.h, m4private.h): Build using the faster private interfaces when NDEBUG is defined. * modules/import.c (m4/m4module.h, m4private.h): Ditto. * modules/load.c (m4/m4module.h, m4private.h): Ditto. * modules/m4.c (m4/m4module.h, m4private.h): Ditto. * modules/modtest.c (m4/m4module.h, m4private.h): Ditto. * modules/mpeval.c (m4/m4module.h, m4private.h): Ditto. * modules/perl.c (m4/m4module.h, m4private.h): Ditto. * modules/shadow.c (m4/m4module.h, m4private.h): Ditto. * modules/time.c (m4/m4module.h, m4private.h): Ditto. * modules/traditional.c (m4/m4module.h, m4private.h): Ditto. * src/m4.h (locale.h): Moved from here... * src/main.h: ...to here. (m4private.h): Already included via m4.h. * src/stackovf.c (m4private.h): Ditto.
Diffstat (limited to 'm4/system_.h')
-rw-r--r--m4/system_.h29
1 files changed, 10 insertions, 19 deletions
diff --git a/m4/system_.h b/m4/system_.h
index e7ca63c5..2d84bf3e 100644
--- a/m4/system_.h
+++ b/m4/system_.h
@@ -21,17 +21,23 @@
* @configure_output@
*
* This file is installed, so cannot rely on the contents of config.h.
- * It works best if included _after_ system headers.
+ * It works best if included _before_ system headers.
**/
#ifndef M4_SYSTEM_H
#define M4_SYSTEM_H 1
+#include <gnu/stdlib--.h>
+#include <gnu/stdio--.h>
+#include <gnu/unistd--.h>
+
+#include <assert.h>
#include <ctype.h>
-#include <stdio.h>
-#include <stdlib.h>
+#include <errno.h>
+#include <limits.h>
#include <sys/types.h>
-#include <unistd.h>
+#include <sys/stat.h>
+
@INCLUDE_ERROR_H@
@INCLUDE_OBSTACK_H@
@@ -49,21 +55,6 @@
(obstack_free (OBS, (char *)(OBJECT) + SIZE), \
(OBS)->object_base = (char *)(OBJECT))
-/* Some systems do not define EXIT_*, despite otherwise supporting
- C89. This definition is copied from gnulib's stdlib_.h, since we
- don't always install gnulib's stdlib.h. */
-#ifndef EXIT_SUCCESS
-# define EXIT_SUCCESS 0
-#endif
-/* Tandem/NSK and other platforms that define EXIT_FAILURE as -1 interfere
- with proper operation of xargs. */
-#ifndef EXIT_FAILURE
-# define EXIT_FAILURE 1
-#elif EXIT_FAILURE != 1
-# undef EXIT_FAILURE
-# define EXIT_FAILURE 1
-#endif
-
/* In addition to EXIT_SUCCESS and EXIT_FAILURE, m4 can fail with version
mismatch when trying to load a frozen file produced by a newer m4 than
the version doing the reload. */