summaryrefslogtreecommitdiff
path: root/m4/include_next.m4
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2008-09-02 21:16:10 +0200
committerLudovic Courtès <ludo@gnu.org>2008-09-02 21:16:10 +0200
commite65fc94b7a01a46d867480861e93984e8ea1e012 (patch)
tree386f6753b645e0dc8f00111cfe66ab228cf3d6d8 /m4/include_next.m4
parentbfb2e1135842460d450cd514b8ef692a752db26c (diff)
downloadguile-e65fc94b7a01a46d867480861e93984e8ea1e012.tar.gz
Add Gnulib `strftime' module, update Gnulib files.
* m4/gnulib-cache.m4 (gl_MODULES): Add `strftime'.
Diffstat (limited to 'm4/include_next.m4')
-rw-r--r--m4/include_next.m428
1 files changed, 21 insertions, 7 deletions
diff --git a/m4/include_next.m4 b/m4/include_next.m4
index a842e2a23..08c63dbc2 100644
--- a/m4/include_next.m4
+++ b/m4/include_next.m4
@@ -1,4 +1,4 @@
-# include_next.m4 serial 6
+# include_next.m4 serial 7
dnl Copyright (C) 2006-2008 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -6,6 +6,21 @@ dnl with or without modifications, as long as this notice is preserved.
dnl From Paul Eggert and Derek Price.
+dnl Sets INCLUDE_NEXT and PRAGMA_SYSTEM_HEADER.
+dnl
+dnl INCLUDE_NEXT expands to 'include_next' if the compiler supports it, or to
+dnl 'include' otherwise.
+dnl
+dnl PRAGMA_SYSTEM_HEADER can be used in files that contain #include_next,
+dnl so as to avoid GCC warnings when the gcc option -pedantic is used.
+dnl '#pragma GCC system_header' has the same effect as if the file was found
+dnl through the include search path specified with '-isystem' options (as
+dnl opposed to the search path specified with '-I' options). Namely, gcc
+dnl does not warn about some things, and on some systems (Solaris and Interix)
+dnl __STDC__ evaluates to 0 instead of to 1. The latter is an undesired side
+dnl effect; we are therefore careful to use 'defined __STDC__' or '1' instead
+dnl of plain '__STDC__'.
+
AC_DEFUN([gl_INCLUDE_NEXT],
[
AC_LANG_PREPROC_REQUIRE()
@@ -36,18 +51,17 @@ EOF
CPPFLAGS="$save_CPPFLAGS"
rm -rf conftestd1 conftestd2
])
+ PRAGMA_SYSTEM_HEADER=
if test $gl_cv_have_include_next = yes; then
-
- dnl FIXME: Remove HAVE_INCLUDE_NEXT and update everything that uses it
- dnl to use @INCLUDE_NEXT@ instead.
- AC_DEFINE([HAVE_INCLUDE_NEXT], 1,
- [Define if your compiler supports the #include_next directive.])
-
INCLUDE_NEXT=include_next
+ if test -n "$GCC"; then
+ PRAGMA_SYSTEM_HEADER='#pragma GCC system_header'
+ fi
else
INCLUDE_NEXT=include
fi
AC_SUBST([INCLUDE_NEXT])
+ AC_SUBST([PRAGMA_SYSTEM_HEADER])
])
# gl_CHECK_NEXT_HEADERS(HEADER1 HEADER2 ...)