]> Savannah Git Hosting - gnulib.git/commitdiff
wctype: Fix problems if <wchar.h> gets included after <wctype.h>.
authorBruno Haible <bruno@clisp.org>
Mon, 1 May 2017 10:58:28 +0000 (12:58 +0200)
committerBruno Haible <bruno@clisp.org>
Mon, 1 May 2017 10:58:28 +0000 (12:58 +0200)
* lib/wctype.in.h: Include not only <ctype.h> but also <wchar.h>. Do so
also on MSVC.
Reported by Eli Zaretskii <eliz@gnu.org>.

ChangeLog
lib/wctype.in.h

index 2de382e959307506a36ab4c2a6cfd149e0f09a92..d268b9e31cc4660c99c28c38d09e201b8d62f6bb 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2017-05-01  Bruno Haible  <bruno@clisp.org>
+
+       wctype: Fix problems if <wchar.h> gets included after <wctype.h>.
+       * lib/wctype.in.h: Include not only <ctype.h> but also <wchar.h>. Do so
+       also on MSVC.
+       Reported by Eli Zaretskii <eliz@gnu.org>.
+
 2017-05-01  Bruno Haible  <bruno@clisp.org>
 
        wchar: Fix compilation error with the original mingw.org mingw.
index 933bf788bffa0792deb3956c8d0fef3257ca340b..759659b1df2b8ee1714b705eecd331df335e5345 100644 (file)
 # include <wchar.h>
 #endif
 
-/* mingw has declarations of towupper and towlower in <ctype.h> as
-   well <wctype.h>.  Include <ctype.h> in advance to avoid rpl_ prefix
-   being added to the declarations.  */
-#ifdef __MINGW32__
+/* Native Windows (mingw, MSVC) have declarations of towupper, towlower, and
+   isw* functions in <ctype.h>, <wchar.h> as well as in <wctype.h>.  Include
+   <ctype.h>, <wchar.h> in advance to avoid rpl_ prefix being added to the
+   declarations.  */
+#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
 # include <ctype.h>
+# include <wchar.h>
 #endif
 
 /* Include the original <wctype.h> if it exists.