1 /* This file is automatically generated.  DO NOT EDIT! */
2 /* Generated from: NetBSD: mknative-gdb,v 1.12 2020/09/17 16:54:31 christos Exp  */
3 /* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp  */
4 
5 /* DO NOT EDIT! GENERATED AUTOMATICALLY! */
6 /* A POSIX <locale.h>.
7    Copyright (C) 2007-2020 Free Software Foundation, Inc.
8 
9    This program is free software: you can redistribute it and/or modify
10    it under the terms of the GNU General Public License as published by
11    the Free Software Foundation; either version 3 of the License, or
12    (at your option) any later version.
13 
14    This program is distributed in the hope that it will be useful,
15    but WITHOUT ANY WARRANTY; without even the implied warranty of
16    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17    GNU General Public License for more details.
18 
19    You should have received a copy of the GNU General Public License
20    along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
21 
22 #if __GNUC__ >= 3
23 #pragma GCC system_header
24 #endif
25 
26 
27 #if (defined _WIN32 && !defined __CYGWIN__ && defined __need_locale_t) \
28     || defined _GL_ALREADY_INCLUDING_LOCALE_H
29 
30 /* Special invocation convention:
31    - Inside mingw header files,
32    - To handle Solaris header files (through Solaris 10) when combined
33      with gettext's libintl.h.  */
34 
35 #include_next <locale.h>
36 
37 #else
38 /* Normal invocation convention.  */
39 
40 #ifndef _GL_LOCALE_H
41 
42 #define _GL_ALREADY_INCLUDING_LOCALE_H
43 
44 /* The include_next requires a split double-inclusion guard.  */
45 #include_next <locale.h>
46 
47 #undef _GL_ALREADY_INCLUDING_LOCALE_H
48 
49 #ifndef _GL_LOCALE_H
50 #define _GL_LOCALE_H
51 
52 /* NetBSD 5.0 mis-defines NULL.  */
53 #include <stddef.h>
54 
55 /* Mac OS X 10.5 defines the locale_t type in <xlocale.h>.  */
56 #if 0
57 # include <xlocale.h>
58 #endif
59 
60 /* The definitions of _GL_FUNCDECL_RPL etc. are copied here.  */
61 /* C++ compatible function declaration macros.
62    Copyright (C) 2010-2020 Free Software Foundation, Inc.
63 
64    This program is free software: you can redistribute it and/or modify it
65    under the terms of the GNU General Public License as published
66    by the Free Software Foundation; either version 3 of the License, or
67    (at your option) any later version.
68 
69    This program is distributed in the hope that it will be useful,
70    but WITHOUT ANY WARRANTY; without even the implied warranty of
71    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
72    General Public License for more details.
73 
74    You should have received a copy of the GNU General Public License
75    along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
76 
77 #ifndef _GL_CXXDEFS_H
78 #define _GL_CXXDEFS_H
79 
80 /* Begin/end the GNULIB_NAMESPACE namespace.  */
81 #if defined __cplusplus && defined GNULIB_NAMESPACE
82 # define _GL_BEGIN_NAMESPACE namespace GNULIB_NAMESPACE {
83 # define _GL_END_NAMESPACE }
84 #else
85 # define _GL_BEGIN_NAMESPACE
86 # define _GL_END_NAMESPACE
87 #endif
88 
89 /* The three most frequent use cases of these macros are:
90 
91    * For providing a substitute for a function that is missing on some
92      platforms, but is declared and works fine on the platforms on which
93      it exists:
94 
95        #if @GNULIB_FOO@
96        # if !@HAVE_FOO@
97        _GL_FUNCDECL_SYS (foo, ...);
98        # endif
99        _GL_CXXALIAS_SYS (foo, ...);
100        _GL_CXXALIASWARN (foo);
101        #elif defined GNULIB_POSIXCHECK
102        ...
103        #endif
104 
105    * For providing a replacement for a function that exists on all platforms,
106      but is broken/insufficient and needs to be replaced on some platforms:
107 
108        #if @GNULIB_FOO@
109        # if @REPLACE_FOO@
110        #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
111        #   undef foo
112        #   define foo rpl_foo
113        #  endif
114        _GL_FUNCDECL_RPL (foo, ...);
115        _GL_CXXALIAS_RPL (foo, ...);
116        # else
117        _GL_CXXALIAS_SYS (foo, ...);
118        # endif
119        _GL_CXXALIASWARN (foo);
120        #elif defined GNULIB_POSIXCHECK
121        ...
122        #endif
123 
124    * For providing a replacement for a function that exists on some platforms
125      but is broken/insufficient and needs to be replaced on some of them and
126      is additionally either missing or undeclared on some other platforms:
127 
128        #if @GNULIB_FOO@
129        # if @REPLACE_FOO@
130        #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
131        #   undef foo
132        #   define foo rpl_foo
133        #  endif
134        _GL_FUNCDECL_RPL (foo, ...);
135        _GL_CXXALIAS_RPL (foo, ...);
136        # else
137        #  if !@HAVE_FOO@   or   if !@HAVE_DECL_FOO@
138        _GL_FUNCDECL_SYS (foo, ...);
139        #  endif
140        _GL_CXXALIAS_SYS (foo, ...);
141        # endif
142        _GL_CXXALIASWARN (foo);
143        #elif defined GNULIB_POSIXCHECK
144        ...
145        #endif
146 */
147 
148 /* _GL_EXTERN_C declaration;
149    performs the declaration with C linkage.  */
150 #if defined __cplusplus
151 # define _GL_EXTERN_C extern "C"
152 #else
153 # define _GL_EXTERN_C extern
154 #endif
155 
156 /* _GL_FUNCDECL_RPL (func, rettype, parameters_and_attributes);
157    declares a replacement function, named rpl_func, with the given prototype,
158    consisting of return type, parameters, and attributes.
159    Example:
160      _GL_FUNCDECL_RPL (open, int, (const char *filename, int flags, ...)
161                                   _GL_ARG_NONNULL ((1)));
162  */
163 #define _GL_FUNCDECL_RPL(func,rettype,parameters_and_attributes) \
164   _GL_FUNCDECL_RPL_1 (rpl_##func, rettype, parameters_and_attributes)
165 #define _GL_FUNCDECL_RPL_1(rpl_func,rettype,parameters_and_attributes) \
166   _GL_EXTERN_C rettype rpl_func parameters_and_attributes
167 
168 /* _GL_FUNCDECL_SYS (func, rettype, parameters_and_attributes);
169    declares the system function, named func, with the given prototype,
170    consisting of return type, parameters, and attributes.
171    Example:
172      _GL_FUNCDECL_SYS (open, int, (const char *filename, int flags, ...)
173                                   _GL_ARG_NONNULL ((1)));
174  */
175 #define _GL_FUNCDECL_SYS(func,rettype,parameters_and_attributes) \
176   _GL_EXTERN_C rettype func parameters_and_attributes
177 
178 /* _GL_CXXALIAS_RPL (func, rettype, parameters);
179    declares a C++ alias called GNULIB_NAMESPACE::func
180    that redirects to rpl_func, if GNULIB_NAMESPACE is defined.
181    Example:
182      _GL_CXXALIAS_RPL (open, int, (const char *filename, int flags, ...));
183 
184    Wrapping rpl_func in an object with an inline conversion operator
185    avoids a reference to rpl_func unless GNULIB_NAMESPACE::func is
186    actually used in the program.  */
187 #define _GL_CXXALIAS_RPL(func,rettype,parameters) \
188   _GL_CXXALIAS_RPL_1 (func, rpl_##func, rettype, parameters)
189 #if defined __cplusplus && defined GNULIB_NAMESPACE
190 # define _GL_CXXALIAS_RPL_1(func,rpl_func,rettype,parameters) \
191     namespace GNULIB_NAMESPACE                                \
192     {                                                         \
193       static const struct _gl_ ## func ## _wrapper            \
194       {                                                       \
195         typedef rettype (*type) parameters;                   \
196                                                               \
197         inline operator type () const                         \
198         {                                                     \
199           return ::rpl_func;                                  \
200         }                                                     \
201       } func = {};                                            \
202     }                                                         \
203     _GL_EXTERN_C int _gl_cxxalias_dummy
204 #else
205 # define _GL_CXXALIAS_RPL_1(func,rpl_func,rettype,parameters) \
206     _GL_EXTERN_C int _gl_cxxalias_dummy
207 #endif
208 
209 /* _GL_CXXALIAS_RPL_CAST_1 (func, rpl_func, rettype, parameters);
210    is like  _GL_CXXALIAS_RPL_1 (func, rpl_func, rettype, parameters);
211    except that the C function rpl_func may have a slightly different
212    declaration.  A cast is used to silence the "invalid conversion" error
213    that would otherwise occur.  */
214 #if defined __cplusplus && defined GNULIB_NAMESPACE
215 # define _GL_CXXALIAS_RPL_CAST_1(func,rpl_func,rettype,parameters) \
216     namespace GNULIB_NAMESPACE                                     \
217     {                                                              \
218       static const struct _gl_ ## func ## _wrapper                 \
219       {                                                            \
220         typedef rettype (*type) parameters;                        \
221                                                                    \
222         inline operator type () const                              \
223         {                                                          \
224           return reinterpret_cast<type>(::rpl_func);               \
225         }                                                          \
226       } func = {};                                                 \
227     }                                                              \
228     _GL_EXTERN_C int _gl_cxxalias_dummy
229 #else
230 # define _GL_CXXALIAS_RPL_CAST_1(func,rpl_func,rettype,parameters) \
231     _GL_EXTERN_C int _gl_cxxalias_dummy
232 #endif
233 
234 /* _GL_CXXALIAS_SYS (func, rettype, parameters);
235    declares a C++ alias called GNULIB_NAMESPACE::func
236    that redirects to the system provided function func, if GNULIB_NAMESPACE
237    is defined.
238    Example:
239      _GL_CXXALIAS_SYS (open, int, (const char *filename, int flags, ...));
240 
241    Wrapping func in an object with an inline conversion operator
242    avoids a reference to func unless GNULIB_NAMESPACE::func is
243    actually used in the program.  */
244 #if defined __cplusplus && defined GNULIB_NAMESPACE
245 # define _GL_CXXALIAS_SYS(func,rettype,parameters)            \
246     namespace GNULIB_NAMESPACE                                \
247     {                                                         \
248       static const struct _gl_ ## func ## _wrapper            \
249       {                                                       \
250         typedef rettype (*type) parameters;                   \
251                                                               \
252         inline operator type () const                         \
253         {                                                     \
254           return ::func;                                      \
255         }                                                     \
256       } func = {};                                            \
257     }                                                         \
258     _GL_EXTERN_C int _gl_cxxalias_dummy
259 #else
260 # define _GL_CXXALIAS_SYS(func,rettype,parameters) \
261     _GL_EXTERN_C int _gl_cxxalias_dummy
262 #endif
263 
264 /* _GL_CXXALIAS_SYS_CAST (func, rettype, parameters);
265    is like  _GL_CXXALIAS_SYS (func, rettype, parameters);
266    except that the C function func may have a slightly different declaration.
267    A cast is used to silence the "invalid conversion" error that would
268    otherwise occur.  */
269 #if defined __cplusplus && defined GNULIB_NAMESPACE
270 # define _GL_CXXALIAS_SYS_CAST(func,rettype,parameters) \
271     namespace GNULIB_NAMESPACE                          \
272     {                                                   \
273       static const struct _gl_ ## func ## _wrapper      \
274       {                                                 \
275         typedef rettype (*type) parameters;             \
276                                                         \
277         inline operator type () const                   \
278         {                                               \
279           return reinterpret_cast<type>(::func);        \
280         }                                               \
281       } func = {};                                      \
282     }                                                   \
283     _GL_EXTERN_C int _gl_cxxalias_dummy
284 #else
285 # define _GL_CXXALIAS_SYS_CAST(func,rettype,parameters) \
286     _GL_EXTERN_C int _gl_cxxalias_dummy
287 #endif
288 
289 /* _GL_CXXALIAS_SYS_CAST2 (func, rettype, parameters, rettype2, parameters2);
290    is like  _GL_CXXALIAS_SYS (func, rettype, parameters);
291    except that the C function is picked among a set of overloaded functions,
292    namely the one with rettype2 and parameters2.  Two consecutive casts
293    are used to silence the "cannot find a match" and "invalid conversion"
294    errors that would otherwise occur.  */
295 #if defined __cplusplus && defined GNULIB_NAMESPACE
296   /* The outer cast must be a reinterpret_cast.
297      The inner cast: When the function is defined as a set of overloaded
298      functions, it works as a static_cast<>, choosing the designated variant.
299      When the function is defined as a single variant, it works as a
300      reinterpret_cast<>. The parenthesized cast syntax works both ways.  */
301 # define _GL_CXXALIAS_SYS_CAST2(func,rettype,parameters,rettype2,parameters2) \
302     namespace GNULIB_NAMESPACE                                                \
303     {                                                                         \
304       static const struct _gl_ ## func ## _wrapper                            \
305       {                                                                       \
306         typedef rettype (*type) parameters;                                   \
307                                                                               \
308         inline operator type () const                                         \
309         {                                                                     \
310           return reinterpret_cast<type>((rettype2 (*) parameters2)(::func));  \
311         }                                                                     \
312       } func = {};                                                            \
313     }                                                                         \
314     _GL_EXTERN_C int _gl_cxxalias_dummy
315 #else
316 # define _GL_CXXALIAS_SYS_CAST2(func,rettype,parameters,rettype2,parameters2) \
317     _GL_EXTERN_C int _gl_cxxalias_dummy
318 #endif
319 
320 /* _GL_CXXALIASWARN (func);
321    causes a warning to be emitted when ::func is used but not when
322    GNULIB_NAMESPACE::func is used.  func must be defined without overloaded
323    variants.  */
324 #if defined __cplusplus && defined GNULIB_NAMESPACE
325 # define _GL_CXXALIASWARN(func) \
326    _GL_CXXALIASWARN_1 (func, GNULIB_NAMESPACE)
327 # define _GL_CXXALIASWARN_1(func,namespace) \
328    _GL_CXXALIASWARN_2 (func, namespace)
329 /* To work around GCC bug <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=43881>,
330    we enable the warning only when not optimizing.  */
331 # if !__OPTIMIZE__
332 #  define _GL_CXXALIASWARN_2(func,namespace) \
333     _GL_WARN_ON_USE (func, \
334                      "The symbol ::" #func " refers to the system function. " \
335                      "Use " #namespace "::" #func " instead.")
336 # elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING
337 #  define _GL_CXXALIASWARN_2(func,namespace) \
338      extern __typeof__ (func) func
339 # else
340 #  define _GL_CXXALIASWARN_2(func,namespace) \
341      _GL_EXTERN_C int _gl_cxxalias_dummy
342 # endif
343 #else
344 # define _GL_CXXALIASWARN(func) \
345     _GL_EXTERN_C int _gl_cxxalias_dummy
346 #endif
347 
348 /* _GL_CXXALIASWARN1 (func, rettype, parameters_and_attributes);
349    causes a warning to be emitted when the given overloaded variant of ::func
350    is used but not when GNULIB_NAMESPACE::func is used.  */
351 #if defined __cplusplus && defined GNULIB_NAMESPACE
352 # define _GL_CXXALIASWARN1(func,rettype,parameters_and_attributes) \
353    _GL_CXXALIASWARN1_1 (func, rettype, parameters_and_attributes, \
354                         GNULIB_NAMESPACE)
355 # define _GL_CXXALIASWARN1_1(func,rettype,parameters_and_attributes,namespace) \
356    _GL_CXXALIASWARN1_2 (func, rettype, parameters_and_attributes, namespace)
357 /* To work around GCC bug <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=43881>,
358    we enable the warning only when not optimizing.  */
359 # if !__OPTIMIZE__
360 #  define _GL_CXXALIASWARN1_2(func,rettype,parameters_and_attributes,namespace) \
361     _GL_WARN_ON_USE_CXX (func, rettype, parameters_and_attributes, \
362                          "The symbol ::" #func " refers to the system function. " \
363                          "Use " #namespace "::" #func " instead.")
364 # else
365 #  define _GL_CXXALIASWARN1_2(func,rettype,parameters_and_attributes,namespace) \
366      _GL_EXTERN_C int _gl_cxxalias_dummy
367 # endif
368 #else
369 # define _GL_CXXALIASWARN1(func,rettype,parameters_and_attributes) \
370     _GL_EXTERN_C int _gl_cxxalias_dummy
371 #endif
372 
373 #endif /* _GL_CXXDEFS_H */
374 
375 /* The definition of _GL_ARG_NONNULL is copied here.  */
376 /* A C macro for declaring that specific arguments must not be NULL.
377    Copyright (C) 2009-2020 Free Software Foundation, Inc.
378 
379    This program is free software: you can redistribute it and/or modify it
380    under the terms of the GNU General Public License as published
381    by the Free Software Foundation; either version 3 of the License, or
382    (at your option) any later version.
383 
384    This program is distributed in the hope that it will be useful,
385    but WITHOUT ANY WARRANTY; without even the implied warranty of
386    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
387    General Public License for more details.
388 
389    You should have received a copy of the GNU General Public License
390    along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
391 
392 /* _GL_ARG_NONNULL((n,...,m)) tells the compiler and static analyzer tools
393    that the values passed as arguments n, ..., m must be non-NULL pointers.
394    n = 1 stands for the first argument, n = 2 for the second argument etc.  */
395 #ifndef _GL_ARG_NONNULL
396 # if (__GNUC__ == 3 && __GNUC_MINOR__ >= 3) || __GNUC__ > 3
397 #  define _GL_ARG_NONNULL(params) __attribute__ ((__nonnull__ params))
398 # else
399 #  define _GL_ARG_NONNULL(params)
400 # endif
401 #endif
402 
403 /* The definition of _GL_WARN_ON_USE is copied here.  */
404 /* A C macro for emitting warnings if a function is used.
405    Copyright (C) 2010-2020 Free Software Foundation, Inc.
406 
407    This program is free software: you can redistribute it and/or modify it
408    under the terms of the GNU General Public License as published
409    by the Free Software Foundation; either version 3 of the License, or
410    (at your option) any later version.
411 
412    This program is distributed in the hope that it will be useful,
413    but WITHOUT ANY WARRANTY; without even the implied warranty of
414    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
415    General Public License for more details.
416 
417    You should have received a copy of the GNU General Public License
418    along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
419 
420 /* _GL_WARN_ON_USE (function, "literal string") issues a declaration
421    for FUNCTION which will then trigger a compiler warning containing
422    the text of "literal string" anywhere that function is called, if
423    supported by the compiler.  If the compiler does not support this
424    feature, the macro expands to an unused extern declaration.
425 
426    _GL_WARN_ON_USE_ATTRIBUTE ("literal string") expands to the
427    attribute used in _GL_WARN_ON_USE.  If the compiler does not support
428    this feature, it expands to empty.
429 
430    These macros are useful for marking a function as a potential
431    portability trap, with the intent that "literal string" include
432    instructions on the replacement function that should be used
433    instead.
434    _GL_WARN_ON_USE is for functions with 'extern' linkage.
435    _GL_WARN_ON_USE_ATTRIBUTE is for functions with 'static' or 'inline'
436    linkage.
437 
438    However, one of the reasons that a function is a portability trap is
439    if it has the wrong signature.  Declaring FUNCTION with a different
440    signature in C is a compilation error, so this macro must use the
441    same type as any existing declaration so that programs that avoid
442    the problematic FUNCTION do not fail to compile merely because they
443    included a header that poisoned the function.  But this implies that
444    _GL_WARN_ON_USE is only safe to use if FUNCTION is known to already
445    have a declaration.  Use of this macro implies that there must not
446    be any other macro hiding the declaration of FUNCTION; but
447    undefining FUNCTION first is part of the poisoning process anyway
448    (although for symbols that are provided only via a macro, the result
449    is a compilation error rather than a warning containing
450    "literal string").  Also note that in C++, it is only safe to use if
451    FUNCTION has no overloads.
452 
453    For an example, it is possible to poison 'getline' by:
454    - adding a call to gl_WARN_ON_USE_PREPARE([[#include <stdio.h>]],
455      [getline]) in configure.ac, which potentially defines
456      HAVE_RAW_DECL_GETLINE
457    - adding this code to a header that wraps the system <stdio.h>:
458      #undef getline
459      #if HAVE_RAW_DECL_GETLINE
460      _GL_WARN_ON_USE (getline, "getline is required by POSIX 2008, but"
461        "not universally present; use the gnulib module getline");
462      #endif
463 
464    It is not possible to directly poison global variables.  But it is
465    possible to write a wrapper accessor function, and poison that
466    (less common usage, like &environ, will cause a compilation error
467    rather than issue the nice warning, but the end result of informing
468    the developer about their portability problem is still achieved):
469      #if HAVE_RAW_DECL_ENVIRON
470      static char ***
471      rpl_environ (void) { return &environ; }
472      _GL_WARN_ON_USE (rpl_environ, "environ is not always properly declared");
473      # undef environ
474      # define environ (*rpl_environ ())
475      #endif
476    or better (avoiding contradictory use of 'static' and 'extern'):
477      #if HAVE_RAW_DECL_ENVIRON
478      static char ***
479      _GL_WARN_ON_USE_ATTRIBUTE ("environ is not always properly declared")
480      rpl_environ (void) { return &environ; }
481      # undef environ
482      # define environ (*rpl_environ ())
483      #endif
484    */
485 #ifndef _GL_WARN_ON_USE
486 
487 # if 4 < __GNUC__ || (__GNUC__ == 4 && 3 <= __GNUC_MINOR__)
488 /* A compiler attribute is available in gcc versions 4.3.0 and later.  */
489 #  define _GL_WARN_ON_USE(function, message) \
490 extern __typeof__ (function) function __attribute__ ((__warning__ (message)))
491 #  define _GL_WARN_ON_USE_ATTRIBUTE(message) \
492   __attribute__ ((__warning__ (message)))
493 # elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING
494 /* Verify the existence of the function.  */
495 #  define _GL_WARN_ON_USE(function, message) \
496 extern __typeof__ (function) function
497 #  define _GL_WARN_ON_USE_ATTRIBUTE(message)
498 # else /* Unsupported.  */
499 #  define _GL_WARN_ON_USE(function, message) \
500 _GL_WARN_EXTERN_C int _gl_warn_on_use
501 #  define _GL_WARN_ON_USE_ATTRIBUTE(message)
502 # endif
503 #endif
504 
505 /* _GL_WARN_ON_USE_CXX (function, rettype, parameters_and_attributes, "string")
506    is like _GL_WARN_ON_USE (function, "string"), except that in C++ mode the
507    function is declared with the given prototype, consisting of return type,
508    parameters, and attributes.
509    This variant is useful for overloaded functions in C++. _GL_WARN_ON_USE does
510    not work in this case.  */
511 #ifndef _GL_WARN_ON_USE_CXX
512 # if !defined __cplusplus
513 #  define _GL_WARN_ON_USE_CXX(function,rettype,parameters_and_attributes,msg) \
514      _GL_WARN_ON_USE (function, msg)
515 # else
516 #  if 4 < __GNUC__ || (__GNUC__ == 4 && 3 <= __GNUC_MINOR__)
517 #   define _GL_WARN_ON_USE_CXX(function,rettype,parameters_and_attributes,msg) \
518 extern rettype function parameters_and_attributes \
519      __attribute__ ((__warning__ (msg)))
520 #  elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING
521 /* Verify the existence of the function.  */
522 #   define _GL_WARN_ON_USE_CXX(function,rettype,parameters_and_attributes,msg) \
523 extern rettype function parameters_and_attributes
524 #  else /* Unsupported.  */
525 #   define _GL_WARN_ON_USE_CXX(function,rettype,parameters_and_attributes,msg) \
526 _GL_WARN_EXTERN_C int _gl_warn_on_use
527 #  endif
528 # endif
529 #endif
530 
531 /* _GL_WARN_EXTERN_C declaration;
532    performs the declaration with C linkage.  */
533 #ifndef _GL_WARN_EXTERN_C
534 # if defined __cplusplus
535 #  define _GL_WARN_EXTERN_C extern "C"
536 # else
537 #  define _GL_WARN_EXTERN_C extern
538 # endif
539 #endif
540 
541 /* The LC_MESSAGES locale category is specified in POSIX, but not in ISO C.
542    On systems that don't define it, use the same value as GNU libintl.  */
543 #if !defined LC_MESSAGES
544 # define LC_MESSAGES 1729
545 #endif
546 
547 /* On native Windows with MSVC, 'struct lconv' lacks the members int_p_* and
548    int_n_*.  Instead of overriding 'struct lconv', merely define these member
549    names as macros.  This avoids trouble in C++ mode.  */
550 #if defined _MSC_VER
551 # define int_p_cs_precedes   p_cs_precedes
552 # define int_p_sign_posn     p_sign_posn
553 # define int_p_sep_by_space  p_sep_by_space
554 # define int_n_cs_precedes   n_cs_precedes
555 # define int_n_sign_posn     n_sign_posn
556 # define int_n_sep_by_space  n_sep_by_space
557 #endif
558 
559 /* Bionic libc's 'struct lconv' is just a dummy.  */
560 #if 0
561 # define lconv rpl_lconv
562 struct lconv
563 {
564   /* All 'char *' are actually 'const char *'.  */
565 
566   /* Members that depend on the LC_NUMERIC category of the locale.  See
567      <https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap07.html#tag_07_03_04> */
568 
569   /* Symbol used as decimal point.  */
570   char *decimal_point;
571   /* Symbol used to separate groups of digits to the left of the decimal
572      point.  */
573   char *thousands_sep;
574   /* Definition of the size of groups of digits to the left of the decimal
575      point.  */
576   char *grouping;
577 
578   /* Members that depend on the LC_MONETARY category of the locale.  See
579      <https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap07.html#tag_07_03_03> */
580 
581   /* Symbol used as decimal point.  */
582   char *mon_decimal_point;
583   /* Symbol used to separate groups of digits to the left of the decimal
584      point.  */
585   char *mon_thousands_sep;
586   /* Definition of the size of groups of digits to the left of the decimal
587      point.  */
588   char *mon_grouping;
589   /* Sign used to indicate a value >= 0.  */
590   char *positive_sign;
591   /* Sign used to indicate a value < 0.  */
592   char *negative_sign;
593 
594   /* For formatting local currency.  */
595   /* Currency symbol (3 characters) followed by separator (1 character).  */
596   char *currency_symbol;
597   /* Number of digits after the decimal point.  */
598   char frac_digits;
599   /* For values >= 0: 1 if the currency symbol precedes the number, 0 if it
600      comes after the number.  */
601   char p_cs_precedes;
602   /* For values >= 0: Position of the sign.  */
603   char p_sign_posn;
604   /* For values >= 0: Placement of spaces between currency symbol, sign, and
605      number.  */
606   char p_sep_by_space;
607   /* For values < 0: 1 if the currency symbol precedes the number, 0 if it
608      comes after the number.  */
609   char n_cs_precedes;
610   /* For values < 0: Position of the sign.  */
611   char n_sign_posn;
612   /* For values < 0: Placement of spaces between currency symbol, sign, and
613      number.  */
614   char n_sep_by_space;
615 
616   /* For formatting international currency.  */
617   /* Currency symbol (3 characters) followed by separator (1 character).  */
618   char *int_curr_symbol;
619   /* Number of digits after the decimal point.  */
620   char int_frac_digits;
621   /* For values >= 0: 1 if the currency symbol precedes the number, 0 if it
622      comes after the number.  */
623   char int_p_cs_precedes;
624   /* For values >= 0: Position of the sign.  */
625   char int_p_sign_posn;
626   /* For values >= 0: Placement of spaces between currency symbol, sign, and
627      number.  */
628   char int_p_sep_by_space;
629   /* For values < 0: 1 if the currency symbol precedes the number, 0 if it
630      comes after the number.  */
631   char int_n_cs_precedes;
632   /* For values < 0: Position of the sign.  */
633   char int_n_sign_posn;
634   /* For values < 0: Placement of spaces between currency symbol, sign, and
635      number.  */
636   char int_n_sep_by_space;
637 };
638 #endif
639 
640 #if 0
641 # if 0
642 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
643 #   undef localeconv
644 #   define localeconv rpl_localeconv
645 #  endif
646 _GL_FUNCDECL_RPL (localeconv, struct lconv *, (void));
647 _GL_CXXALIAS_RPL (localeconv, struct lconv *, (void));
648 # else
649 _GL_CXXALIAS_SYS (localeconv, struct lconv *, (void));
650 # endif
651 # if __GLIBC__ >= 2
652 _GL_CXXALIASWARN (localeconv);
653 # endif
654 #elif 0
655 # undef localeconv
656 # define localeconv localeconv_used_without_requesting_gnulib_module_localeconv
657 #elif defined GNULIB_POSIXCHECK
658 # undef localeconv
659 # if HAVE_RAW_DECL_LOCALECONV
660 _GL_WARN_ON_USE (localeconv,
661                  "localeconv returns too few information on some platforms - "
662                  "use gnulib module localeconv for portability");
663 # endif
664 #endif
665 
666 #if 0
667 # if 0
668 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
669 #   undef setlocale
670 #   define setlocale rpl_setlocale
671 #   define GNULIB_defined_setlocale 1
672 #  endif
673 _GL_FUNCDECL_RPL (setlocale, char *, (int category, const char *locale));
674 _GL_CXXALIAS_RPL (setlocale, char *, (int category, const char *locale));
675 # else
676 _GL_CXXALIAS_SYS (setlocale, char *, (int category, const char *locale));
677 # endif
678 # if __GLIBC__ >= 2
679 _GL_CXXALIASWARN (setlocale);
680 # endif
681 #elif defined GNULIB_POSIXCHECK
682 # undef setlocale
683 # if HAVE_RAW_DECL_SETLOCALE
684 _GL_WARN_ON_USE (setlocale, "setlocale works differently on native Windows - "
685                  "use gnulib module setlocale for portability");
686 # endif
687 #endif
688 
689 #if 1
690 /* Included here for convenience.  */
691 # include "setlocale_null.h"
692 #endif
693 
694 #if /*@GNULIB_NEWLOCALE@ ||*/ (0 && 1)
695 # if 0
696 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
697 #   undef newlocale
698 #   define newlocale rpl_newlocale
699 #   define GNULIB_defined_newlocale 1
700 #  endif
701 _GL_FUNCDECL_RPL (newlocale, locale_t,
702                   (int category_mask, const char *name, locale_t base)
703                   _GL_ARG_NONNULL ((2)));
704 _GL_CXXALIAS_RPL (newlocale, locale_t,
705                   (int category_mask, const char *name, locale_t base));
706 # else
707 #  if 1
708 _GL_CXXALIAS_SYS (newlocale, locale_t,
709                   (int category_mask, const char *name, locale_t base));
710 #  endif
711 # endif
712 # if 1
713 _GL_CXXALIASWARN (newlocale);
714 # endif
715 # if 1 || 0
716 #  ifndef HAVE_WORKING_NEWLOCALE
717 #   define HAVE_WORKING_NEWLOCALE 1
718 #  endif
719 # endif
720 #elif defined GNULIB_POSIXCHECK
721 # undef newlocale
722 # if HAVE_RAW_DECL_NEWLOCALE
723 _GL_WARN_ON_USE (newlocale, "newlocale is not portable");
724 # endif
725 #endif
726 
727 #if 0 || (0 && 1)
728 # if 0
729 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
730 #   undef duplocale
731 #   define duplocale rpl_duplocale
732 #   define GNULIB_defined_duplocale 1
733 #  endif
734 _GL_FUNCDECL_RPL (duplocale, locale_t, (locale_t locale) _GL_ARG_NONNULL ((1)));
735 _GL_CXXALIAS_RPL (duplocale, locale_t, (locale_t locale));
736 # else
737 #  if 1
738 _GL_CXXALIAS_SYS (duplocale, locale_t, (locale_t locale));
739 #  endif
740 # endif
741 # if 1
742 _GL_CXXALIASWARN (duplocale);
743 # endif
744 # if 1 || 0
745 #  ifndef HAVE_WORKING_DUPLOCALE
746 #   define HAVE_WORKING_DUPLOCALE 1
747 #  endif
748 # endif
749 #elif defined GNULIB_POSIXCHECK
750 # undef duplocale
751 # if HAVE_RAW_DECL_DUPLOCALE
752 _GL_WARN_ON_USE (duplocale, "duplocale is buggy on some glibc systems - "
753                  "use gnulib module duplocale for portability");
754 # endif
755 #endif
756 
757 #if /*@GNULIB_FREELOCALE@ ||*/ (0 && 1)
758 # if 0
759 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
760 #   undef freelocale
761 #   define freelocale rpl_freelocale
762 #   define GNULIB_defined_freelocale 1
763 #  endif
764 _GL_FUNCDECL_RPL (freelocale, void, (locale_t locale) _GL_ARG_NONNULL ((1)));
765 _GL_CXXALIAS_RPL (freelocale, void, (locale_t locale));
766 # else
767 #  if 1
768 /* Need to cast, because on FreeBSD and Mac OS X 10.13, the return type is
769                                    int.  */
770 _GL_CXXALIAS_SYS_CAST (freelocale, void, (locale_t locale));
771 #  endif
772 # endif
773 # if 1
774 _GL_CXXALIASWARN (freelocale);
775 # endif
776 #elif defined GNULIB_POSIXCHECK
777 # undef freelocale
778 # if HAVE_RAW_DECL_FREELOCALE
779 _GL_WARN_ON_USE (freelocale, "freelocale is not portable");
780 # endif
781 #endif
782 
783 #endif /* _GL_LOCALE_H */
784 #endif /* _GL_LOCALE_H */
785 #endif /* !(__need_locale_t || _GL_ALREADY_INCLUDING_LOCALE_H) */
786