Fix a syntax error due to recursive inclusion of wchar.h on HP-UX 11.00.
authorBruno Haible <bruno@clisp.org>
Wed, 14 Jan 2009 23:27:45 +0000 (00:27 +0100)
committerBruno Haible <bruno@clisp.org>
Wed, 14 Jan 2009 23:27:45 +0000 (00:27 +0100)
ChangeLog
lib/stdint.in.h
lib/wchar.in.h

index c4e6c2f..766fde7 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,13 @@
 2009-01-14  Bruno Haible  <bruno@clisp.org>
 
+       * lib/stdint.in.h (_GL_JUST_INCLUDE_SYSTEM_WCHAR_H): New macro, defined
+       while including <wchar.h>.
+       * lib/wchar.in.h: In two particular situations on HP-UX, include only
+       the system's <wchar.h> file.
+       Reported by Albert Chin <bug-gnulib@mlists.thewrittenword.com>.
+
+2009-01-14  Bruno Haible  <bruno@clisp.org>
+
        * m4/csharp.m4: Don't mention gettext on the serial number line.
        * m4/csharpexec.m4: Likewise.
        * m4/eaccess.m4: Likewise.
index a335fd0..469a599 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2002, 2004-2008 Free Software Foundation, Inc.
+/* Copyright (C) 2001-2002, 2004-2009 Free Software Foundation, Inc.
    Written by Paul Eggert, Bruno Haible, Sam Steingold, Peter Burwood.
    This file is part of gnulib.
 
@@ -478,7 +478,9 @@ typedef int _verify_intmax_size[2 * (sizeof (intmax_t) == sizeof (uintmax_t)) -
    includes <wchar.h> -> <stdio.h> -> <getopt.h> -> <stdlib.h>, and the latter includes
    <stdint.h> and assumes its types are already defined.  */
 #if ! (defined WCHAR_MIN && defined WCHAR_MAX)
+# define _GL_JUST_INCLUDE_SYSTEM_WCHAR_H
 # include <wchar.h>
+# undef _GL_JUST_INCLUDE_SYSTEM_WCHAR_H
 #endif
 #undef WCHAR_MIN
 #undef WCHAR_MAX
index 74e5f24..77c068b 100644 (file)
@@ -1,6 +1,6 @@
 /* A substitute for ISO C99 <wchar.h>, for platforms that have issues.
 
-   Copyright (C) 2007-2008 Free Software Foundation, Inc.
+   Copyright (C) 2007-2009 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
 @PRAGMA_SYSTEM_HEADER@
 #endif
 
-#ifdef __need_mbstate_t
-/* Special invocation convention inside uClibc header files.  */
+#if defined __need_mbstate_t || (defined __hpux && ((defined _INTTYPES_INCLUDED && !defined strtoimax) || defined _GL_JUST_INCLUDE_SYSTEM_WCHAR_H))
+/* Special invocation convention:
+   - Inside uClibc header files.
+   - On HP-UX 11.00 we have a sequence of nested includes
+     <wchar.h> -> <stdlib.h> -> <stdint.h>, and the latter includes <wchar.h>,
+     once indirectly <stdint.h> -> <sys/types.h> -> <inttypes.h> -> <wchar.h>
+     and once directly.  In both situations 'wint_t' is not yet defined,
+     therefore we cannot provide the function overrides; instead include only
+     the system's <wchar.h>.  */
 
 #@INCLUDE_NEXT@ @NEXT_WCHAR_H@