1/* This file is automatically generated. DO NOT EDIT! */ 2/* Generated from: NetBSD: mknative-gdb,v 1.16 2023/07/31 17:09:59 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-2022 Free Software Foundation, Inc. 8 9 This file is free software: you can redistribute it and/or modify 10 it under the terms of the GNU Lesser General Public License as 11 published by the Free Software Foundation; either version 2.1 of the 12 License, or (at your option) any later version. 13 14 This file 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 Lesser General Public License for more details. 18 19 You should have received a copy of the GNU Lesser 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-2022 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 Lesser General Public License as published 66 by the Free Software Foundation; either version 2 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 Lesser General Public License for more details. 73 74 You should have received a copy of the GNU Lesser 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_MDA (func, rettype, parameters); 210 is to be used when func is a Microsoft deprecated alias, on native Windows. 211 It declares a C++ alias called GNULIB_NAMESPACE::func 212 that redirects to _func, if GNULIB_NAMESPACE is defined. 213 Example: 214 _GL_CXXALIAS_MDA (open, int, (const char *filename, int flags, ...)); 215 */ 216#define _GL_CXXALIAS_MDA(func,rettype,parameters) \ 217 _GL_CXXALIAS_RPL_1 (func, _##func, rettype, parameters) 218 219/* _GL_CXXALIAS_RPL_CAST_1 (func, rpl_func, rettype, parameters); 220 is like _GL_CXXALIAS_RPL_1 (func, rpl_func, rettype, parameters); 221 except that the C function rpl_func may have a slightly different 222 declaration. A cast is used to silence the "invalid conversion" error 223 that would otherwise occur. */ 224#if defined __cplusplus && defined GNULIB_NAMESPACE 225# define _GL_CXXALIAS_RPL_CAST_1(func,rpl_func,rettype,parameters) \ 226 namespace GNULIB_NAMESPACE \ 227 { \ 228 static const struct _gl_ ## func ## _wrapper \ 229 { \ 230 typedef rettype (*type) parameters; \ 231 \ 232 inline operator type () const \ 233 { \ 234 return reinterpret_cast<type>(::rpl_func); \ 235 } \ 236 } func = {}; \ 237 } \ 238 _GL_EXTERN_C int _gl_cxxalias_dummy 239#else 240# define _GL_CXXALIAS_RPL_CAST_1(func,rpl_func,rettype,parameters) \ 241 _GL_EXTERN_C int _gl_cxxalias_dummy 242#endif 243 244/* _GL_CXXALIAS_MDA_CAST (func, rettype, parameters); 245 is like _GL_CXXALIAS_MDA (func, rettype, parameters); 246 except that the C function func may have a slightly different declaration. 247 A cast is used to silence the "invalid conversion" error that would 248 otherwise occur. */ 249#define _GL_CXXALIAS_MDA_CAST(func,rettype,parameters) \ 250 _GL_CXXALIAS_RPL_CAST_1 (func, _##func, rettype, parameters) 251 252/* _GL_CXXALIAS_SYS (func, rettype, parameters); 253 declares a C++ alias called GNULIB_NAMESPACE::func 254 that redirects to the system provided function func, if GNULIB_NAMESPACE 255 is defined. 256 Example: 257 _GL_CXXALIAS_SYS (open, int, (const char *filename, int flags, ...)); 258 259 Wrapping func in an object with an inline conversion operator 260 avoids a reference to func unless GNULIB_NAMESPACE::func is 261 actually used in the program. */ 262#if defined __cplusplus && defined GNULIB_NAMESPACE 263# define _GL_CXXALIAS_SYS(func,rettype,parameters) \ 264 namespace GNULIB_NAMESPACE \ 265 { \ 266 static const struct _gl_ ## func ## _wrapper \ 267 { \ 268 typedef rettype (*type) parameters; \ 269 \ 270 inline operator type () const \ 271 { \ 272 return ::func; \ 273 } \ 274 } func = {}; \ 275 } \ 276 _GL_EXTERN_C int _gl_cxxalias_dummy 277#else 278# define _GL_CXXALIAS_SYS(func,rettype,parameters) \ 279 _GL_EXTERN_C int _gl_cxxalias_dummy 280#endif 281 282/* _GL_CXXALIAS_SYS_CAST (func, rettype, parameters); 283 is like _GL_CXXALIAS_SYS (func, rettype, parameters); 284 except that the C function func may have a slightly different declaration. 285 A cast is used to silence the "invalid conversion" error that would 286 otherwise occur. */ 287#if defined __cplusplus && defined GNULIB_NAMESPACE 288# define _GL_CXXALIAS_SYS_CAST(func,rettype,parameters) \ 289 namespace GNULIB_NAMESPACE \ 290 { \ 291 static const struct _gl_ ## func ## _wrapper \ 292 { \ 293 typedef rettype (*type) parameters; \ 294 \ 295 inline operator type () const \ 296 { \ 297 return reinterpret_cast<type>(::func); \ 298 } \ 299 } func = {}; \ 300 } \ 301 _GL_EXTERN_C int _gl_cxxalias_dummy 302#else 303# define _GL_CXXALIAS_SYS_CAST(func,rettype,parameters) \ 304 _GL_EXTERN_C int _gl_cxxalias_dummy 305#endif 306 307/* _GL_CXXALIAS_SYS_CAST2 (func, rettype, parameters, rettype2, parameters2); 308 is like _GL_CXXALIAS_SYS (func, rettype, parameters); 309 except that the C function is picked among a set of overloaded functions, 310 namely the one with rettype2 and parameters2. Two consecutive casts 311 are used to silence the "cannot find a match" and "invalid conversion" 312 errors that would otherwise occur. */ 313#if defined __cplusplus && defined GNULIB_NAMESPACE 314 /* The outer cast must be a reinterpret_cast. 315 The inner cast: When the function is defined as a set of overloaded 316 functions, it works as a static_cast<>, choosing the designated variant. 317 When the function is defined as a single variant, it works as a 318 reinterpret_cast<>. The parenthesized cast syntax works both ways. */ 319# define _GL_CXXALIAS_SYS_CAST2(func,rettype,parameters,rettype2,parameters2) \ 320 namespace GNULIB_NAMESPACE \ 321 { \ 322 static const struct _gl_ ## func ## _wrapper \ 323 { \ 324 typedef rettype (*type) parameters; \ 325 \ 326 inline operator type () const \ 327 { \ 328 return reinterpret_cast<type>((rettype2 (*) parameters2)(::func)); \ 329 } \ 330 } func = {}; \ 331 } \ 332 _GL_EXTERN_C int _gl_cxxalias_dummy 333#else 334# define _GL_CXXALIAS_SYS_CAST2(func,rettype,parameters,rettype2,parameters2) \ 335 _GL_EXTERN_C int _gl_cxxalias_dummy 336#endif 337 338/* _GL_CXXALIASWARN (func); 339 causes a warning to be emitted when ::func is used but not when 340 GNULIB_NAMESPACE::func is used. func must be defined without overloaded 341 variants. */ 342#if defined __cplusplus && defined GNULIB_NAMESPACE 343# define _GL_CXXALIASWARN(func) \ 344 _GL_CXXALIASWARN_1 (func, GNULIB_NAMESPACE) 345# define _GL_CXXALIASWARN_1(func,namespace) \ 346 _GL_CXXALIASWARN_2 (func, namespace) 347/* To work around GCC bug <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=43881>, 348 we enable the warning only when not optimizing. */ 349# if !(defined __GNUC__ && !defined __clang__ && __OPTIMIZE__) 350# define _GL_CXXALIASWARN_2(func,namespace) \ 351 _GL_WARN_ON_USE (func, \ 352 "The symbol ::" #func " refers to the system function. " \ 353 "Use " #namespace "::" #func " instead.") 354# elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING 355# define _GL_CXXALIASWARN_2(func,namespace) \ 356 extern __typeof__ (func) func 357# else 358# define _GL_CXXALIASWARN_2(func,namespace) \ 359 _GL_EXTERN_C int _gl_cxxalias_dummy 360# endif 361#else 362# define _GL_CXXALIASWARN(func) \ 363 _GL_EXTERN_C int _gl_cxxalias_dummy 364#endif 365 366/* _GL_CXXALIASWARN1 (func, rettype, parameters_and_attributes); 367 causes a warning to be emitted when the given overloaded variant of ::func 368 is used but not when GNULIB_NAMESPACE::func is used. */ 369#if defined __cplusplus && defined GNULIB_NAMESPACE 370# define _GL_CXXALIASWARN1(func,rettype,parameters_and_attributes) \ 371 _GL_CXXALIASWARN1_1 (func, rettype, parameters_and_attributes, \ 372 GNULIB_NAMESPACE) 373# define _GL_CXXALIASWARN1_1(func,rettype,parameters_and_attributes,namespace) \ 374 _GL_CXXALIASWARN1_2 (func, rettype, parameters_and_attributes, namespace) 375/* To work around GCC bug <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=43881>, 376 we enable the warning only when not optimizing. */ 377# if !(defined __GNUC__ && !defined __clang__ && __OPTIMIZE__) 378# define _GL_CXXALIASWARN1_2(func,rettype,parameters_and_attributes,namespace) \ 379 _GL_WARN_ON_USE_CXX (func, rettype, rettype, parameters_and_attributes, \ 380 "The symbol ::" #func " refers to the system function. " \ 381 "Use " #namespace "::" #func " instead.") 382# else 383# define _GL_CXXALIASWARN1_2(func,rettype,parameters_and_attributes,namespace) \ 384 _GL_EXTERN_C int _gl_cxxalias_dummy 385# endif 386#else 387# define _GL_CXXALIASWARN1(func,rettype,parameters_and_attributes) \ 388 _GL_EXTERN_C int _gl_cxxalias_dummy 389#endif 390 391#endif /* _GL_CXXDEFS_H */ 392 393/* The definition of _GL_ARG_NONNULL is copied here. */ 394/* A C macro for declaring that specific arguments must not be NULL. 395 Copyright (C) 2009-2022 Free Software Foundation, Inc. 396 397 This program is free software: you can redistribute it and/or modify it 398 under the terms of the GNU Lesser General Public License as published 399 by the Free Software Foundation; either version 2 of the License, or 400 (at your option) any later version. 401 402 This program is distributed in the hope that it will be useful, 403 but WITHOUT ANY WARRANTY; without even the implied warranty of 404 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 405 Lesser General Public License for more details. 406 407 You should have received a copy of the GNU Lesser General Public License 408 along with this program. If not, see <https://www.gnu.org/licenses/>. */ 409 410/* _GL_ARG_NONNULL((n,...,m)) tells the compiler and static analyzer tools 411 that the values passed as arguments n, ..., m must be non-NULL pointers. 412 n = 1 stands for the first argument, n = 2 for the second argument etc. */ 413#ifndef _GL_ARG_NONNULL 414# if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3) || defined __clang__ 415# define _GL_ARG_NONNULL(params) __attribute__ ((__nonnull__ params)) 416# else 417# define _GL_ARG_NONNULL(params) 418# endif 419#endif 420 421/* The definition of _GL_WARN_ON_USE is copied here. */ 422/* A C macro for emitting warnings if a function is used. 423 Copyright (C) 2010-2022 Free Software Foundation, Inc. 424 425 This program is free software: you can redistribute it and/or modify it 426 under the terms of the GNU Lesser General Public License as published 427 by the Free Software Foundation; either version 2 of the License, or 428 (at your option) any later version. 429 430 This program is distributed in the hope that it will be useful, 431 but WITHOUT ANY WARRANTY; without even the implied warranty of 432 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 433 Lesser General Public License for more details. 434 435 You should have received a copy of the GNU Lesser General Public License 436 along with this program. If not, see <https://www.gnu.org/licenses/>. */ 437 438/* _GL_WARN_ON_USE (function, "literal string") issues a declaration 439 for FUNCTION which will then trigger a compiler warning containing 440 the text of "literal string" anywhere that function is called, if 441 supported by the compiler. If the compiler does not support this 442 feature, the macro expands to an unused extern declaration. 443 444 _GL_WARN_ON_USE_ATTRIBUTE ("literal string") expands to the 445 attribute used in _GL_WARN_ON_USE. If the compiler does not support 446 this feature, it expands to empty. 447 448 These macros are useful for marking a function as a potential 449 portability trap, with the intent that "literal string" include 450 instructions on the replacement function that should be used 451 instead. 452 _GL_WARN_ON_USE is for functions with 'extern' linkage. 453 _GL_WARN_ON_USE_ATTRIBUTE is for functions with 'static' or 'inline' 454 linkage. 455 456 However, one of the reasons that a function is a portability trap is 457 if it has the wrong signature. Declaring FUNCTION with a different 458 signature in C is a compilation error, so this macro must use the 459 same type as any existing declaration so that programs that avoid 460 the problematic FUNCTION do not fail to compile merely because they 461 included a header that poisoned the function. But this implies that 462 _GL_WARN_ON_USE is only safe to use if FUNCTION is known to already 463 have a declaration. Use of this macro implies that there must not 464 be any other macro hiding the declaration of FUNCTION; but 465 undefining FUNCTION first is part of the poisoning process anyway 466 (although for symbols that are provided only via a macro, the result 467 is a compilation error rather than a warning containing 468 "literal string"). Also note that in C++, it is only safe to use if 469 FUNCTION has no overloads. 470 471 For an example, it is possible to poison 'getline' by: 472 - adding a call to gl_WARN_ON_USE_PREPARE([[#include <stdio.h>]], 473 [getline]) in configure.ac, which potentially defines 474 HAVE_RAW_DECL_GETLINE 475 - adding this code to a header that wraps the system <stdio.h>: 476 #undef getline 477 #if HAVE_RAW_DECL_GETLINE 478 _GL_WARN_ON_USE (getline, "getline is required by POSIX 2008, but" 479 "not universally present; use the gnulib module getline"); 480 #endif 481 482 It is not possible to directly poison global variables. But it is 483 possible to write a wrapper accessor function, and poison that 484 (less common usage, like &environ, will cause a compilation error 485 rather than issue the nice warning, but the end result of informing 486 the developer about their portability problem is still achieved): 487 #if HAVE_RAW_DECL_ENVIRON 488 static char *** 489 rpl_environ (void) { return &environ; } 490 _GL_WARN_ON_USE (rpl_environ, "environ is not always properly declared"); 491 # undef environ 492 # define environ (*rpl_environ ()) 493 #endif 494 or better (avoiding contradictory use of 'static' and 'extern'): 495 #if HAVE_RAW_DECL_ENVIRON 496 static char *** 497 _GL_WARN_ON_USE_ATTRIBUTE ("environ is not always properly declared") 498 rpl_environ (void) { return &environ; } 499 # undef environ 500 # define environ (*rpl_environ ()) 501 #endif 502 */ 503#ifndef _GL_WARN_ON_USE 504 505# if 4 < __GNUC__ || (__GNUC__ == 4 && 3 <= __GNUC_MINOR__) 506/* A compiler attribute is available in gcc versions 4.3.0 and later. */ 507# define _GL_WARN_ON_USE(function, message) \ 508_GL_WARN_EXTERN_C __typeof__ (function) function __attribute__ ((__warning__ (message))) 509# define _GL_WARN_ON_USE_ATTRIBUTE(message) \ 510 __attribute__ ((__warning__ (message))) 511# elif __clang_major__ >= 4 512/* Another compiler attribute is available in clang. */ 513# define _GL_WARN_ON_USE(function, message) \ 514_GL_WARN_EXTERN_C __typeof__ (function) function \ 515 __attribute__ ((__diagnose_if__ (1, message, "warning"))) 516# define _GL_WARN_ON_USE_ATTRIBUTE(message) \ 517 __attribute__ ((__diagnose_if__ (1, message, "warning"))) 518# elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING 519/* Verify the existence of the function. */ 520# define _GL_WARN_ON_USE(function, message) \ 521_GL_WARN_EXTERN_C __typeof__ (function) function 522# define _GL_WARN_ON_USE_ATTRIBUTE(message) 523# else /* Unsupported. */ 524# define _GL_WARN_ON_USE(function, message) \ 525_GL_WARN_EXTERN_C int _gl_warn_on_use 526# define _GL_WARN_ON_USE_ATTRIBUTE(message) 527# endif 528#endif 529 530/* _GL_WARN_ON_USE_CXX (function, rettype_gcc, rettype_clang, parameters_and_attributes, "message") 531 is like _GL_WARN_ON_USE (function, "message"), except that in C++ mode the 532 function is declared with the given prototype, consisting of return type, 533 parameters, and attributes. 534 This variant is useful for overloaded functions in C++. _GL_WARN_ON_USE does 535 not work in this case. */ 536#ifndef _GL_WARN_ON_USE_CXX 537# if !defined __cplusplus 538# define _GL_WARN_ON_USE_CXX(function,rettype_gcc,rettype_clang,parameters_and_attributes,msg) \ 539 _GL_WARN_ON_USE (function, msg) 540# else 541# if 4 < __GNUC__ || (__GNUC__ == 4 && 3 <= __GNUC_MINOR__) 542/* A compiler attribute is available in gcc versions 4.3.0 and later. */ 543# define _GL_WARN_ON_USE_CXX(function,rettype_gcc,rettype_clang,parameters_and_attributes,msg) \ 544extern rettype_gcc function parameters_and_attributes \ 545 __attribute__ ((__warning__ (msg))) 546# elif __clang_major__ >= 4 547/* Another compiler attribute is available in clang. */ 548# define _GL_WARN_ON_USE_CXX(function,rettype_gcc,rettype_clang,parameters_and_attributes,msg) \ 549extern rettype_clang function parameters_and_attributes \ 550 __attribute__ ((__diagnose_if__ (1, msg, "warning"))) 551# elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING 552/* Verify the existence of the function. */ 553# define _GL_WARN_ON_USE_CXX(function,rettype_gcc,rettype_clang,parameters_and_attributes,msg) \ 554extern rettype_gcc function parameters_and_attributes 555# else /* Unsupported. */ 556# define _GL_WARN_ON_USE_CXX(function,rettype_gcc,rettype_clang,parameters_and_attributes,msg) \ 557_GL_WARN_EXTERN_C int _gl_warn_on_use 558# endif 559# endif 560#endif 561 562/* _GL_WARN_EXTERN_C declaration; 563 performs the declaration with C linkage. */ 564#ifndef _GL_WARN_EXTERN_C 565# if defined __cplusplus 566# define _GL_WARN_EXTERN_C extern "C" 567# else 568# define _GL_WARN_EXTERN_C extern 569# endif 570#endif 571 572/* The LC_MESSAGES locale category is specified in POSIX, but not in ISO C. 573 On systems that don't define it, use the same value as GNU libintl. */ 574#if !defined LC_MESSAGES 575# define LC_MESSAGES 1729 576#endif 577 578/* On native Windows with MSVC, 'struct lconv' lacks the members int_p_* and 579 int_n_*. Instead of overriding 'struct lconv', merely define these member 580 names as macros. This avoids trouble in C++ mode. */ 581#if defined _MSC_VER 582# define int_p_cs_precedes p_cs_precedes 583# define int_p_sign_posn p_sign_posn 584# define int_p_sep_by_space p_sep_by_space 585# define int_n_cs_precedes n_cs_precedes 586# define int_n_sign_posn n_sign_posn 587# define int_n_sep_by_space n_sep_by_space 588#endif 589 590/* Bionic libc's 'struct lconv' is just a dummy. */ 591#if 0 592# define lconv rpl_lconv 593struct lconv 594{ 595 /* All 'char *' are actually 'const char *'. */ 596 597 /* Members that depend on the LC_NUMERIC category of the locale. See 598 <https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap07.html#tag_07_03_04> */ 599 600 /* Symbol used as decimal point. */ 601 char *decimal_point; 602 /* Symbol used to separate groups of digits to the left of the decimal 603 point. */ 604 char *thousands_sep; 605 /* Definition of the size of groups of digits to the left of the decimal 606 point. */ 607 char *grouping; 608 609 /* Members that depend on the LC_MONETARY category of the locale. See 610 <https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap07.html#tag_07_03_03> */ 611 612 /* Symbol used as decimal point. */ 613 char *mon_decimal_point; 614 /* Symbol used to separate groups of digits to the left of the decimal 615 point. */ 616 char *mon_thousands_sep; 617 /* Definition of the size of groups of digits to the left of the decimal 618 point. */ 619 char *mon_grouping; 620 /* Sign used to indicate a value >= 0. */ 621 char *positive_sign; 622 /* Sign used to indicate a value < 0. */ 623 char *negative_sign; 624 625 /* For formatting local currency. */ 626 /* Currency symbol (3 characters) followed by separator (1 character). */ 627 char *currency_symbol; 628 /* Number of digits after the decimal point. */ 629 char frac_digits; 630 /* For values >= 0: 1 if the currency symbol precedes the number, 0 if it 631 comes after the number. */ 632 char p_cs_precedes; 633 /* For values >= 0: Position of the sign. */ 634 char p_sign_posn; 635 /* For values >= 0: Placement of spaces between currency symbol, sign, and 636 number. */ 637 char p_sep_by_space; 638 /* For values < 0: 1 if the currency symbol precedes the number, 0 if it 639 comes after the number. */ 640 char n_cs_precedes; 641 /* For values < 0: Position of the sign. */ 642 char n_sign_posn; 643 /* For values < 0: Placement of spaces between currency symbol, sign, and 644 number. */ 645 char n_sep_by_space; 646 647 /* For formatting international currency. */ 648 /* Currency symbol (3 characters) followed by separator (1 character). */ 649 char *int_curr_symbol; 650 /* Number of digits after the decimal point. */ 651 char int_frac_digits; 652 /* For values >= 0: 1 if the currency symbol precedes the number, 0 if it 653 comes after the number. */ 654 char int_p_cs_precedes; 655 /* For values >= 0: Position of the sign. */ 656 char int_p_sign_posn; 657 /* For values >= 0: Placement of spaces between currency symbol, sign, and 658 number. */ 659 char int_p_sep_by_space; 660 /* For values < 0: 1 if the currency symbol precedes the number, 0 if it 661 comes after the number. */ 662 char int_n_cs_precedes; 663 /* For values < 0: Position of the sign. */ 664 char int_n_sign_posn; 665 /* For values < 0: Placement of spaces between currency symbol, sign, and 666 number. */ 667 char int_n_sep_by_space; 668}; 669#endif 670 671#if 0 672# if 0 673# if !(defined __cplusplus && defined GNULIB_NAMESPACE) 674# undef localeconv 675# define localeconv rpl_localeconv 676# endif 677_GL_FUNCDECL_RPL (localeconv, struct lconv *, (void)); 678_GL_CXXALIAS_RPL (localeconv, struct lconv *, (void)); 679# else 680_GL_CXXALIAS_SYS (localeconv, struct lconv *, (void)); 681# endif 682# if __GLIBC__ >= 2 683_GL_CXXALIASWARN (localeconv); 684# endif 685#elif 0 686# undef localeconv 687# define localeconv localeconv_used_without_requesting_gnulib_module_localeconv 688#elif defined GNULIB_POSIXCHECK 689# undef localeconv 690# if HAVE_RAW_DECL_LOCALECONV 691_GL_WARN_ON_USE (localeconv, 692 "localeconv returns too few information on some platforms - " 693 "use gnulib module localeconv for portability"); 694# endif 695#endif 696 697#if 0 698# if 0 699# if !(defined __cplusplus && defined GNULIB_NAMESPACE) 700# undef setlocale 701# define setlocale rpl_setlocale 702# define GNULIB_defined_setlocale 1 703# endif 704_GL_FUNCDECL_RPL (setlocale, char *, (int category, const char *locale)); 705_GL_CXXALIAS_RPL (setlocale, char *, (int category, const char *locale)); 706# else 707_GL_CXXALIAS_SYS (setlocale, char *, (int category, const char *locale)); 708# endif 709# if __GLIBC__ >= 2 710_GL_CXXALIASWARN (setlocale); 711# endif 712#elif defined GNULIB_POSIXCHECK 713# undef setlocale 714# if HAVE_RAW_DECL_SETLOCALE 715_GL_WARN_ON_USE (setlocale, "setlocale works differently on native Windows - " 716 "use gnulib module setlocale for portability"); 717# endif 718#endif 719 720#if 1 721/* Included here for convenience. */ 722# include "setlocale_null.h" 723#endif 724 725#if /*@GNULIB_NEWLOCALE@ ||*/ (0 && 0 && 1) 726# if 0 727# if !(defined __cplusplus && defined GNULIB_NAMESPACE) 728# undef newlocale 729# define newlocale rpl_newlocale 730# define GNULIB_defined_newlocale 1 731# endif 732_GL_FUNCDECL_RPL (newlocale, locale_t, 733 (int category_mask, const char *name, locale_t base) 734 _GL_ARG_NONNULL ((2))); 735_GL_CXXALIAS_RPL (newlocale, locale_t, 736 (int category_mask, const char *name, locale_t base)); 737# else 738# if 1 739_GL_CXXALIAS_SYS (newlocale, locale_t, 740 (int category_mask, const char *name, locale_t base)); 741# endif 742# endif 743# if 1 744_GL_CXXALIASWARN (newlocale); 745# endif 746# if 1 || 0 747# ifndef HAVE_WORKING_NEWLOCALE 748# define HAVE_WORKING_NEWLOCALE 1 749# endif 750# endif 751#elif defined GNULIB_POSIXCHECK 752# undef newlocale 753# if HAVE_RAW_DECL_NEWLOCALE 754_GL_WARN_ON_USE (newlocale, "newlocale is not portable"); 755# endif 756#endif 757 758#if 0 || (0 && 0 && 1) 759# if 0 760# if !(defined __cplusplus && defined GNULIB_NAMESPACE) 761# undef duplocale 762# define duplocale rpl_duplocale 763# define GNULIB_defined_duplocale 1 764# endif 765_GL_FUNCDECL_RPL (duplocale, locale_t, (locale_t locale) _GL_ARG_NONNULL ((1))); 766_GL_CXXALIAS_RPL (duplocale, locale_t, (locale_t locale)); 767# else 768# if 1 769_GL_CXXALIAS_SYS (duplocale, locale_t, (locale_t locale)); 770# endif 771# endif 772# if 1 773_GL_CXXALIASWARN (duplocale); 774# endif 775# if 1 || 0 776# ifndef HAVE_WORKING_DUPLOCALE 777# define HAVE_WORKING_DUPLOCALE 1 778# endif 779# endif 780#elif defined GNULIB_POSIXCHECK 781# undef duplocale 782# if HAVE_RAW_DECL_DUPLOCALE 783_GL_WARN_ON_USE (duplocale, "duplocale is buggy on some glibc systems - " 784 "use gnulib module duplocale for portability"); 785# endif 786#endif 787 788#if /*@GNULIB_FREELOCALE@ ||*/ (0 && 0 && 1) 789# if 0 790# if !(defined __cplusplus && defined GNULIB_NAMESPACE) 791# undef freelocale 792# define freelocale rpl_freelocale 793# define GNULIB_defined_freelocale 1 794# endif 795_GL_FUNCDECL_RPL (freelocale, void, (locale_t locale) _GL_ARG_NONNULL ((1))); 796_GL_CXXALIAS_RPL (freelocale, void, (locale_t locale)); 797# else 798# if 1 799/* Need to cast, because on FreeBSD and Mac OS X 10.13, the return type is 800 int. */ 801_GL_CXXALIAS_SYS_CAST (freelocale, void, (locale_t locale)); 802# endif 803# endif 804# if 1 805_GL_CXXALIASWARN (freelocale); 806# endif 807#elif defined GNULIB_POSIXCHECK 808# undef freelocale 809# if HAVE_RAW_DECL_FREELOCALE 810_GL_WARN_ON_USE (freelocale, "freelocale is not portable"); 811# endif 812#endif 813 814#endif /* _GL_LOCALE_H */ 815#endif /* _GL_LOCALE_H */ 816#endif /* !(__need_locale_t || _GL_ALREADY_INCLUDING_LOCALE_H) */ 817