1 /* DO NOT EDIT! GENERATED AUTOMATICALLY! */
3 Copyright (C) 2007-2020 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 <https://www.gnu.org/licenses/>. */
19 #pragma GCC system_header
23 #if (defined _WIN32 && !defined __CYGWIN__ && defined __need_locale_t) \
24 || defined _GL_ALREADY_INCLUDING_LOCALE_H
26 /* Special invocation convention:
27 - Inside mingw header files,
28 - To handle Solaris header files (through Solaris 10) when combined
29 with gettext's libintl.h. */
31 #include_next <locale.h>
34 /* Normal invocation convention. */
38 #define _GL_ALREADY_INCLUDING_LOCALE_H
40 /* The include_next requires a split double-inclusion guard. */
41 #include_next <locale.h>
43 #undef _GL_ALREADY_INCLUDING_LOCALE_H
48 /* NetBSD 5.0 mis-defines NULL. */
51 /* Mac OS X 10.5 defines the locale_t type in <xlocale.h>. */
56 /* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */
57 /* C++ compatible function declaration macros.
58 Copyright (C) 2010-2020 Free Software Foundation, Inc.
60 This program is free software: you can redistribute it and/or modify it
61 under the terms of the GNU General Public License as published
62 by the Free Software Foundation; either version 3 of the License, or
63 (at your option) any later version.
65 This program is distributed in the hope that it will be useful,
66 but WITHOUT ANY WARRANTY; without even the implied warranty of
67 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
68 General Public License for more details.
70 You should have received a copy of the GNU General Public License
71 along with this program. If not, see <https://www.gnu.org/licenses/>. */
76 /* Begin/end the GNULIB_NAMESPACE namespace. */
77 #if defined __cplusplus && defined GNULIB_NAMESPACE
78 # define _GL_BEGIN_NAMESPACE namespace GNULIB_NAMESPACE {
79 # define _GL_END_NAMESPACE }
81 # define _GL_BEGIN_NAMESPACE
82 # define _GL_END_NAMESPACE
85 /* The three most frequent use cases of these macros are:
87 * For providing a substitute for a function that is missing on some
88 platforms, but is declared and works fine on the platforms on which
93 _GL_FUNCDECL_SYS (foo, ...);
95 _GL_CXXALIAS_SYS (foo, ...);
96 _GL_CXXALIASWARN (foo);
97 #elif defined GNULIB_POSIXCHECK
101 * For providing a replacement for a function that exists on all platforms,
102 but is broken/insufficient and needs to be replaced on some platforms:
106 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
110 _GL_FUNCDECL_RPL (foo, ...);
111 _GL_CXXALIAS_RPL (foo, ...);
113 _GL_CXXALIAS_SYS (foo, ...);
115 _GL_CXXALIASWARN (foo);
116 #elif defined GNULIB_POSIXCHECK
120 * For providing a replacement for a function that exists on some platforms
121 but is broken/insufficient and needs to be replaced on some of them and
122 is additionally either missing or undeclared on some other platforms:
126 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
130 _GL_FUNCDECL_RPL (foo, ...);
131 _GL_CXXALIAS_RPL (foo, ...);
133 # if !@HAVE_FOO@ or if !@HAVE_DECL_FOO@
134 _GL_FUNCDECL_SYS (foo, ...);
136 _GL_CXXALIAS_SYS (foo, ...);
138 _GL_CXXALIASWARN (foo);
139 #elif defined GNULIB_POSIXCHECK
144 /* _GL_EXTERN_C declaration;
145 performs the declaration with C linkage. */
146 #if defined __cplusplus
147 # define _GL_EXTERN_C extern "C"
149 # define _GL_EXTERN_C extern
152 /* _GL_FUNCDECL_RPL (func, rettype, parameters_and_attributes);
153 declares a replacement function, named rpl_func, with the given prototype,
154 consisting of return type, parameters, and attributes.
156 _GL_FUNCDECL_RPL (open, int, (const char *filename, int flags, ...)
157 _GL_ARG_NONNULL ((1)));
159 #define _GL_FUNCDECL_RPL(func,rettype,parameters_and_attributes) \
160 _GL_FUNCDECL_RPL_1 (rpl_##func, rettype, parameters_and_attributes)
161 #define _GL_FUNCDECL_RPL_1(rpl_func,rettype,parameters_and_attributes) \
162 _GL_EXTERN_C rettype rpl_func parameters_and_attributes
164 /* _GL_FUNCDECL_SYS (func, rettype, parameters_and_attributes);
165 declares the system function, named func, with the given prototype,
166 consisting of return type, parameters, and attributes.
168 _GL_FUNCDECL_SYS (open, int, (const char *filename, int flags, ...)
169 _GL_ARG_NONNULL ((1)));
171 #define _GL_FUNCDECL_SYS(func,rettype,parameters_and_attributes) \
172 _GL_EXTERN_C rettype func parameters_and_attributes
174 /* _GL_CXXALIAS_RPL (func, rettype, parameters);
175 declares a C++ alias called GNULIB_NAMESPACE::func
176 that redirects to rpl_func, if GNULIB_NAMESPACE is defined.
178 _GL_CXXALIAS_RPL (open, int, (const char *filename, int flags, ...));
180 Wrapping rpl_func in an object with an inline conversion operator
181 avoids a reference to rpl_func unless GNULIB_NAMESPACE::func is
182 actually used in the program. */
183 #define _GL_CXXALIAS_RPL(func,rettype,parameters) \
184 _GL_CXXALIAS_RPL_1 (func, rpl_##func, rettype, parameters)
185 #if defined __cplusplus && defined GNULIB_NAMESPACE
186 # define _GL_CXXALIAS_RPL_1(func,rpl_func,rettype,parameters) \
187 namespace GNULIB_NAMESPACE \
189 static const struct _gl_ ## func ## _wrapper \
191 typedef rettype (*type) parameters; \
193 inline operator type () const \
199 _GL_EXTERN_C int _gl_cxxalias_dummy
201 # define _GL_CXXALIAS_RPL_1(func,rpl_func,rettype,parameters) \
202 _GL_EXTERN_C int _gl_cxxalias_dummy
205 /* _GL_CXXALIAS_RPL_CAST_1 (func, rpl_func, rettype, parameters);
206 is like _GL_CXXALIAS_RPL_1 (func, rpl_func, rettype, parameters);
207 except that the C function rpl_func may have a slightly different
208 declaration. A cast is used to silence the "invalid conversion" error
209 that would otherwise occur. */
210 #if defined __cplusplus && defined GNULIB_NAMESPACE
211 # define _GL_CXXALIAS_RPL_CAST_1(func,rpl_func,rettype,parameters) \
212 namespace GNULIB_NAMESPACE \
214 static const struct _gl_ ## func ## _wrapper \
216 typedef rettype (*type) parameters; \
218 inline operator type () const \
220 return reinterpret_cast<type>(::rpl_func); \
224 _GL_EXTERN_C int _gl_cxxalias_dummy
226 # define _GL_CXXALIAS_RPL_CAST_1(func,rpl_func,rettype,parameters) \
227 _GL_EXTERN_C int _gl_cxxalias_dummy
230 /* _GL_CXXALIAS_SYS (func, rettype, parameters);
231 declares a C++ alias called GNULIB_NAMESPACE::func
232 that redirects to the system provided function func, if GNULIB_NAMESPACE
235 _GL_CXXALIAS_SYS (open, int, (const char *filename, int flags, ...));
237 Wrapping func in an object with an inline conversion operator
238 avoids a reference to func unless GNULIB_NAMESPACE::func is
239 actually used in the program. */
240 #if defined __cplusplus && defined GNULIB_NAMESPACE
241 # define _GL_CXXALIAS_SYS(func,rettype,parameters) \
242 namespace GNULIB_NAMESPACE \
244 static const struct _gl_ ## func ## _wrapper \
246 typedef rettype (*type) parameters; \
248 inline operator type () const \
254 _GL_EXTERN_C int _gl_cxxalias_dummy
256 # define _GL_CXXALIAS_SYS(func,rettype,parameters) \
257 _GL_EXTERN_C int _gl_cxxalias_dummy
260 /* _GL_CXXALIAS_SYS_CAST (func, rettype, parameters);
261 is like _GL_CXXALIAS_SYS (func, rettype, parameters);
262 except that the C function func may have a slightly different declaration.
263 A cast is used to silence the "invalid conversion" error that would
265 #if defined __cplusplus && defined GNULIB_NAMESPACE
266 # define _GL_CXXALIAS_SYS_CAST(func,rettype,parameters) \
267 namespace GNULIB_NAMESPACE \
269 static const struct _gl_ ## func ## _wrapper \
271 typedef rettype (*type) parameters; \
273 inline operator type () const \
275 return reinterpret_cast<type>(::func); \
279 _GL_EXTERN_C int _gl_cxxalias_dummy
281 # define _GL_CXXALIAS_SYS_CAST(func,rettype,parameters) \
282 _GL_EXTERN_C int _gl_cxxalias_dummy
285 /* _GL_CXXALIAS_SYS_CAST2 (func, rettype, parameters, rettype2, parameters2);
286 is like _GL_CXXALIAS_SYS (func, rettype, parameters);
287 except that the C function is picked among a set of overloaded functions,
288 namely the one with rettype2 and parameters2. Two consecutive casts
289 are used to silence the "cannot find a match" and "invalid conversion"
290 errors that would otherwise occur. */
291 #if defined __cplusplus && defined GNULIB_NAMESPACE
292 /* The outer cast must be a reinterpret_cast.
293 The inner cast: When the function is defined as a set of overloaded
294 functions, it works as a static_cast<>, choosing the designated variant.
295 When the function is defined as a single variant, it works as a
296 reinterpret_cast<>. The parenthesized cast syntax works both ways. */
297 # define _GL_CXXALIAS_SYS_CAST2(func,rettype,parameters,rettype2,parameters2) \
298 namespace GNULIB_NAMESPACE \
300 static const struct _gl_ ## func ## _wrapper \
302 typedef rettype (*type) parameters; \
304 inline operator type () const \
306 return reinterpret_cast<type>((rettype2 (*) parameters2)(::func)); \
310 _GL_EXTERN_C int _gl_cxxalias_dummy
312 # define _GL_CXXALIAS_SYS_CAST2(func,rettype,parameters,rettype2,parameters2) \
313 _GL_EXTERN_C int _gl_cxxalias_dummy
316 /* _GL_CXXALIASWARN (func);
317 causes a warning to be emitted when ::func is used but not when
318 GNULIB_NAMESPACE::func is used. func must be defined without overloaded
320 #if defined __cplusplus && defined GNULIB_NAMESPACE
321 # define _GL_CXXALIASWARN(func) \
322 _GL_CXXALIASWARN_1 (func, GNULIB_NAMESPACE)
323 # define _GL_CXXALIASWARN_1(func,namespace) \
324 _GL_CXXALIASWARN_2 (func, namespace)
325 /* To work around GCC bug <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=43881>,
326 we enable the warning only when not optimizing. */
328 # define _GL_CXXALIASWARN_2(func,namespace) \
329 _GL_WARN_ON_USE (func, \
330 "The symbol ::" #func " refers to the system function. " \
331 "Use " #namespace "::" #func " instead.")
332 # elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING
333 # define _GL_CXXALIASWARN_2(func,namespace) \
334 extern __typeof__ (func) func
336 # define _GL_CXXALIASWARN_2(func,namespace) \
337 _GL_EXTERN_C int _gl_cxxalias_dummy
340 # define _GL_CXXALIASWARN(func) \
341 _GL_EXTERN_C int _gl_cxxalias_dummy
344 /* _GL_CXXALIASWARN1 (func, rettype, parameters_and_attributes);
345 causes a warning to be emitted when the given overloaded variant of ::func
346 is used but not when GNULIB_NAMESPACE::func is used. */
347 #if defined __cplusplus && defined GNULIB_NAMESPACE
348 # define _GL_CXXALIASWARN1(func,rettype,parameters_and_attributes) \
349 _GL_CXXALIASWARN1_1 (func, rettype, parameters_and_attributes, \
351 # define _GL_CXXALIASWARN1_1(func,rettype,parameters_and_attributes,namespace) \
352 _GL_CXXALIASWARN1_2 (func, rettype, parameters_and_attributes, namespace)
353 /* To work around GCC bug <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=43881>,
354 we enable the warning only when not optimizing. */
356 # define _GL_CXXALIASWARN1_2(func,rettype,parameters_and_attributes,namespace) \
357 _GL_WARN_ON_USE_CXX (func, rettype, parameters_and_attributes, \
358 "The symbol ::" #func " refers to the system function. " \
359 "Use " #namespace "::" #func " instead.")
360 # elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING
361 # define _GL_CXXALIASWARN1_2(func,rettype,parameters_and_attributes,namespace) \
362 extern __typeof__ (func) func
364 # define _GL_CXXALIASWARN1_2(func,rettype,parameters_and_attributes,namespace) \
365 _GL_EXTERN_C int _gl_cxxalias_dummy
368 # define _GL_CXXALIASWARN1(func,rettype,parameters_and_attributes) \
369 _GL_EXTERN_C int _gl_cxxalias_dummy
372 #endif /* _GL_CXXDEFS_H */
374 /* The definition of _GL_ARG_NONNULL is copied here. */
375 /* A C macro for declaring that specific arguments must not be NULL.
376 Copyright (C) 2009-2020 Free Software Foundation, Inc.
378 This program is free software: you can redistribute it and/or modify it
379 under the terms of the GNU General Public License as published
380 by the Free Software Foundation; either version 3 of the License, or
381 (at your option) any later version.
383 This program is distributed in the hope that it will be useful,
384 but WITHOUT ANY WARRANTY; without even the implied warranty of
385 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
386 General Public License for more details.
388 You should have received a copy of the GNU General Public License
389 along with this program. If not, see <https://www.gnu.org/licenses/>. */
391 /* _GL_ARG_NONNULL((n,...,m)) tells the compiler and static analyzer tools
392 that the values passed as arguments n, ..., m must be non-NULL pointers.
393 n = 1 stands for the first argument, n = 2 for the second argument etc. */
394 #ifndef _GL_ARG_NONNULL
395 # if (__GNUC__ == 3 && __GNUC_MINOR__ >= 3) || __GNUC__ > 3
396 # define _GL_ARG_NONNULL(params) __attribute__ ((__nonnull__ params))
398 # define _GL_ARG_NONNULL(params)
402 /* The definition of _GL_WARN_ON_USE is copied here. */
403 /* A C macro for emitting warnings if a function is used.
404 Copyright (C) 2010-2020 Free Software Foundation, Inc.
406 This program is free software: you can redistribute it and/or modify it
407 under the terms of the GNU General Public License as published
408 by the Free Software Foundation; either version 3 of the License, or
409 (at your option) any later version.
411 This program is distributed in the hope that it will be useful,
412 but WITHOUT ANY WARRANTY; without even the implied warranty of
413 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
414 General Public License for more details.
416 You should have received a copy of the GNU General Public License
417 along with this program. If not, see <https://www.gnu.org/licenses/>. */
419 /* _GL_WARN_ON_USE (function, "literal string") issues a declaration
420 for FUNCTION which will then trigger a compiler warning containing
421 the text of "literal string" anywhere that function is called, if
422 supported by the compiler. If the compiler does not support this
423 feature, the macro expands to an unused extern declaration.
425 _GL_WARN_ON_USE_ATTRIBUTE ("literal string") expands to the
426 attribute used in _GL_WARN_ON_USE. If the compiler does not support
427 this feature, it expands to empty.
429 These macros are useful for marking a function as a potential
430 portability trap, with the intent that "literal string" include
431 instructions on the replacement function that should be used
433 _GL_WARN_ON_USE is for functions with 'extern' linkage.
434 _GL_WARN_ON_USE_ATTRIBUTE is for functions with 'static' or 'inline'
437 However, one of the reasons that a function is a portability trap is
438 if it has the wrong signature. Declaring FUNCTION with a different
439 signature in C is a compilation error, so this macro must use the
440 same type as any existing declaration so that programs that avoid
441 the problematic FUNCTION do not fail to compile merely because they
442 included a header that poisoned the function. But this implies that
443 _GL_WARN_ON_USE is only safe to use if FUNCTION is known to already
444 have a declaration. Use of this macro implies that there must not
445 be any other macro hiding the declaration of FUNCTION; but
446 undefining FUNCTION first is part of the poisoning process anyway
447 (although for symbols that are provided only via a macro, the result
448 is a compilation error rather than a warning containing
449 "literal string"). Also note that in C++, it is only safe to use if
450 FUNCTION has no overloads.
452 For an example, it is possible to poison 'getline' by:
453 - adding a call to gl_WARN_ON_USE_PREPARE([[#include <stdio.h>]],
454 [getline]) in configure.ac, which potentially defines
455 HAVE_RAW_DECL_GETLINE
456 - adding this code to a header that wraps the system <stdio.h>:
458 #if HAVE_RAW_DECL_GETLINE
459 _GL_WARN_ON_USE (getline, "getline is required by POSIX 2008, but"
460 "not universally present; use the gnulib module getline");
463 It is not possible to directly poison global variables. But it is
464 possible to write a wrapper accessor function, and poison that
465 (less common usage, like &environ, will cause a compilation error
466 rather than issue the nice warning, but the end result of informing
467 the developer about their portability problem is still achieved):
468 #if HAVE_RAW_DECL_ENVIRON
470 rpl_environ (void) { return &environ; }
471 _GL_WARN_ON_USE (rpl_environ, "environ is not always properly declared");
473 # define environ (*rpl_environ ())
475 or better (avoiding contradictory use of 'static' and 'extern'):
476 #if HAVE_RAW_DECL_ENVIRON
478 _GL_WARN_ON_USE_ATTRIBUTE ("environ is not always properly declared")
479 rpl_environ (void) { return &environ; }
481 # define environ (*rpl_environ ())
484 #ifndef _GL_WARN_ON_USE
486 # if 4 < __GNUC__ || (__GNUC__ == 4 && 3 <= __GNUC_MINOR__)
487 /* A compiler attribute is available in gcc versions 4.3.0 and later. */
488 # define _GL_WARN_ON_USE(function, message) \
489 extern __typeof__ (function) function __attribute__ ((__warning__ (message)))
490 # define _GL_WARN_ON_USE_ATTRIBUTE(message) \
491 __attribute__ ((__warning__ (message)))
492 # elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING
493 /* Verify the existence of the function. */
494 # define _GL_WARN_ON_USE(function, message) \
495 extern __typeof__ (function) function
496 # define _GL_WARN_ON_USE_ATTRIBUTE(message)
497 # else /* Unsupported. */
498 # define _GL_WARN_ON_USE(function, message) \
499 _GL_WARN_EXTERN_C int _gl_warn_on_use
500 # define _GL_WARN_ON_USE_ATTRIBUTE(message)
504 /* _GL_WARN_ON_USE_CXX (function, rettype, parameters_and_attributes, "string")
505 is like _GL_WARN_ON_USE (function, "string"), except that the function is
506 declared with the given prototype, consisting of return type, parameters,
508 This variant is useful for overloaded functions in C++. _GL_WARN_ON_USE does
509 not work in this case. */
510 #ifndef _GL_WARN_ON_USE_CXX
511 # if 4 < __GNUC__ || (__GNUC__ == 4 && 3 <= __GNUC_MINOR__)
512 # define _GL_WARN_ON_USE_CXX(function,rettype,parameters_and_attributes,msg) \
513 extern rettype function parameters_and_attributes \
514 __attribute__ ((__warning__ (msg)))
515 # elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING
516 /* Verify the existence of the function. */
517 # define _GL_WARN_ON_USE_CXX(function,rettype,parameters_and_attributes,msg) \
518 extern rettype function parameters_and_attributes
519 # else /* Unsupported. */
520 # define _GL_WARN_ON_USE_CXX(function,rettype,parameters_and_attributes,msg) \
521 _GL_WARN_EXTERN_C int _gl_warn_on_use
525 /* _GL_WARN_EXTERN_C declaration;
526 performs the declaration with C linkage. */
527 #ifndef _GL_WARN_EXTERN_C
528 # if defined __cplusplus
529 # define _GL_WARN_EXTERN_C extern "C"
531 # define _GL_WARN_EXTERN_C extern
535 /* The LC_MESSAGES locale category is specified in POSIX, but not in ISO C.
536 On systems that don't define it, use the same value as GNU libintl. */
537 #if !defined LC_MESSAGES
538 # define LC_MESSAGES 1729
541 /* On native Windows with MSVC, 'struct lconv' lacks the members int_p_* and
542 int_n_*. Instead of overriding 'struct lconv', merely define these member
543 names as macros. This avoids trouble in C++ mode. */
545 # define int_p_cs_precedes p_cs_precedes
546 # define int_p_sign_posn p_sign_posn
547 # define int_p_sep_by_space p_sep_by_space
548 # define int_n_cs_precedes n_cs_precedes
549 # define int_n_sign_posn n_sign_posn
550 # define int_n_sep_by_space n_sep_by_space
553 /* Bionic libc's 'struct lconv' is just a dummy. */
555 # define lconv rpl_lconv
558 /* All 'char *' are actually 'const char *'. */
560 /* Members that depend on the LC_NUMERIC category of the locale. See
561 <https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap07.html#tag_07_03_04> */
563 /* Symbol used as decimal point. */
565 /* Symbol used to separate groups of digits to the left of the decimal
568 /* Definition of the size of groups of digits to the left of the decimal
572 /* Members that depend on the LC_MONETARY category of the locale. See
573 <https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap07.html#tag_07_03_03> */
575 /* Symbol used as decimal point. */
576 char *mon_decimal_point
;
577 /* Symbol used to separate groups of digits to the left of the decimal
579 char *mon_thousands_sep
;
580 /* Definition of the size of groups of digits to the left of the decimal
583 /* Sign used to indicate a value >= 0. */
585 /* Sign used to indicate a value < 0. */
588 /* For formatting local currency. */
589 /* Currency symbol (3 characters) followed by separator (1 character). */
590 char *currency_symbol
;
591 /* Number of digits after the decimal point. */
593 /* For values >= 0: 1 if the currency symbol precedes the number, 0 if it
594 comes after the number. */
596 /* For values >= 0: Position of the sign. */
598 /* For values >= 0: Placement of spaces between currency symbol, sign, and
601 /* For values < 0: 1 if the currency symbol precedes the number, 0 if it
602 comes after the number. */
604 /* For values < 0: Position of the sign. */
606 /* For values < 0: Placement of spaces between currency symbol, sign, and
610 /* For formatting international currency. */
611 /* Currency symbol (3 characters) followed by separator (1 character). */
612 char *int_curr_symbol
;
613 /* Number of digits after the decimal point. */
614 char int_frac_digits
;
615 /* For values >= 0: 1 if the currency symbol precedes the number, 0 if it
616 comes after the number. */
617 char int_p_cs_precedes
;
618 /* For values >= 0: Position of the sign. */
619 char int_p_sign_posn
;
620 /* For values >= 0: Placement of spaces between currency symbol, sign, and
622 char int_p_sep_by_space
;
623 /* For values < 0: 1 if the currency symbol precedes the number, 0 if it
624 comes after the number. */
625 char int_n_cs_precedes
;
626 /* For values < 0: Position of the sign. */
627 char int_n_sign_posn
;
628 /* For values < 0: Placement of spaces between currency symbol, sign, and
630 char int_n_sep_by_space
;
636 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
638 # define localeconv rpl_localeconv
640 _GL_FUNCDECL_RPL (localeconv
, struct lconv
*, (void));
641 _GL_CXXALIAS_RPL (localeconv
, struct lconv
*, (void));
643 _GL_CXXALIAS_SYS (localeconv
, struct lconv
*, (void));
646 _GL_CXXALIASWARN (localeconv
);
650 # define localeconv localeconv_used_without_requesting_gnulib_module_localeconv
651 #elif defined GNULIB_POSIXCHECK
653 # if HAVE_RAW_DECL_LOCALECONV
654 _GL_WARN_ON_USE (localeconv
,
655 "localeconv returns too few information on some platforms - "
656 "use gnulib module localeconv for portability");
660 #if IN_GREP_GNULIB_TESTS
662 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
664 # define setlocale rpl_setlocale
665 # define GNULIB_defined_setlocale 1
667 _GL_FUNCDECL_RPL (setlocale
, char *, (int category
, const char *locale
));
668 _GL_CXXALIAS_RPL (setlocale
, char *, (int category
, const char *locale
));
670 _GL_CXXALIAS_SYS (setlocale
, char *, (int category
, const char *locale
));
673 _GL_CXXALIASWARN (setlocale
);
675 #elif defined GNULIB_POSIXCHECK
677 # if HAVE_RAW_DECL_SETLOCALE
678 _GL_WARN_ON_USE (setlocale
, "setlocale works differently on native Windows - "
679 "use gnulib module setlocale for portability");
684 /* Included here for convenience. */
685 # include "setlocale_null.h"
688 #if /*@GNULIB_NEWLOCALE@ ||*/ (IN_GREP_GNULIB_TESTS && 1)
690 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
692 # define newlocale rpl_newlocale
693 # define GNULIB_defined_newlocale 1
695 _GL_FUNCDECL_RPL (newlocale
, locale_t
,
696 (int category_mask
, const char *name
, locale_t base
)
697 _GL_ARG_NONNULL ((2)));
698 _GL_CXXALIAS_RPL (newlocale
, locale_t
,
699 (int category_mask
, const char *name
, locale_t base
));
702 _GL_CXXALIAS_SYS (newlocale
, locale_t
,
703 (int category_mask
, const char *name
, locale_t base
));
707 _GL_CXXALIASWARN (newlocale
);
710 # ifndef HAVE_WORKING_NEWLOCALE
711 # define HAVE_WORKING_NEWLOCALE 1
714 #elif defined GNULIB_POSIXCHECK
716 # if HAVE_RAW_DECL_NEWLOCALE
717 _GL_WARN_ON_USE (newlocale
, "newlocale is not portable");
721 #if 0 || (IN_GREP_GNULIB_TESTS && 1)
723 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
725 # define duplocale rpl_duplocale
726 # define GNULIB_defined_duplocale 1
728 _GL_FUNCDECL_RPL (duplocale
, locale_t
, (locale_t locale
) _GL_ARG_NONNULL ((1)));
729 _GL_CXXALIAS_RPL (duplocale
, locale_t
, (locale_t locale
));
732 _GL_CXXALIAS_SYS (duplocale
, locale_t
, (locale_t locale
));
736 _GL_CXXALIASWARN (duplocale
);
739 # ifndef HAVE_WORKING_DUPLOCALE
740 # define HAVE_WORKING_DUPLOCALE 1
743 #elif defined GNULIB_POSIXCHECK
745 # if HAVE_RAW_DECL_DUPLOCALE
746 _GL_WARN_ON_USE (duplocale
, "duplocale is buggy on some glibc systems - "
747 "use gnulib module duplocale for portability");
751 #if /*@GNULIB_FREELOCALE@ ||*/ (IN_GREP_GNULIB_TESTS && 1)
753 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
755 # define freelocale rpl_freelocale
756 # define GNULIB_defined_freelocale 1
758 _GL_FUNCDECL_RPL (freelocale
, void, (locale_t locale
) _GL_ARG_NONNULL ((1)));
759 _GL_CXXALIAS_RPL (freelocale
, void, (locale_t locale
));
762 /* Need to cast, because on FreeBSD and Mac OS X 10.13, the return type is
764 _GL_CXXALIAS_SYS_CAST (freelocale
, void, (locale_t locale
));
768 _GL_CXXALIASWARN (freelocale
);
770 #elif defined GNULIB_POSIXCHECK
772 # if HAVE_RAW_DECL_FREELOCALE
773 _GL_WARN_ON_USE (freelocale
, "freelocale is not portable");
777 #endif /* _GL_LOCALE_H */
778 #endif /* _GL_LOCALE_H */
779 #endif /* !(__need_locale_t || _GL_ALREADY_INCLUDING_LOCALE_H) */