2 Copyright (C) 2007-2019 Free Software Foundation, Inc.
4 This program is free software: you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 3 of the License, or
7 (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this program. If not, see <https://www.gnu.org/licenses/>. */
18 @PRAGMA_SYSTEM_HEADER@
22 #if (defined _WIN32 && !defined __CYGWIN__ && defined __need_locale_t) \
23 || defined _GL_ALREADY_INCLUDING_LOCALE_H
25 /* Special invocation convention:
26 - Inside mingw header files,
27 - To handle Solaris header files (through Solaris 10) when combined
28 with gettext's libintl.h. */
30 #@INCLUDE_NEXT@ @NEXT_LOCALE_H@
33 /* Normal invocation convention. */
35 #ifndef _@GUARD_PREFIX@_LOCALE_H
37 #define _GL_ALREADY_INCLUDING_LOCALE_H
39 /* The include_next requires a split double-inclusion guard. */
40 #@INCLUDE_NEXT@ @NEXT_LOCALE_H@
42 #undef _GL_ALREADY_INCLUDING_LOCALE_H
44 #ifndef _@GUARD_PREFIX@_LOCALE_H
45 #define _@GUARD_PREFIX@_LOCALE_H
47 /* NetBSD 5.0 mis-defines NULL. */
50 /* Mac OS X 10.5 defines the locale_t type in <xlocale.h>. */
55 /* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */
57 /* The definition of _GL_ARG_NONNULL is copied here. */
59 /* The definition of _GL_WARN_ON_USE is copied here. */
61 /* The LC_MESSAGES locale category is specified in POSIX, but not in ISO C.
62 On systems that don't define it, use the same value as GNU libintl. */
63 #if !defined LC_MESSAGES
64 # define LC_MESSAGES 1729
67 /* Bionic libc's 'struct lconv' is just a dummy. */
68 #if @REPLACE_STRUCT_LCONV@
69 # define lconv rpl_lconv
72 /* All 'char *' are actually 'const char *'. */
74 /* Members that depend on the LC_NUMERIC category of the locale. See
75 <http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap07.html#tag_07_03_04> */
77 /* Symbol used as decimal point. */
79 /* Symbol used to separate groups of digits to the left of the decimal
82 /* Definition of the size of groups of digits to the left of the decimal
86 /* Members that depend on the LC_MONETARY category of the locale. See
87 <http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap07.html#tag_07_03_03> */
89 /* Symbol used as decimal point. */
90 char *mon_decimal_point
;
91 /* Symbol used to separate groups of digits to the left of the decimal
93 char *mon_thousands_sep
;
94 /* Definition of the size of groups of digits to the left of the decimal
97 /* Sign used to indicate a value >= 0. */
99 /* Sign used to indicate a value < 0. */
102 /* For formatting local currency. */
103 /* Currency symbol (3 characters) followed by separator (1 character). */
104 char *currency_symbol
;
105 /* Number of digits after the decimal point. */
107 /* For values >= 0: 1 if the currency symbol precedes the number, 0 if it
108 comes after the number. */
110 /* For values >= 0: Position of the sign. */
112 /* For values >= 0: Placement of spaces between currency symbol, sign, and
115 /* For values < 0: 1 if the currency symbol precedes the number, 0 if it
116 comes after the number. */
118 /* For values < 0: Position of the sign. */
120 /* For values < 0: Placement of spaces between currency symbol, sign, and
124 /* For formatting international currency. */
125 /* Currency symbol (3 characters) followed by separator (1 character). */
126 char *int_curr_symbol
;
127 /* Number of digits after the decimal point. */
128 char int_frac_digits
;
129 /* For values >= 0: 1 if the currency symbol precedes the number, 0 if it
130 comes after the number. */
131 char int_p_cs_precedes
;
132 /* For values >= 0: Position of the sign. */
133 char int_p_sign_posn
;
134 /* For values >= 0: Placement of spaces between currency symbol, sign, and
136 char int_p_sep_by_space
;
137 /* For values < 0: 1 if the currency symbol precedes the number, 0 if it
138 comes after the number. */
139 char int_n_cs_precedes
;
140 /* For values < 0: Position of the sign. */
141 char int_n_sign_posn
;
142 /* For values < 0: Placement of spaces between currency symbol, sign, and
144 char int_n_sep_by_space
;
148 #if @GNULIB_LOCALECONV@
149 # if @REPLACE_LOCALECONV@
150 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
152 # define localeconv rpl_localeconv
154 _GL_FUNCDECL_RPL (localeconv
, struct lconv
*, (void));
155 _GL_CXXALIAS_RPL (localeconv
, struct lconv
*, (void));
157 _GL_CXXALIAS_SYS (localeconv
, struct lconv
*, (void));
159 _GL_CXXALIASWARN (localeconv
);
160 #elif @REPLACE_STRUCT_LCONV@
162 # define localeconv localeconv_used_without_requesting_gnulib_module_localeconv
163 #elif defined GNULIB_POSIXCHECK
165 # if HAVE_RAW_DECL_LOCALECONV
166 _GL_WARN_ON_USE (localeconv
,
167 "localeconv returns too few information on some platforms - "
168 "use gnulib module localeconv for portability");
172 #if @GNULIB_SETLOCALE@
173 # if @REPLACE_SETLOCALE@
174 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
176 # define setlocale rpl_setlocale
177 # define GNULIB_defined_setlocale 1
179 _GL_FUNCDECL_RPL (setlocale
, char *, (int category
, const char *locale
));
180 _GL_CXXALIAS_RPL (setlocale
, char *, (int category
, const char *locale
));
182 _GL_CXXALIAS_SYS (setlocale
, char *, (int category
, const char *locale
));
184 _GL_CXXALIASWARN (setlocale
);
185 #elif defined GNULIB_POSIXCHECK
187 # if HAVE_RAW_DECL_SETLOCALE
188 _GL_WARN_ON_USE (setlocale
, "setlocale works differently on native Windows - "
189 "use gnulib module setlocale for portability");
193 #if /*@GNULIB_NEWLOCALE@ ||*/ (@GNULIB_LOCALENAME@ && @HAVE_NEWLOCALE@)
194 # if @REPLACE_NEWLOCALE@
195 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
197 # define newlocale rpl_newlocale
198 # define GNULIB_defined_newlocale 1
200 _GL_FUNCDECL_RPL (newlocale
, locale_t
,
201 (int category_mask
, const char *name
, locale_t base
)
202 _GL_ARG_NONNULL ((2)));
203 _GL_CXXALIAS_RPL (newlocale
, locale_t
,
204 (int category_mask
, const char *name
, locale_t base
));
206 # if @HAVE_NEWLOCALE@
207 _GL_CXXALIAS_SYS (newlocale
, locale_t
,
208 (int category_mask
, const char *name
, locale_t base
));
211 # if @HAVE_NEWLOCALE@
212 _GL_CXXALIASWARN (newlocale
);
214 #elif defined GNULIB_POSIXCHECK
216 # if HAVE_RAW_DECL_NEWLOCALE
217 _GL_WARN_ON_USE (newlocale
, "newlocale is not portable");
221 #if @GNULIB_DUPLOCALE@ || (@GNULIB_LOCALENAME@ && @HAVE_DUPLOCALE@)
222 # if @REPLACE_DUPLOCALE@
223 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
225 # define duplocale rpl_duplocale
226 # define GNULIB_defined_duplocale 1
228 _GL_FUNCDECL_RPL (duplocale
, locale_t
, (locale_t locale
) _GL_ARG_NONNULL ((1)));
229 _GL_CXXALIAS_RPL (duplocale
, locale_t
, (locale_t locale
));
231 # if @HAVE_DUPLOCALE@
232 _GL_CXXALIAS_SYS (duplocale
, locale_t
, (locale_t locale
));
235 # if @HAVE_DUPLOCALE@
236 _GL_CXXALIASWARN (duplocale
);
238 #elif defined GNULIB_POSIXCHECK
240 # if HAVE_RAW_DECL_DUPLOCALE
241 _GL_WARN_ON_USE (duplocale
, "duplocale is buggy on some glibc systems - "
242 "use gnulib module duplocale for portability");
246 #if /*@GNULIB_FREELOCALE@ ||*/ (@GNULIB_LOCALENAME@ && @HAVE_FREELOCALE@)
247 # if @REPLACE_FREELOCALE@
248 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
250 # define freelocale rpl_freelocale
251 # define GNULIB_defined_freelocale 1
253 _GL_FUNCDECL_RPL (freelocale
, void, (locale_t locale
) _GL_ARG_NONNULL ((1)));
254 _GL_CXXALIAS_RPL (freelocale
, void, (locale_t locale
));
256 # if @HAVE_FREELOCALE@
257 _GL_CXXALIAS_SYS (freelocale
, void, (locale_t locale
));
260 # if @HAVE_FREELOCALE@
261 _GL_CXXALIASWARN (freelocale
);
263 #elif defined GNULIB_POSIXCHECK
265 # if HAVE_RAW_DECL_FREELOCALE
266 _GL_WARN_ON_USE (freelocale
, "freelocale is not portable");
270 #endif /* _@GUARD_PREFIX@_LOCALE_H */
271 #endif /* _@GUARD_PREFIX@_LOCALE_H */
272 #endif /* !(__need_locale_t || _GL_ALREADY_INCLUDING_LOCALE_H) */