]> Savannah Git Hosting - gnulib.git/commitdiff
wchar, wctype-h: fix for MinGW 3.22.2
authorEli Zaretskii <eliz@gnu.org>
Mon, 10 Oct 2016 15:05:36 +0000 (08:05 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Mon, 10 Oct 2016 15:06:31 +0000 (08:06 -0700)
* lib/wchar.in.h [__MINGW32__]: Add one more condition for
special invocation, to fix issues with MinGW 3.22.2 wchar.h
when included from <string.h>.
* lib/wctype.in.h [__MINGW32__]: Add special invocation
convention for MinGW 3.22.2, to solve issues with their
wctype.h when included from <ctype.h>.

ChangeLog
lib/wchar.in.h
lib/wctype.in.h

index ebf9a35d3c4805485407243f4a4835621a7f38c6..679285fe8743c3a2305934d8712e100901ed65ec 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2016-10-10  Eli Zaretskii  <eliz@gnu.org>
+
+       wchar, wctype-h: fix for MinGW 3.22.2
+       * lib/wchar.in.h [__MINGW32__]: Add one more condition for
+       special invocation, to fix issues with MinGW 3.22.2 wchar.h
+       when included from <string.h>.
+       * lib/wctype.in.h [__MINGW32__]: Add special invocation
+       convention for MinGW 3.22.2, to solve issues with their
+       wctype.h when included from <ctype.h>.
+
 2016-10-05  Jim Meyering  <meyering@fb.com>
 
        long-options: avoid new GCC 7 warning from -Wimplicit-fallthrough
index 8e9fb89ccca45dd7ca2834326362e7fea521a944..346a3076c96e5a2ad1c7ad72638ecf3a57127980 100644 (file)
@@ -35,6 +35,7 @@
      || (defined __hpux                                                 \
          && ((defined _INTTYPES_INCLUDED && !defined strtoimax)         \
              || defined _GL_JUST_INCLUDE_SYSTEM_WCHAR_H))               \
+     || (defined __MINGW32__ && defined __STRING_H_SOURCED__)           \
      || defined _GL_ALREADY_INCLUDING_WCHAR_H)
 /* Special invocation convention:
    - Inside glibc and uClibc header files, but not MinGW.
@@ -44,6 +45,8 @@
      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>.
+   - With MinGW 3.22, when <string.h> includes <wchar.h>, only some part of
+     <wchar.h> is actually processed, and that doesn't include 'mbstate_t'.
    - On IRIX 6.5, similarly, we have an include <wchar.h> -> <wctype.h>, and
      the latter includes <wchar.h>.  But here, we have no way to detect whether
      <wctype.h> is completely included or is still being included.  */
index 649b2f50e75c07328e5261bc8447cf943af68d7d..ddc34d0a1d1d799a733d46e47f26d33446b1b308 100644 (file)
  * wctrans_t, and wctype_t are not yet implemented.
  */
 
-#ifndef _@GUARD_PREFIX@_WCTYPE_H
-
 #if __GNUC__ >= 3
 @PRAGMA_SYSTEM_HEADER@
 #endif
 @PRAGMA_COLUMNS@
 
+#if (defined __MINGW32__ && defined __CTYPE_H_SOURCED__)
+
+/* Special invocation convention:
+   - With MinGW 3.22, when <ctype.h> includes <wctype.h>, only some part of
+     <wctype.h> is being processed, which doesn't include the idempotency
+     guard.   */
+
+#@INCLUDE_NEXT@ @NEXT_WCTYPE_H@
+
+#else
+/* Normal invocation convention.  */
+
+#ifndef _@GUARD_PREFIX@_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
@@ -512,3 +524,4 @@ _GL_INLINE_HEADER_END
 
 #endif /* _@GUARD_PREFIX@_WCTYPE_H */
 #endif /* _@GUARD_PREFIX@_WCTYPE_H */
+#endif