diff options
author | Bruno Haible <bruno@clisp.org> | 2019-12-11 10:05:27 +0100 |
---|---|---|
committer | Bruno Haible <bruno@clisp.org> | 2019-12-11 11:38:52 +0100 |
commit | cc6745d8accfa37b8ed48a4ea4220ae80fb7f3bd (patch) | |
tree | aa89c7354b791c262ecc98c727d1fb17cf00f33d /lib/locale.in.h | |
parent | 47bfe0ab18ebdc74c10e9625c27d0c89a369f512 (diff) | |
download | gnulib-cc6745d8accfa37b8ed48a4ea4220ae80fb7f3bd.tar.gz |
locale: Fix compilation error in C++ mode on MSVC.
* m4/locale_h.m4 (gl_LOCALE_H): Don't set REPLACE_STRUCT_LCONV on MSVC.
* lib/locale.in.h (int_p_cs_precedes, int_p_sign_posn,
int_p_sep_by_space, int_n_cs_precedes, int_n_sign_posn,
int_n_sep_by_space): Define as macros on MSVC.
Diffstat (limited to 'lib/locale.in.h')
-rw-r--r-- | lib/locale.in.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/locale.in.h b/lib/locale.in.h index 918d4dd2bd..77b8b3ba91 100644 --- a/lib/locale.in.h +++ b/lib/locale.in.h @@ -64,6 +64,18 @@ # define LC_MESSAGES 1729 #endif +/* On native Windows with MSVC, 'struct lconv' lacks the members int_p_* and + int_n_*. Instead of overriding 'struct lconv', merely define these member + names as macros. This avoids trouble in C++ mode. */ +#if defined _MSC_VER +# define int_p_cs_precedes p_cs_precedes +# define int_p_sign_posn p_sign_posn +# define int_p_sep_by_space p_sep_by_space +# define int_n_cs_precedes n_cs_precedes +# define int_n_sign_posn n_sign_posn +# define int_n_sep_by_space n_sep_by_space +#endif + /* Bionic libc's 'struct lconv' is just a dummy. */ #if @REPLACE_STRUCT_LCONV@ # define lconv rpl_lconv |