diff options
author | Bruno Haible <bruno@clisp.org> | 2017-05-01 12:58:28 +0200 |
---|---|---|
committer | Bruno Haible <bruno@clisp.org> | 2017-05-01 12:58:28 +0200 |
commit | e48f55fd7c253e0363072b6163012e5cead89b55 (patch) | |
tree | 6a02184ff42c3601f51cb986d2e388f3d45d9ad0 | |
parent | dfcf42ed7a2c951759d87f7e35b052d081922610 (diff) | |
download | gnulib-e48f55fd7c253e0363072b6163012e5cead89b55.tar.gz |
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>.
-rw-r--r-- | ChangeLog | 7 | ||||
-rw-r--r-- | lib/wctype.in.h | 10 |
2 files changed, 13 insertions, 4 deletions
@@ -1,5 +1,12 @@ 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. * lib/wchar.in.h (rpl_wint_t): If <crtdefs.h> does not exist, include <stddef.h> instead. diff --git a/lib/wctype.in.h b/lib/wctype.in.h index 933bf788bf..759659b1df 100644 --- a/lib/wctype.in.h +++ b/lib/wctype.in.h @@ -56,11 +56,13 @@ # 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. |