1 /* DO NOT EDIT! GENERATED AUTOMATICALLY! */
3 Copyright (C) 2007-2015 Free Software Foundation, Inc.
5 This program is free software: you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 3 of the License, or
8 (at your option) any later version.
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program. If not, see <http://www.gnu.org/licenses/>. */
19 #pragma GCC system_header
23 #ifdef _GL_ALREADY_INCLUDING_LOCALE_H
25 /* Special invocation conventions to handle Solaris header files
26 (through Solaris 10) when combined with gettext's libintl.h. */
28 #include_next <locale.h>
31 /* Normal invocation convention. */
35 #define _GL_ALREADY_INCLUDING_LOCALE_H
37 /* The include_next requires a split double-inclusion guard. */
38 #include_next <locale.h>
40 #undef _GL_ALREADY_INCLUDING_LOCALE_H
45 /* NetBSD 5.0 mis-defines NULL. */
48 /* Mac OS X 10.5 defines the locale_t type in <xlocale.h>. */
53 /* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */
57 /* The three most frequent use cases of these macros are:
59 * For providing a substitute for a function that is missing on some
60 platforms, but is declared and works fine on the platforms on which
65 _GL_FUNCDECL_SYS (foo, ...);
67 _GL_CXXALIAS_SYS (foo, ...);
68 _GL_CXXALIASWARN (foo);
69 #elif defined GNULIB_POSIXCHECK
73 * For providing a replacement for a function that exists on all platforms,
74 but is broken/insufficient and needs to be replaced on some platforms:
78 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
82 _GL_FUNCDECL_RPL (foo, ...);
83 _GL_CXXALIAS_RPL (foo, ...);
85 _GL_CXXALIAS_SYS (foo, ...);
87 _GL_CXXALIASWARN (foo);
88 #elif defined GNULIB_POSIXCHECK
92 * For providing a replacement for a function that exists on some platforms
93 but is broken/insufficient and needs to be replaced on some of them and
94 is additionally either missing or undeclared on some other platforms:
98 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
102 _GL_FUNCDECL_RPL (foo, ...);
103 _GL_CXXALIAS_RPL (foo, ...);
105 # if !@HAVE_FOO@ or if !@HAVE_DECL_FOO@
106 _GL_FUNCDECL_SYS (foo, ...);
108 _GL_CXXALIAS_SYS (foo, ...);
110 _GL_CXXALIASWARN (foo);
111 #elif defined GNULIB_POSIXCHECK
116 /* _GL_EXTERN_C declaration;
117 performs the declaration with C linkage. */
118 #if defined __cplusplus
119 # define _GL_EXTERN_C extern "C"
121 # define _GL_EXTERN_C extern
124 /* _GL_FUNCDECL_RPL (func, rettype, parameters_and_attributes);
125 declares a replacement function, named rpl_func, with the given prototype,
126 consisting of return type, parameters, and attributes.
128 _GL_FUNCDECL_RPL (open, int, (const char *filename, int flags, ...)
129 _GL_ARG_NONNULL ((1)));
131 #define _GL_FUNCDECL_RPL(func,rettype,parameters_and_attributes) \
132 _GL_FUNCDECL_RPL_1 (rpl_##func, rettype, parameters_and_attributes)
133 #define _GL_FUNCDECL_RPL_1(rpl_func,rettype,parameters_and_attributes) \
134 _GL_EXTERN_C rettype rpl_func parameters_and_attributes
136 /* _GL_FUNCDECL_SYS (func, rettype, parameters_and_attributes);
137 declares the system function, named func, with the given prototype,
138 consisting of return type, parameters, and attributes.
140 _GL_FUNCDECL_SYS (open, int, (const char *filename, int flags, ...)
141 _GL_ARG_NONNULL ((1)));
143 #define _GL_FUNCDECL_SYS(func,rettype,parameters_and_attributes) \
144 _GL_EXTERN_C rettype func parameters_and_attributes
146 /* _GL_CXXALIAS_RPL (func, rettype, parameters);
147 declares a C++ alias called GNULIB_NAMESPACE::func
148 that redirects to rpl_func, if GNULIB_NAMESPACE is defined.
150 _GL_CXXALIAS_RPL (open, int, (const char *filename, int flags, ...));
152 #define _GL_CXXALIAS_RPL(func,rettype,parameters) \
153 _GL_CXXALIAS_RPL_1 (func, rpl_##func, rettype, parameters)
154 #if defined __cplusplus && defined GNULIB_NAMESPACE
155 # define _GL_CXXALIAS_RPL_1(func,rpl_func,rettype,parameters) \
156 namespace GNULIB_NAMESPACE \
158 rettype (*const func) parameters = ::rpl_func; \
160 _GL_EXTERN_C int _gl_cxxalias_dummy
162 # define _GL_CXXALIAS_RPL_1(func,rpl_func,rettype,parameters) \
163 _GL_EXTERN_C int _gl_cxxalias_dummy
166 /* _GL_CXXALIAS_RPL_CAST_1 (func, rpl_func, rettype, parameters);
167 is like _GL_CXXALIAS_RPL_1 (func, rpl_func, rettype, parameters);
168 except that the C function rpl_func may have a slightly different
169 declaration. A cast is used to silence the "invalid conversion" error
170 that would otherwise occur. */
171 #if defined __cplusplus && defined GNULIB_NAMESPACE
172 # define _GL_CXXALIAS_RPL_CAST_1(func,rpl_func,rettype,parameters) \
173 namespace GNULIB_NAMESPACE \
175 rettype (*const func) parameters = \
176 reinterpret_cast<rettype(*)parameters>(::rpl_func); \
178 _GL_EXTERN_C int _gl_cxxalias_dummy
180 # define _GL_CXXALIAS_RPL_CAST_1(func,rpl_func,rettype,parameters) \
181 _GL_EXTERN_C int _gl_cxxalias_dummy
184 /* _GL_CXXALIAS_SYS (func, rettype, parameters);
185 declares a C++ alias called GNULIB_NAMESPACE::func
186 that redirects to the system provided function func, if GNULIB_NAMESPACE
189 _GL_CXXALIAS_SYS (open, int, (const char *filename, int flags, ...));
191 #if defined __cplusplus && defined GNULIB_NAMESPACE
192 /* If we were to write
193 rettype (*const func) parameters = ::func;
194 like above in _GL_CXXALIAS_RPL_1, the compiler could optimize calls
195 better (remove an indirection through a 'static' pointer variable),
196 but then the _GL_CXXALIASWARN macro below would cause a warning not only
197 for uses of ::func but also for uses of GNULIB_NAMESPACE::func. */
198 # define _GL_CXXALIAS_SYS(func,rettype,parameters) \
199 namespace GNULIB_NAMESPACE \
201 static rettype (*func) parameters = ::func; \
203 _GL_EXTERN_C int _gl_cxxalias_dummy
205 # define _GL_CXXALIAS_SYS(func,rettype,parameters) \
206 _GL_EXTERN_C int _gl_cxxalias_dummy
209 /* _GL_CXXALIAS_SYS_CAST (func, rettype, parameters);
210 is like _GL_CXXALIAS_SYS (func, rettype, parameters);
211 except that the C function func may have a slightly different declaration.
212 A cast is used to silence the "invalid conversion" error that would
214 #if defined __cplusplus && defined GNULIB_NAMESPACE
215 # define _GL_CXXALIAS_SYS_CAST(func,rettype,parameters) \
216 namespace GNULIB_NAMESPACE \
218 static rettype (*func) parameters = \
219 reinterpret_cast<rettype(*)parameters>(::func); \
221 _GL_EXTERN_C int _gl_cxxalias_dummy
223 # define _GL_CXXALIAS_SYS_CAST(func,rettype,parameters) \
224 _GL_EXTERN_C int _gl_cxxalias_dummy
227 /* _GL_CXXALIAS_SYS_CAST2 (func, rettype, parameters, rettype2, parameters2);
228 is like _GL_CXXALIAS_SYS (func, rettype, parameters);
229 except that the C function is picked among a set of overloaded functions,
230 namely the one with rettype2 and parameters2. Two consecutive casts
231 are used to silence the "cannot find a match" and "invalid conversion"
232 errors that would otherwise occur. */
233 #if defined __cplusplus && defined GNULIB_NAMESPACE
234 /* The outer cast must be a reinterpret_cast.
235 The inner cast: When the function is defined as a set of overloaded
236 functions, it works as a static_cast<>, choosing the designated variant.
237 When the function is defined as a single variant, it works as a
238 reinterpret_cast<>. The parenthesized cast syntax works both ways. */
239 # define _GL_CXXALIAS_SYS_CAST2(func,rettype,parameters,rettype2,parameters2) \
240 namespace GNULIB_NAMESPACE \
242 static rettype (*func) parameters = \
243 reinterpret_cast<rettype(*)parameters>( \
244 (rettype2(*)parameters2)(::func)); \
246 _GL_EXTERN_C int _gl_cxxalias_dummy
248 # define _GL_CXXALIAS_SYS_CAST2(func,rettype,parameters,rettype2,parameters2) \
249 _GL_EXTERN_C int _gl_cxxalias_dummy
252 /* _GL_CXXALIASWARN (func);
253 causes a warning to be emitted when ::func is used but not when
254 GNULIB_NAMESPACE::func is used. func must be defined without overloaded
256 #if defined __cplusplus && defined GNULIB_NAMESPACE
257 # define _GL_CXXALIASWARN(func) \
258 _GL_CXXALIASWARN_1 (func, GNULIB_NAMESPACE)
259 # define _GL_CXXALIASWARN_1(func,namespace) \
260 _GL_CXXALIASWARN_2 (func, namespace)
261 /* To work around GCC bug <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43881>,
262 we enable the warning only when not optimizing. */
264 # define _GL_CXXALIASWARN_2(func,namespace) \
265 _GL_WARN_ON_USE (func, \
266 "The symbol ::" #func " refers to the system function. " \
267 "Use " #namespace "::" #func " instead.")
268 # elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING
269 # define _GL_CXXALIASWARN_2(func,namespace) \
270 extern __typeof__ (func) func
272 # define _GL_CXXALIASWARN_2(func,namespace) \
273 _GL_EXTERN_C int _gl_cxxalias_dummy
276 # define _GL_CXXALIASWARN(func) \
277 _GL_EXTERN_C int _gl_cxxalias_dummy
280 /* _GL_CXXALIASWARN1 (func, rettype, parameters_and_attributes);
281 causes a warning to be emitted when the given overloaded variant of ::func
282 is used but not when GNULIB_NAMESPACE::func is used. */
283 #if defined __cplusplus && defined GNULIB_NAMESPACE
284 # define _GL_CXXALIASWARN1(func,rettype,parameters_and_attributes) \
285 _GL_CXXALIASWARN1_1 (func, rettype, parameters_and_attributes, \
287 # define _GL_CXXALIASWARN1_1(func,rettype,parameters_and_attributes,namespace) \
288 _GL_CXXALIASWARN1_2 (func, rettype, parameters_and_attributes, namespace)
289 /* To work around GCC bug <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43881>,
290 we enable the warning only when not optimizing. */
292 # define _GL_CXXALIASWARN1_2(func,rettype,parameters_and_attributes,namespace) \
293 _GL_WARN_ON_USE_CXX (func, rettype, parameters_and_attributes, \
294 "The symbol ::" #func " refers to the system function. " \
295 "Use " #namespace "::" #func " instead.")
296 # elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING
297 # define _GL_CXXALIASWARN1_2(func,rettype,parameters_and_attributes,namespace) \
298 extern __typeof__ (func) func
300 # define _GL_CXXALIASWARN1_2(func,rettype,parameters_and_attributes,namespace) \
301 _GL_EXTERN_C int _gl_cxxalias_dummy
304 # define _GL_CXXALIASWARN1(func,rettype,parameters_and_attributes) \
305 _GL_EXTERN_C int _gl_cxxalias_dummy
308 #endif /* _GL_CXXDEFS_H */
310 /* The definition of _GL_ARG_NONNULL is copied here. */
311 /* _GL_ARG_NONNULL((n,...,m)) tells the compiler and static analyzer tools
312 that the values passed as arguments n, ..., m must be non-NULL pointers.
313 n = 1 stands for the first argument, n = 2 for the second argument etc. */
314 #ifndef _GL_ARG_NONNULL
315 # if (__GNUC__ == 3 && __GNUC_MINOR__ >= 3) || __GNUC__ > 3
316 # define _GL_ARG_NONNULL(params) __attribute__ ((__nonnull__ params))
318 # define _GL_ARG_NONNULL(params)
322 /* The definition of _GL_WARN_ON_USE is copied here. */
323 #ifndef _GL_WARN_ON_USE
325 # if 4 < __GNUC__ || (__GNUC__ == 4 && 3 <= __GNUC_MINOR__)
326 /* A compiler attribute is available in gcc versions 4.3.0 and later. */
327 # define _GL_WARN_ON_USE(function, message) \
328 extern __typeof__ (function) function __attribute__ ((__warning__ (message)))
329 # elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING
330 /* Verify the existence of the function. */
331 # define _GL_WARN_ON_USE(function, message) \
332 extern __typeof__ (function) function
333 # else /* Unsupported. */
334 # define _GL_WARN_ON_USE(function, message) \
335 _GL_WARN_EXTERN_C int _gl_warn_on_use
339 /* _GL_WARN_ON_USE_CXX (function, rettype, parameters_and_attributes, "string")
340 is like _GL_WARN_ON_USE (function, "string"), except that the function is
341 declared with the given prototype, consisting of return type, parameters,
343 This variant is useful for overloaded functions in C++. _GL_WARN_ON_USE does
344 not work in this case. */
345 #ifndef _GL_WARN_ON_USE_CXX
346 # if 4 < __GNUC__ || (__GNUC__ == 4 && 3 <= __GNUC_MINOR__)
347 # define _GL_WARN_ON_USE_CXX(function,rettype,parameters_and_attributes,msg) \
348 extern rettype function parameters_and_attributes \
349 __attribute__ ((__warning__ (msg)))
350 # elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING
351 /* Verify the existence of the function. */
352 # define _GL_WARN_ON_USE_CXX(function,rettype,parameters_and_attributes,msg) \
353 extern rettype function parameters_and_attributes
354 # else /* Unsupported. */
355 # define _GL_WARN_ON_USE_CXX(function,rettype,parameters_and_attributes,msg) \
356 _GL_WARN_EXTERN_C int _gl_warn_on_use
360 /* _GL_WARN_EXTERN_C declaration;
361 performs the declaration with C linkage. */
362 #ifndef _GL_WARN_EXTERN_C
363 # if defined __cplusplus
364 # define _GL_WARN_EXTERN_C extern "C"
366 # define _GL_WARN_EXTERN_C extern
370 /* The LC_MESSAGES locale category is specified in POSIX, but not in ISO C.
371 On systems that don't define it, use the same value as GNU libintl. */
372 #if !defined LC_MESSAGES
373 # define LC_MESSAGES 1729
376 /* Bionic libc's 'struct lconv' is just a dummy. */
378 # define lconv rpl_lconv
381 /* All 'char *' are actually 'const char *'. */
383 /* Members that depend on the LC_NUMERIC category of the locale. See
384 <http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap07.html#tag_07_03_04> */
386 /* Symbol used as decimal point. */
388 /* Symbol used to separate groups of digits to the left of the decimal
391 /* Definition of the size of groups of digits to the left of the decimal
395 /* Members that depend on the LC_MONETARY category of the locale. See
396 <http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap07.html#tag_07_03_03> */
398 /* Symbol used as decimal point. */
399 char *mon_decimal_point;
400 /* Symbol used to separate groups of digits to the left of the decimal
402 char *mon_thousands_sep;
403 /* Definition of the size of groups of digits to the left of the decimal
406 /* Sign used to indicate a value >= 0. */
408 /* Sign used to indicate a value < 0. */
411 /* For formatting local currency. */
412 /* Currency symbol (3 characters) followed by separator (1 character). */
413 char *currency_symbol;
414 /* Number of digits after the decimal point. */
416 /* For values >= 0: 1 if the currency symbol precedes the number, 0 if it
417 comes after the number. */
419 /* For values >= 0: Position of the sign. */
421 /* For values >= 0: Placement of spaces between currency symbol, sign, and
424 /* For values < 0: 1 if the currency symbol precedes the number, 0 if it
425 comes after the number. */
427 /* For values < 0: Position of the sign. */
429 /* For values < 0: Placement of spaces between currency symbol, sign, and
433 /* For formatting international currency. */
434 /* Currency symbol (3 characters) followed by separator (1 character). */
435 char *int_curr_symbol;
436 /* Number of digits after the decimal point. */
437 char int_frac_digits;
438 /* For values >= 0: 1 if the currency symbol precedes the number, 0 if it
439 comes after the number. */
440 char int_p_cs_precedes;
441 /* For values >= 0: Position of the sign. */
442 char int_p_sign_posn;
443 /* For values >= 0: Placement of spaces between currency symbol, sign, and
445 char int_p_sep_by_space;
446 /* For values < 0: 1 if the currency symbol precedes the number, 0 if it
447 comes after the number. */
448 char int_n_cs_precedes;
449 /* For values < 0: Position of the sign. */
450 char int_n_sign_posn;
451 /* For values < 0: Placement of spaces between currency symbol, sign, and
453 char int_n_sep_by_space;
459 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
461 # define localeconv rpl_localeconv
463 _GL_FUNCDECL_RPL (localeconv, struct lconv *, (void));
464 _GL_CXXALIAS_RPL (localeconv, struct lconv *, (void));
466 _GL_CXXALIAS_SYS (localeconv, struct lconv *, (void));
468 _GL_CXXALIASWARN (localeconv);
471 # define localeconv localeconv_used_without_requesting_gnulib_module_localeconv
472 #elif defined GNULIB_POSIXCHECK
474 # if HAVE_RAW_DECL_LOCALECONV
475 _GL_WARN_ON_USE (localeconv,
476 "localeconv returns too few information on some platforms - "
477 "use gnulib module localeconv for portability");
481 #if IN_GREP_GNULIB_TESTS
483 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
485 # define setlocale rpl_setlocale
486 # define GNULIB_defined_setlocale 1
488 _GL_FUNCDECL_RPL (setlocale, char *, (int category, const char *locale));
489 _GL_CXXALIAS_RPL (setlocale, char *, (int category, const char *locale));
491 _GL_CXXALIAS_SYS (setlocale, char *, (int category, const char *locale));
493 _GL_CXXALIASWARN (setlocale);
494 #elif defined GNULIB_POSIXCHECK
496 # if HAVE_RAW_DECL_SETLOCALE
497 _GL_WARN_ON_USE (setlocale, "setlocale works differently on native Windows - "
498 "use gnulib module setlocale for portability");
504 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
506 # define duplocale rpl_duplocale
508 _GL_FUNCDECL_RPL (duplocale, locale_t, (locale_t locale) _GL_ARG_NONNULL ((1)));
509 _GL_CXXALIAS_RPL (duplocale, locale_t, (locale_t locale));
512 _GL_CXXALIAS_SYS (duplocale, locale_t, (locale_t locale));
516 _GL_CXXALIASWARN (duplocale);
518 #elif defined GNULIB_POSIXCHECK
520 # if HAVE_RAW_DECL_DUPLOCALE
521 _GL_WARN_ON_USE (duplocale, "duplocale is buggy on some glibc systems - "
522 "use gnulib module duplocale for portability");
526 #endif /* _GL_LOCALE_H */
527 #endif /* ! _GL_ALREADY_INCLUDING_LOCALE_H */
528 #endif /* _GL_LOCALE_H */