maint: use pragma consistently across replacement headers
authorEric Blake <eblake@redhat.com>
Thu, 25 Mar 2010 22:28:02 +0000 (16:28 -0600)
committerEric Blake <eblake@redhat.com>
Thu, 25 Mar 2010 22:48:19 +0000 (16:48 -0600)
Several headers set #pragma GCC system_header prior to checking
any multiple inclusion guards; maintenance is easiest if all
replacement headers follow the same paradigm.

* lib/ctype.in.h (system_header): Hoist for consistent placement.
* lib/dirent.in.h (system_header): Likewise.
* lib/errno.in.h (system_header): Likewise.
* lib/float.in.h (system_header): Likewise.
* lib/getopt.in.h (system_header): Likewise.
* lib/iconv.in.h (system_header): Likewise.
* lib/inttypes.in.h (system_header): Likewise.
* lib/langinfo.in.h (system_header): Likewise.
* lib/locale.in.h (system_header): Likewise.
* lib/math.in.h (system_header): Likewise.
* lib/netdb.in.h (system_header): Likewise.
* lib/netinet_in.in.h (system_header): Likewise.
* lib/pty.in.h (system_header): Likewise.
* lib/sched.in.h (system_header): Likewise.
* lib/se-selinux.in.h (system_header): Likewise.
* lib/search.in.h (system_header): Likewise.
* lib/spawn.in.h (system_header): Likewise.
* lib/stdarg.in.h (system_header): Likewise.
* lib/stdint.in.h (system_header): Likewise.
* lib/string.in.h (system_header): Likewise.
* lib/strings.in.h (system_header): Likewise.
* lib/sys_file.in.h (system_header): Likewise.
* lib/sys_ioctl.in.h (system_header): Likewise.
* lib/sys_socket.in.h (system_header): Likewise.
* lib/sys_times.in.h (system_header): Likewise.
* lib/sys_utsname.in.h (system_header): Likewise.
* lib/sys_wait.in.h (system_header): Likewise.
* lib/sysexits.in.h (system_header): Likewise.
* lib/unistd.in.h (system_header): Likewise.
* lib/wctype.in.h (system_header): Likewise.

Signed-off-by: Eric Blake <eblake@redhat.com>
31 files changed:
ChangeLog
lib/ctype.in.h
lib/dirent.in.h
lib/errno.in.h
lib/float.in.h
lib/getopt.in.h
lib/iconv.in.h
lib/inttypes.in.h
lib/langinfo.in.h
lib/locale.in.h
lib/math.in.h
lib/netdb.in.h
lib/netinet_in.in.h
lib/pty.in.h
lib/sched.in.h
lib/se-selinux.in.h
lib/search.in.h
lib/spawn.in.h
lib/stdarg.in.h
lib/stdint.in.h
lib/string.in.h
lib/strings.in.h
lib/sys_file.in.h
lib/sys_ioctl.in.h
lib/sys_socket.in.h
lib/sys_times.in.h
lib/sys_utsname.in.h
lib/sys_wait.in.h
lib/sysexits.in.h
lib/unistd.in.h
lib/wctype.in.h

index d1e075f..5b11d62 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,37 @@
 2010-03-25  Eric Blake  <eblake@redhat.com>
 
+       maint: use pragma consistently across replacement headers
+       * lib/ctype.in.h (system_header): Hoist for consistent placement.
+       * lib/dirent.in.h (system_header): Likewise.
+       * lib/errno.in.h (system_header): Likewise.
+       * lib/float.in.h (system_header): Likewise.
+       * lib/getopt.in.h (system_header): Likewise.
+       * lib/iconv.in.h (system_header): Likewise.
+       * lib/inttypes.in.h (system_header): Likewise.
+       * lib/langinfo.in.h (system_header): Likewise.
+       * lib/locale.in.h (system_header): Likewise.
+       * lib/math.in.h (system_header): Likewise.
+       * lib/netdb.in.h (system_header): Likewise.
+       * lib/netinet_in.in.h (system_header): Likewise.
+       * lib/pty.in.h (system_header): Likewise.
+       * lib/sched.in.h (system_header): Likewise.
+       * lib/se-selinux.in.h (system_header): Likewise.
+       * lib/search.in.h (system_header): Likewise.
+       * lib/spawn.in.h (system_header): Likewise.
+       * lib/stdarg.in.h (system_header): Likewise.
+       * lib/stdint.in.h (system_header): Likewise.
+       * lib/string.in.h (system_header): Likewise.
+       * lib/strings.in.h (system_header): Likewise.
+       * lib/sys_file.in.h (system_header): Likewise.
+       * lib/sys_ioctl.in.h (system_header): Likewise.
+       * lib/sys_socket.in.h (system_header): Likewise.
+       * lib/sys_times.in.h (system_header): Likewise.
+       * lib/sys_utsname.in.h (system_header): Likewise.
+       * lib/sys_wait.in.h (system_header): Likewise.
+       * lib/sysexits.in.h (system_header): Likewise.
+       * lib/unistd.in.h (system_header): Likewise.
+       * lib/wctype.in.h (system_header): Likewise.
+
        arpa/inet: fix mingw compilation warning
        * lib/arpa_inet.in.h (system_header): Hoist to be unconditional.
        Reported by Matthew Bolte.
        errno value in error message.
 
 2010-03-20  Bruno Haible  <bruno@clisp.org>
-            Jim Meyering  <meyering@redhat.com>
+           Jim Meyering  <meyering@redhat.com>
 
        lchown: Avoid "unused variable" warning.
        * lib/lchown.c (rpl_lchown): Move variable 'st' into #if block.
index ccf222d..fdf9e1e 100644 (file)
  * <http://www.opengroup.org/onlinepubs/9699919799/basedefs/ctype.h.html>
  */
 
-#ifndef _GL_CTYPE_H
-
 #if __GNUC__ >= 3
 @PRAGMA_SYSTEM_HEADER@
 #endif
 
+#ifndef _GL_CTYPE_H
+
 /* Include the original <ctype.h>.  */
 /* The include_next requires a split double-inclusion guard.  */
 #@INCLUDE_NEXT@ @NEXT_CTYPE_H@
index 3989a25..15d488b 100644 (file)
    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
-#ifndef _GL_DIRENT_H
-
 #if __GNUC__ >= 3
 @PRAGMA_SYSTEM_HEADER@
 #endif
 
+#ifndef _GL_DIRENT_H
+
 /* The include_next requires a split double-inclusion guard.  */
 #@INCLUDE_NEXT@ @NEXT_DIRENT_H@
 
index 9ac3a5b..f5166bc 100644 (file)
    along with this program; if not, write to the Free Software Foundation,
    Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
 
-#ifndef _GL_ERRNO_H
-
 #if __GNUC__ >= 3
 @PRAGMA_SYSTEM_HEADER@
 #endif
 
+#ifndef _GL_ERRNO_H
+
 /* The include_next requires a split double-inclusion guard.  */
 #@INCLUDE_NEXT@ @NEXT_ERRNO_H@
 
index caf822f..b4ea343 100644 (file)
    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
-#ifndef _GL_FLOAT_H
-
 #if __GNUC__ >= 3
 @PRAGMA_SYSTEM_HEADER@
 #endif
 
+#ifndef _GL_FLOAT_H
+
 /* The include_next requires a split double-inclusion guard.  */
 #@INCLUDE_NEXT@ @NEXT_FLOAT_H@
 
index 57a8e89..c90baa5 100644 (file)
    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
-#ifndef _GL_GETOPT_H
-
 #if __GNUC__ >= 3
 @PRAGMA_SYSTEM_HEADER@
 #endif
 
+#ifndef _GL_GETOPT_H
+
 /* The include_next requires a split double-inclusion guard.  We must
    also inform the replacement unistd.h to not recursively use
    <getopt.h>; our definitions will be present soon enough.  */
index c8f516b..162d980 100644 (file)
    along with this program; if not, write to the Free Software Foundation,
    Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
 
-#ifndef _GL_ICONV_H
-
 #if __GNUC__ >= 3
 @PRAGMA_SYSTEM_HEADER@
 #endif
 
+#ifndef _GL_ICONV_H
+
 /* The include_next requires a split double-inclusion guard.  */
 #@INCLUDE_NEXT@ @NEXT_ICONV_H@
 
index a732c69..aef157d 100644 (file)
  * <http://www.opengroup.org/susv3xbd/inttypes.h.html>
  */
 
+#if __GNUC__ >= 3
+@PRAGMA_SYSTEM_HEADER@
+#endif
+
 /* Include the original <inttypes.h> if it exists, and if this file
    has not been included yet or if this file includes gnulib stdint.h
    which in turn includes this file.
    The include_next requires a split double-inclusion guard.  */
 #if ! defined INTTYPES_H || defined _GL_JUST_INCLUDE_SYSTEM_INTTYPES_H
 # if @HAVE_INTTYPES_H@
-#  if __GNUC__ >= 3
-@PRAGMA_SYSTEM_HEADER@
-#  endif
 #  @INCLUDE_NEXT@ @NEXT_INTTYPES_H@
 # endif
 #endif
index 54fa1af..04834ce 100644 (file)
  * <http://www.opengroup.org/onlinepubs/9699919799/basedefs/langinfo.h.html>
  */
 
-#ifndef _GL_LANGINFO_H
-
 #if __GNUC__ >= 3
 @PRAGMA_SYSTEM_HEADER@
 #endif
 
+#ifndef _GL_LANGINFO_H
+
 /* The include_next requires a split double-inclusion guard.  */
 #if @HAVE_LANGINFO_H@
 # @INCLUDE_NEXT@ @NEXT_LANGINFO_H@
index ad92d8f..26059ba 100644 (file)
    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
-#ifndef _GL_LOCALE_H
-
 #if __GNUC__ >= 3
 @PRAGMA_SYSTEM_HEADER@
 #endif
 
+#ifndef _GL_LOCALE_H
+
 /* The include_next requires a split double-inclusion guard.  */
 #@INCLUDE_NEXT@ @NEXT_LOCALE_H@
 
index 5aad1a8..dd7a634 100644 (file)
    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
-#ifndef _GL_MATH_H
-
 #if __GNUC__ >= 3
 @PRAGMA_SYSTEM_HEADER@
 #endif
 
+#ifndef _GL_MATH_H
+
 /* The include_next requires a split double-inclusion guard.  */
 #@INCLUDE_NEXT_AS_FIRST_DIRECTIVE@ @NEXT_AS_FIRST_DIRECTIVE_MATH_H@
 
index c7bc929..461d12f 100644 (file)
    It is intended to provide definitions and prototypes needed by an
    application.  */
 
-#ifndef _GL_NETDB_H
-
-#if @HAVE_NETDB_H@
-
 # if __GNUC__ >= 3
 @PRAGMA_SYSTEM_HEADER@
 # endif
 
+#ifndef _GL_NETDB_H
+
+#if @HAVE_NETDB_H@
+
 /* The include_next requires a split double-inclusion guard.  */
 # @INCLUDE_NEXT@ @NEXT_NETDB_H@
 
index 114c66b..8e79bdb 100644 (file)
    along with this program; if not, write to the Free Software Foundation,
    Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
 
-#ifndef _GL_NETINET_IN_H
-
-#if @HAVE_NETINET_IN_H@
-
 # if __GNUC__ >= 3
 @PRAGMA_SYSTEM_HEADER@
 # endif
 
+#ifndef _GL_NETINET_IN_H
+
+#if @HAVE_NETINET_IN_H@
+
 /* On many platforms, <netinet/in.h> assumes prior inclusion of
    <sys/types.h>.  */
 # include <sys/types.h>
index af98dfe..98106bb 100644 (file)
    along with this program; if not, write to the Free Software Foundation,
    Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
 
-#ifndef _GL_PTY_H
-
 #if __GNUC__ >= 3
 @PRAGMA_SYSTEM_HEADER@
 #endif
 
+#ifndef _GL_PTY_H
+
 /* The include_next requires a split double-inclusion guard.  */
 #if @HAVE_PTY_H@
 # @INCLUDE_NEXT@ @NEXT_PTY_H@
index a164133..bc28036 100644 (file)
    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
-#ifndef _GL_SCHED_H
-
 #if __GNUC__ >= 3
 @PRAGMA_SYSTEM_HEADER@
 #endif
 
+#ifndef _GL_SCHED_H
+
 /* The include_next requires a split double-inclusion guard.  */
 #if @HAVE_SCHED_H@
 # @INCLUDE_NEXT@ @NEXT_SCHED_H@
index 76f7c1b..d756b69 100644 (file)
@@ -1,9 +1,25 @@
-#ifndef _GL_SELINUX_SELINUX_H
-# define _GL_SELINUX_SELINUX_H
+/* Replacement <selinux/selinux.h> for platforms that lack it.
+   Copyright (C) 2008-2010 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
-# if __GNUC__ >= 3
+#if __GNUC__ >= 3
 @PRAGMA_SYSTEM_HEADER@
-# endif
+#endif
+
+#ifndef _GL_SELINUX_SELINUX_H
+# define _GL_SELINUX_SELINUX_H
 
 # if HAVE_SELINUX_SELINUX_H
 
index d61f9e4..9689d58 100644 (file)
    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
+#if __GNUC__ >= 3
+@PRAGMA_SYSTEM_HEADER@
+#endif
+
 #ifndef _GL_SEARCH_H
 
 /* The include_next requires a split double-inclusion guard.  */
 #if @HAVE_SEARCH_H@
-# if __GNUC__ >= 3
-@PRAGMA_SYSTEM_HEADER@
-# endif
 # @INCLUDE_NEXT@ @NEXT_SEARCH_H@
 #endif
 
index cc8d9a9..6a15e5f 100644 (file)
    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
-#ifndef _GL_SPAWN_H
-
 #if __GNUC__ >= 3
 @PRAGMA_SYSTEM_HEADER@
 #endif
 
+#ifndef _GL_SPAWN_H
+
 /* The include_next requires a split double-inclusion guard.  */
 #if @HAVE_SPAWN_H@
 # @INCLUDE_NEXT@ @NEXT_SPAWN_H@
index 9a8d029..99fff31 100644 (file)
    along with this program; if not, write to the Free Software Foundation,
    Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
 
-#ifndef _GL_STDARG_H
-
 #if __GNUC__ >= 3
 @PRAGMA_SYSTEM_HEADER@
 #endif
 
+#ifndef _GL_STDARG_H
+
 /* The include_next requires a split double-inclusion guard.  */
 #@INCLUDE_NEXT@ @NEXT_STDARG_H@
 
index 3e8ba97..0979a95 100644 (file)
  * <http://www.opengroup.org/susv3xbd/stdint.h.html>
  */
 
+# if __GNUC__ >= 3
+@PRAGMA_SYSTEM_HEADER@
+# endif
+
 #ifndef _GL_STDINT_H
 
 /* When including a system file that in turn includes <inttypes.h>,
@@ -49,9 +53,6 @@
      in <inttypes.h> would reinclude us, skipping our contents because
      _GL_STDINT_H is defined.
      The include_next requires a split double-inclusion guard.  */
-# if __GNUC__ >= 3
-@PRAGMA_SYSTEM_HEADER@
-# endif
 # @INCLUDE_NEXT@ @NEXT_STDINT_H@
 #endif
 
index 4788a19..4a98302 100644 (file)
    along with this program; if not, write to the Free Software Foundation,
    Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
 
-#ifndef _GL_STRING_H
-
 #if __GNUC__ >= 3
 @PRAGMA_SYSTEM_HEADER@
 #endif
 
+#ifndef _GL_STRING_H
+
 /* The include_next requires a split double-inclusion guard.  */
 #@INCLUDE_NEXT@ @NEXT_STRING_H@
 
index 0931899..e2487bc 100644 (file)
    along with this program; if not, write to the Free Software Foundation,
    Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
 
-#ifndef _GL_STRINGS_H
-
 #if __GNUC__ >= 3
 @PRAGMA_SYSTEM_HEADER@
 #endif
 
+#ifndef _GL_STRINGS_H
+
 /* The include_next requires a split double-inclusion guard.  */
 #@INCLUDE_NEXT@ @NEXT_STRINGS_H@
 
index 77a7ccb..bf76001 100644 (file)
    Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
 
 /* Written by Richard W.M. Jones.  */
-#ifndef _GL_SYS_FILE_H
 
 # if __GNUC__ >= 3
 @PRAGMA_SYSTEM_HEADER@
 # endif
 
+#ifndef _GL_SYS_FILE_H
+
 /* The include_next requires a split double-inclusion guard.  */
 # if @HAVE_SYS_FILE_H@
 #  @INCLUDE_NEXT@ @NEXT_SYS_FILE_H@
index 511d2c5..eee3b57 100644 (file)
    along with this program; if not, write to the Free Software Foundation,
    Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
 
-#ifndef _GL_SYS_IOCTL_H
-
 #if __GNUC__ >= 3
 @PRAGMA_SYSTEM_HEADER@
 #endif
 
+#ifndef _GL_SYS_IOCTL_H
+
 /* The include_next requires a split double-inclusion guard.  */
 #if @HAVE_SYS_IOCTL_H@
 # @INCLUDE_NEXT@ @NEXT_SYS_IOCTL_H@
index 006a901..03579af 100644 (file)
    It is intended to provide definitions and prototypes needed by an
    application.  */
 
+#if __GNUC__ >= 3
+@PRAGMA_SYSTEM_HEADER@
+#endif
+
 #if defined _GL_ALREADY_INCLUDING_SYS_SOCKET_H
 /* Special invocation convention:
    - On Cygwin 1.5.x we have a sequence of nested includes
 
 # define _GL_ALREADY_INCLUDING_SYS_SOCKET_H
 
-# if __GNUC__ >= 3
-@PRAGMA_SYSTEM_HEADER@
-# endif
-
 /* On many platforms, <sys/socket.h> assumes prior inclusion of
    <sys/types.h>.  */
 # include <sys/types.h>
index 57f3a72..1b66bbd 100644 (file)
 /* This file is supposed to be used on platforms where <sys/times.h>
    is missing.  */
 
-#ifndef _GL_SYS_TIMES_H
-
 # if __GNUC__ >= 3
 @PRAGMA_SYSTEM_HEADER@
 # endif
 
+#ifndef _GL_SYS_TIMES_H
+
 # if @HAVE_SYS_TIMES_H@
 #  @INCLUDE_NEXT@ @NEXT_SYS_TIMES_H@
 # endif
index c0dabcc..2d57605 100644 (file)
    along with this program; if not, write to the Free Software Foundation,
    Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
 
-#ifndef _GL_SYS_UTSNAME_H
-
 #if __GNUC__ >= 3
 @PRAGMA_SYSTEM_HEADER@
 #endif
 
+#ifndef _GL_SYS_UTSNAME_H
+
 #if @HAVE_SYS_UTSNAME_H@
 # @INCLUDE_NEXT@ @NEXT_SYS_UTSNAME_H@
 #endif
index 6699c61..623c8d5 100644 (file)
    Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
 
 
-#ifndef _GL_SYS_WAIT_H
-
 #if __GNUC__ >= 3
 @PRAGMA_SYSTEM_HEADER@
 #endif
 
+#ifndef _GL_SYS_WAIT_H
+
 /* The include_next requires a split double-inclusion guard.  */
 #if !((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__)
 # @INCLUDE_NEXT@ @NEXT_SYS_WAIT_H@
index 5d5a219..b477111 100644 (file)
 
 /* Written by Simon Josefsson based on sysexits(3) man page */
 
+#if __GNUC__ >= 3
+@PRAGMA_SYSTEM_HEADER@
+#endif
+
 #ifndef _GL_SYSEXITS_H
 
 #if @HAVE_SYSEXITS_H@
 
-# if __GNUC__ >= 3
-@PRAGMA_SYSTEM_HEADER@
-# endif
-
 /* IRIX 6.5 has an <unistd.h> that defines a macro EX_OK with a nonzero
    value.  Override it.  See
    <http://lists.gnu.org/archive/html/bug-gnulib/2007-03/msg00361.html>  */
index a60d483..209ea89 100644 (file)
    along with this program; if not, write to the Free Software Foundation,
    Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
 
+#if __GNUC__ >= 3
+@PRAGMA_SYSTEM_HEADER@
+#endif
+
 /* Special invocation convention:
    - On mingw, several headers, including <winsock2.h>, include <unistd.h>,
      but we need to ensure that both the system <unistd.h> and <winsock2.h>
 /* Normal invocation.  */
 #elif !defined _GL_UNISTD_H
 
-#if __GNUC__ >= 3
-@PRAGMA_SYSTEM_HEADER@
-#endif
-
 /* The include_next requires a split double-inclusion guard.  */
 #if @HAVE_UNISTD_H@
 # @INCLUDE_NEXT@ @NEXT_UNISTD_H@
index 8016203..400f250 100644 (file)
  * wctrans_t, and wctype_t are not yet implemented.
  */
 
-#ifndef _GL_WCTYPE_H
-
 #if __GNUC__ >= 3
 @PRAGMA_SYSTEM_HEADER@
 #endif
 
+#ifndef _GL_WCTYPE_H
+
 #if @HAVE_WINT_T@
 /* Solaris 2.5 has a bug: <wchar.h> must be included before <wctype.h>.
    Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before