1 /* This file is automatically generated. DO NOT EDIT! */ 2 /* Generated from: NetBSD: mknative-gdb,v 1.15 2020/12/05 21:27: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 GNU-like <stdlib.h>. 7 8 Copyright (C) 1995, 2001-2004, 2006-2020 Free Software Foundation, Inc. 9 10 This program is free software: you can redistribute it and/or modify 11 it under the terms of the GNU General Public License as published by 12 the Free Software Foundation; either version 3 of the License, or 13 (at your option) any later version. 14 15 This program is distributed in the hope that it will be useful, 16 but WITHOUT ANY WARRANTY; without even the implied warranty of 17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 GNU General Public License for more details. 19 20 You should have received a copy of the GNU General Public License 21 along with this program. If not, see <https://www.gnu.org/licenses/>. */ 22 23 #if __GNUC__ >= 3 24 #pragma GCC system_header 25 #endif 26 27 28 #if defined __need_system_stdlib_h || defined __need_malloc_and_calloc 29 /* Special invocation conventions inside some gnulib header files, 30 and inside some glibc header files, respectively. */ 31 32 #include_next <stdlib.h> 33 34 #else 35 /* Normal invocation convention. */ 36 37 #ifndef _GL_STDLIB_H 38 39 /* The include_next requires a split double-inclusion guard. */ 40 #include_next <stdlib.h> 41 42 #ifndef _GL_STDLIB_H 43 #define _GL_STDLIB_H 44 45 /* NetBSD 5.0 mis-defines NULL. */ 46 #include <stddef.h> 47 48 /* MirBSD 10 defines WEXITSTATUS in <sys/wait.h>, not in <stdlib.h>. */ 49 #if 0 && !defined WEXITSTATUS 50 # include <sys/wait.h> 51 #endif 52 53 /* Solaris declares getloadavg() in <sys/loadavg.h>. */ 54 #if (0 || defined GNULIB_POSIXCHECK) && 0 55 /* OpenIndiana has a bug: <sys/time.h> must be included before 56 <sys/loadavg.h>. */ 57 # include <sys/time.h> 58 # include <sys/loadavg.h> 59 #endif 60 61 /* Native Windows platforms declare mktemp() in <io.h>. */ 62 #if 0 && (defined _WIN32 && ! defined __CYGWIN__) 63 # include <io.h> 64 #endif 65 66 #if 0 67 68 /* OSF/1 5.1 declares 'struct random_data' in <random.h>, which is included 69 from <stdlib.h> if _REENTRANT is defined. Include it whenever we need 70 'struct random_data'. */ 71 # if 1 72 # include <random.h> 73 # endif 74 75 # if !1 || 0 || !1 76 # include <stdint.h> 77 # endif 78 79 # if !1 80 /* Define 'struct random_data'. 81 But allow multiple gnulib generated <stdlib.h> replacements to coexist. */ 82 # if !GNULIB_defined_struct_random_data 83 struct random_data 84 { 85 int32_t *fptr; /* Front pointer. */ 86 int32_t *rptr; /* Rear pointer. */ 87 int32_t *state; /* Array of state values. */ 88 int rand_type; /* Type of random number generator. */ 89 int rand_deg; /* Degree of random number generator. */ 90 int rand_sep; /* Distance between front and rear. */ 91 int32_t *end_ptr; /* Pointer behind state table. */ 92 }; 93 # define GNULIB_defined_struct_random_data 1 94 # endif 95 # endif 96 #endif 97 98 #if (0 || 0 || 1 || 0 || 0 || defined GNULIB_POSIXCHECK) && ! defined __GLIBC__ && !(defined _WIN32 && ! defined __CYGWIN__) 99 /* On Mac OS X 10.3, only <unistd.h> declares mkstemp. */ 100 /* On Mac OS X 10.5, only <unistd.h> declares mkstemps. */ 101 /* On Mac OS X 10.13, only <unistd.h> declares mkostemp and mkostemps. */ 102 /* On Cygwin 1.7.1, only <unistd.h> declares getsubopt. */ 103 /* But avoid namespace pollution on glibc systems and native Windows. */ 104 # include <unistd.h> 105 #endif 106 107 /* The __attribute__ feature is available in gcc versions 2.5 and later. 108 The attribute __pure__ was added in gcc 2.96. */ 109 #ifndef _GL_ATTRIBUTE_PURE 110 # if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96) 111 # define _GL_ATTRIBUTE_PURE __attribute__ ((__pure__)) 112 # else 113 # define _GL_ATTRIBUTE_PURE /* empty */ 114 # endif 115 #endif 116 117 /* The definition of _Noreturn is copied here. */ 118 /* A C macro for declaring that a function does not return. 119 Copyright (C) 2011-2020 Free Software Foundation, Inc. 120 121 This program is free software: you can redistribute it and/or modify it 122 under the terms of the GNU General Public License as published 123 by the Free Software Foundation; either version 3 of the License, or 124 (at your option) any later version. 125 126 This program is distributed in the hope that it will be useful, 127 but WITHOUT ANY WARRANTY; without even the implied warranty of 128 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 129 General Public License for more details. 130 131 You should have received a copy of the GNU General Public License 132 along with this program. If not, see <https://www.gnu.org/licenses/>. */ 133 134 #ifndef _Noreturn 135 # if (defined __cplusplus \ 136 && ((201103 <= __cplusplus && !(__GNUC__ == 4 && __GNUC_MINOR__ == 7)) \ 137 || (defined _MSC_VER && 1900 <= _MSC_VER)) \ 138 && 0) 139 /* [[noreturn]] is not practically usable, because with it the syntax 140 extern _Noreturn void func (...); 141 would not be valid; such a declaration would only be valid with 'extern' 142 and '_Noreturn' swapped, or without the 'extern' keyword. However, some 143 AIX system header files and several gnulib header files use precisely 144 this syntax with 'extern'. */ 145 # define _Noreturn [[noreturn]] 146 # elif ((!defined __cplusplus || defined __clang__) \ 147 && (201112 <= (defined __STDC_VERSION__ ? __STDC_VERSION__ : 0) \ 148 || 4 < __GNUC__ + (7 <= __GNUC_MINOR__) \ 149 || (defined __apple_build_version__ \ 150 ? 6000000 <= __apple_build_version__ \ 151 : 3 < __clang_major__ + (5 <= __clang_minor__)))) 152 /* _Noreturn works as-is. */ 153 # elif 2 < __GNUC__ + (8 <= __GNUC_MINOR__) || 0x5110 <= __SUNPRO_C 154 # define _Noreturn __attribute__ ((__noreturn__)) 155 # elif 1200 <= (defined _MSC_VER ? _MSC_VER : 0) 156 # define _Noreturn __declspec (noreturn) 157 # else 158 # define _Noreturn 159 # endif 160 #endif 161 162 /* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */ 163 /* C++ compatible function declaration macros. 164 Copyright (C) 2010-2020 Free Software Foundation, Inc. 165 166 This program is free software: you can redistribute it and/or modify it 167 under the terms of the GNU General Public License as published 168 by the Free Software Foundation; either version 3 of the License, or 169 (at your option) any later version. 170 171 This program is distributed in the hope that it will be useful, 172 but WITHOUT ANY WARRANTY; without even the implied warranty of 173 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 174 General Public License for more details. 175 176 You should have received a copy of the GNU General Public License 177 along with this program. If not, see <https://www.gnu.org/licenses/>. */ 178 179 #ifndef _GL_CXXDEFS_H 180 #define _GL_CXXDEFS_H 181 182 /* Begin/end the GNULIB_NAMESPACE namespace. */ 183 #if defined __cplusplus && defined GNULIB_NAMESPACE 184 # define _GL_BEGIN_NAMESPACE namespace GNULIB_NAMESPACE { 185 # define _GL_END_NAMESPACE } 186 #else 187 # define _GL_BEGIN_NAMESPACE 188 # define _GL_END_NAMESPACE 189 #endif 190 191 /* The three most frequent use cases of these macros are: 192 193 * For providing a substitute for a function that is missing on some 194 platforms, but is declared and works fine on the platforms on which 195 it exists: 196 197 #if @GNULIB_FOO@ 198 # if !@HAVE_FOO@ 199 _GL_FUNCDECL_SYS (foo, ...); 200 # endif 201 _GL_CXXALIAS_SYS (foo, ...); 202 _GL_CXXALIASWARN (foo); 203 #elif defined GNULIB_POSIXCHECK 204 ... 205 #endif 206 207 * For providing a replacement for a function that exists on all platforms, 208 but is broken/insufficient and needs to be replaced on some platforms: 209 210 #if @GNULIB_FOO@ 211 # if @REPLACE_FOO@ 212 # if !(defined __cplusplus && defined GNULIB_NAMESPACE) 213 # undef foo 214 # define foo rpl_foo 215 # endif 216 _GL_FUNCDECL_RPL (foo, ...); 217 _GL_CXXALIAS_RPL (foo, ...); 218 # else 219 _GL_CXXALIAS_SYS (foo, ...); 220 # endif 221 _GL_CXXALIASWARN (foo); 222 #elif defined GNULIB_POSIXCHECK 223 ... 224 #endif 225 226 * For providing a replacement for a function that exists on some platforms 227 but is broken/insufficient and needs to be replaced on some of them and 228 is additionally either missing or undeclared on some other platforms: 229 230 #if @GNULIB_FOO@ 231 # if @REPLACE_FOO@ 232 # if !(defined __cplusplus && defined GNULIB_NAMESPACE) 233 # undef foo 234 # define foo rpl_foo 235 # endif 236 _GL_FUNCDECL_RPL (foo, ...); 237 _GL_CXXALIAS_RPL (foo, ...); 238 # else 239 # if !@HAVE_FOO@ or if !@HAVE_DECL_FOO@ 240 _GL_FUNCDECL_SYS (foo, ...); 241 # endif 242 _GL_CXXALIAS_SYS (foo, ...); 243 # endif 244 _GL_CXXALIASWARN (foo); 245 #elif defined GNULIB_POSIXCHECK 246 ... 247 #endif 248 */ 249 250 /* _GL_EXTERN_C declaration; 251 performs the declaration with C linkage. */ 252 #if defined __cplusplus 253 # define _GL_EXTERN_C extern "C" 254 #else 255 # define _GL_EXTERN_C extern 256 #endif 257 258 /* _GL_FUNCDECL_RPL (func, rettype, parameters_and_attributes); 259 declares a replacement function, named rpl_func, with the given prototype, 260 consisting of return type, parameters, and attributes. 261 Example: 262 _GL_FUNCDECL_RPL (open, int, (const char *filename, int flags, ...) 263 _GL_ARG_NONNULL ((1))); 264 */ 265 #define _GL_FUNCDECL_RPL(func,rettype,parameters_and_attributes) \ 266 _GL_FUNCDECL_RPL_1 (rpl_##func, rettype, parameters_and_attributes) 267 #define _GL_FUNCDECL_RPL_1(rpl_func,rettype,parameters_and_attributes) \ 268 _GL_EXTERN_C rettype rpl_func parameters_and_attributes 269 270 /* _GL_FUNCDECL_SYS (func, rettype, parameters_and_attributes); 271 declares the system function, named func, with the given prototype, 272 consisting of return type, parameters, and attributes. 273 Example: 274 _GL_FUNCDECL_SYS (open, int, (const char *filename, int flags, ...) 275 _GL_ARG_NONNULL ((1))); 276 */ 277 #define _GL_FUNCDECL_SYS(func,rettype,parameters_and_attributes) \ 278 _GL_EXTERN_C rettype func parameters_and_attributes 279 280 /* _GL_CXXALIAS_RPL (func, rettype, parameters); 281 declares a C++ alias called GNULIB_NAMESPACE::func 282 that redirects to rpl_func, if GNULIB_NAMESPACE is defined. 283 Example: 284 _GL_CXXALIAS_RPL (open, int, (const char *filename, int flags, ...)); 285 286 Wrapping rpl_func in an object with an inline conversion operator 287 avoids a reference to rpl_func unless GNULIB_NAMESPACE::func is 288 actually used in the program. */ 289 #define _GL_CXXALIAS_RPL(func,rettype,parameters) \ 290 _GL_CXXALIAS_RPL_1 (func, rpl_##func, rettype, parameters) 291 #if defined __cplusplus && defined GNULIB_NAMESPACE 292 # define _GL_CXXALIAS_RPL_1(func,rpl_func,rettype,parameters) \ 293 namespace GNULIB_NAMESPACE \ 294 { \ 295 static const struct _gl_ ## func ## _wrapper \ 296 { \ 297 typedef rettype (*type) parameters; \ 298 \ 299 inline operator type () const \ 300 { \ 301 return ::rpl_func; \ 302 } \ 303 } func = {}; \ 304 } \ 305 _GL_EXTERN_C int _gl_cxxalias_dummy 306 #else 307 # define _GL_CXXALIAS_RPL_1(func,rpl_func,rettype,parameters) \ 308 _GL_EXTERN_C int _gl_cxxalias_dummy 309 #endif 310 311 /* _GL_CXXALIAS_RPL_CAST_1 (func, rpl_func, rettype, parameters); 312 is like _GL_CXXALIAS_RPL_1 (func, rpl_func, rettype, parameters); 313 except that the C function rpl_func may have a slightly different 314 declaration. A cast is used to silence the "invalid conversion" error 315 that would otherwise occur. */ 316 #if defined __cplusplus && defined GNULIB_NAMESPACE 317 # define _GL_CXXALIAS_RPL_CAST_1(func,rpl_func,rettype,parameters) \ 318 namespace GNULIB_NAMESPACE \ 319 { \ 320 static const struct _gl_ ## func ## _wrapper \ 321 { \ 322 typedef rettype (*type) parameters; \ 323 \ 324 inline operator type () const \ 325 { \ 326 return reinterpret_cast<type>(::rpl_func); \ 327 } \ 328 } func = {}; \ 329 } \ 330 _GL_EXTERN_C int _gl_cxxalias_dummy 331 #else 332 # define _GL_CXXALIAS_RPL_CAST_1(func,rpl_func,rettype,parameters) \ 333 _GL_EXTERN_C int _gl_cxxalias_dummy 334 #endif 335 336 /* _GL_CXXALIAS_SYS (func, rettype, parameters); 337 declares a C++ alias called GNULIB_NAMESPACE::func 338 that redirects to the system provided function func, if GNULIB_NAMESPACE 339 is defined. 340 Example: 341 _GL_CXXALIAS_SYS (open, int, (const char *filename, int flags, ...)); 342 343 Wrapping func in an object with an inline conversion operator 344 avoids a reference to func unless GNULIB_NAMESPACE::func is 345 actually used in the program. */ 346 #if defined __cplusplus && defined GNULIB_NAMESPACE 347 # define _GL_CXXALIAS_SYS(func,rettype,parameters) \ 348 namespace GNULIB_NAMESPACE \ 349 { \ 350 static const struct _gl_ ## func ## _wrapper \ 351 { \ 352 typedef rettype (*type) parameters; \ 353 \ 354 inline operator type () const \ 355 { \ 356 return ::func; \ 357 } \ 358 } func = {}; \ 359 } \ 360 _GL_EXTERN_C int _gl_cxxalias_dummy 361 #else 362 # define _GL_CXXALIAS_SYS(func,rettype,parameters) \ 363 _GL_EXTERN_C int _gl_cxxalias_dummy 364 #endif 365 366 /* _GL_CXXALIAS_SYS_CAST (func, rettype, parameters); 367 is like _GL_CXXALIAS_SYS (func, rettype, parameters); 368 except that the C function func may have a slightly different declaration. 369 A cast is used to silence the "invalid conversion" error that would 370 otherwise occur. */ 371 #if defined __cplusplus && defined GNULIB_NAMESPACE 372 # define _GL_CXXALIAS_SYS_CAST(func,rettype,parameters) \ 373 namespace GNULIB_NAMESPACE \ 374 { \ 375 static const struct _gl_ ## func ## _wrapper \ 376 { \ 377 typedef rettype (*type) parameters; \ 378 \ 379 inline operator type () const \ 380 { \ 381 return reinterpret_cast<type>(::func); \ 382 } \ 383 } func = {}; \ 384 } \ 385 _GL_EXTERN_C int _gl_cxxalias_dummy 386 #else 387 # define _GL_CXXALIAS_SYS_CAST(func,rettype,parameters) \ 388 _GL_EXTERN_C int _gl_cxxalias_dummy 389 #endif 390 391 /* _GL_CXXALIAS_SYS_CAST2 (func, rettype, parameters, rettype2, parameters2); 392 is like _GL_CXXALIAS_SYS (func, rettype, parameters); 393 except that the C function is picked among a set of overloaded functions, 394 namely the one with rettype2 and parameters2. Two consecutive casts 395 are used to silence the "cannot find a match" and "invalid conversion" 396 errors that would otherwise occur. */ 397 #if defined __cplusplus && defined GNULIB_NAMESPACE 398 /* The outer cast must be a reinterpret_cast. 399 The inner cast: When the function is defined as a set of overloaded 400 functions, it works as a static_cast<>, choosing the designated variant. 401 When the function is defined as a single variant, it works as a 402 reinterpret_cast<>. The parenthesized cast syntax works both ways. */ 403 # define _GL_CXXALIAS_SYS_CAST2(func,rettype,parameters,rettype2,parameters2) \ 404 namespace GNULIB_NAMESPACE \ 405 { \ 406 static const struct _gl_ ## func ## _wrapper \ 407 { \ 408 typedef rettype (*type) parameters; \ 409 \ 410 inline operator type () const \ 411 { \ 412 return reinterpret_cast<type>((rettype2 (*) parameters2)(::func)); \ 413 } \ 414 } func = {}; \ 415 } \ 416 _GL_EXTERN_C int _gl_cxxalias_dummy 417 #else 418 # define _GL_CXXALIAS_SYS_CAST2(func,rettype,parameters,rettype2,parameters2) \ 419 _GL_EXTERN_C int _gl_cxxalias_dummy 420 #endif 421 422 /* _GL_CXXALIASWARN (func); 423 causes a warning to be emitted when ::func is used but not when 424 GNULIB_NAMESPACE::func is used. func must be defined without overloaded 425 variants. */ 426 #if defined __cplusplus && defined GNULIB_NAMESPACE 427 # define _GL_CXXALIASWARN(func) \ 428 _GL_CXXALIASWARN_1 (func, GNULIB_NAMESPACE) 429 # define _GL_CXXALIASWARN_1(func,namespace) \ 430 _GL_CXXALIASWARN_2 (func, namespace) 431 /* To work around GCC bug <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=43881>, 432 we enable the warning only when not optimizing. */ 433 # if !__OPTIMIZE__ 434 # define _GL_CXXALIASWARN_2(func,namespace) \ 435 _GL_WARN_ON_USE (func, \ 436 "The symbol ::" #func " refers to the system function. " \ 437 "Use " #namespace "::" #func " instead.") 438 # elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING 439 # define _GL_CXXALIASWARN_2(func,namespace) \ 440 extern __typeof__ (func) func 441 # else 442 # define _GL_CXXALIASWARN_2(func,namespace) \ 443 _GL_EXTERN_C int _gl_cxxalias_dummy 444 # endif 445 #else 446 # define _GL_CXXALIASWARN(func) \ 447 _GL_EXTERN_C int _gl_cxxalias_dummy 448 #endif 449 450 /* _GL_CXXALIASWARN1 (func, rettype, parameters_and_attributes); 451 causes a warning to be emitted when the given overloaded variant of ::func 452 is used but not when GNULIB_NAMESPACE::func is used. */ 453 #if defined __cplusplus && defined GNULIB_NAMESPACE 454 # define _GL_CXXALIASWARN1(func,rettype,parameters_and_attributes) \ 455 _GL_CXXALIASWARN1_1 (func, rettype, parameters_and_attributes, \ 456 GNULIB_NAMESPACE) 457 # define _GL_CXXALIASWARN1_1(func,rettype,parameters_and_attributes,namespace) \ 458 _GL_CXXALIASWARN1_2 (func, rettype, parameters_and_attributes, namespace) 459 /* To work around GCC bug <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=43881>, 460 we enable the warning only when not optimizing. */ 461 # if !__OPTIMIZE__ 462 # define _GL_CXXALIASWARN1_2(func,rettype,parameters_and_attributes,namespace) \ 463 _GL_WARN_ON_USE_CXX (func, rettype, parameters_and_attributes, \ 464 "The symbol ::" #func " refers to the system function. " \ 465 "Use " #namespace "::" #func " instead.") 466 # else 467 # define _GL_CXXALIASWARN1_2(func,rettype,parameters_and_attributes,namespace) \ 468 _GL_EXTERN_C int _gl_cxxalias_dummy 469 # endif 470 #else 471 # define _GL_CXXALIASWARN1(func,rettype,parameters_and_attributes) \ 472 _GL_EXTERN_C int _gl_cxxalias_dummy 473 #endif 474 475 #endif /* _GL_CXXDEFS_H */ 476 477 /* The definition of _GL_ARG_NONNULL is copied here. */ 478 /* A C macro for declaring that specific arguments must not be NULL. 479 Copyright (C) 2009-2020 Free Software Foundation, Inc. 480 481 This program is free software: you can redistribute it and/or modify it 482 under the terms of the GNU General Public License as published 483 by the Free Software Foundation; either version 3 of the License, or 484 (at your option) any later version. 485 486 This program is distributed in the hope that it will be useful, 487 but WITHOUT ANY WARRANTY; without even the implied warranty of 488 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 489 General Public License for more details. 490 491 You should have received a copy of the GNU General Public License 492 along with this program. If not, see <https://www.gnu.org/licenses/>. */ 493 494 /* _GL_ARG_NONNULL((n,...,m)) tells the compiler and static analyzer tools 495 that the values passed as arguments n, ..., m must be non-NULL pointers. 496 n = 1 stands for the first argument, n = 2 for the second argument etc. */ 497 #ifndef _GL_ARG_NONNULL 498 # if (__GNUC__ == 3 && __GNUC_MINOR__ >= 3) || __GNUC__ > 3 499 # define _GL_ARG_NONNULL(params) __attribute__ ((__nonnull__ params)) 500 # else 501 # define _GL_ARG_NONNULL(params) 502 # endif 503 #endif 504 505 /* The definition of _GL_WARN_ON_USE is copied here. */ 506 /* A C macro for emitting warnings if a function is used. 507 Copyright (C) 2010-2020 Free Software Foundation, Inc. 508 509 This program is free software: you can redistribute it and/or modify it 510 under the terms of the GNU General Public License as published 511 by the Free Software Foundation; either version 3 of the License, or 512 (at your option) any later version. 513 514 This program is distributed in the hope that it will be useful, 515 but WITHOUT ANY WARRANTY; without even the implied warranty of 516 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 517 General Public License for more details. 518 519 You should have received a copy of the GNU General Public License 520 along with this program. If not, see <https://www.gnu.org/licenses/>. */ 521 522 /* _GL_WARN_ON_USE (function, "literal string") issues a declaration 523 for FUNCTION which will then trigger a compiler warning containing 524 the text of "literal string" anywhere that function is called, if 525 supported by the compiler. If the compiler does not support this 526 feature, the macro expands to an unused extern declaration. 527 528 _GL_WARN_ON_USE_ATTRIBUTE ("literal string") expands to the 529 attribute used in _GL_WARN_ON_USE. If the compiler does not support 530 this feature, it expands to empty. 531 532 These macros are useful for marking a function as a potential 533 portability trap, with the intent that "literal string" include 534 instructions on the replacement function that should be used 535 instead. 536 _GL_WARN_ON_USE is for functions with 'extern' linkage. 537 _GL_WARN_ON_USE_ATTRIBUTE is for functions with 'static' or 'inline' 538 linkage. 539 540 However, one of the reasons that a function is a portability trap is 541 if it has the wrong signature. Declaring FUNCTION with a different 542 signature in C is a compilation error, so this macro must use the 543 same type as any existing declaration so that programs that avoid 544 the problematic FUNCTION do not fail to compile merely because they 545 included a header that poisoned the function. But this implies that 546 _GL_WARN_ON_USE is only safe to use if FUNCTION is known to already 547 have a declaration. Use of this macro implies that there must not 548 be any other macro hiding the declaration of FUNCTION; but 549 undefining FUNCTION first is part of the poisoning process anyway 550 (although for symbols that are provided only via a macro, the result 551 is a compilation error rather than a warning containing 552 "literal string"). Also note that in C++, it is only safe to use if 553 FUNCTION has no overloads. 554 555 For an example, it is possible to poison 'getline' by: 556 - adding a call to gl_WARN_ON_USE_PREPARE([[#include <stdio.h>]], 557 [getline]) in configure.ac, which potentially defines 558 HAVE_RAW_DECL_GETLINE 559 - adding this code to a header that wraps the system <stdio.h>: 560 #undef getline 561 #if HAVE_RAW_DECL_GETLINE 562 _GL_WARN_ON_USE (getline, "getline is required by POSIX 2008, but" 563 "not universally present; use the gnulib module getline"); 564 #endif 565 566 It is not possible to directly poison global variables. But it is 567 possible to write a wrapper accessor function, and poison that 568 (less common usage, like &environ, will cause a compilation error 569 rather than issue the nice warning, but the end result of informing 570 the developer about their portability problem is still achieved): 571 #if HAVE_RAW_DECL_ENVIRON 572 static char *** 573 rpl_environ (void) { return &environ; } 574 _GL_WARN_ON_USE (rpl_environ, "environ is not always properly declared"); 575 # undef environ 576 # define environ (*rpl_environ ()) 577 #endif 578 or better (avoiding contradictory use of 'static' and 'extern'): 579 #if HAVE_RAW_DECL_ENVIRON 580 static char *** 581 _GL_WARN_ON_USE_ATTRIBUTE ("environ is not always properly declared") 582 rpl_environ (void) { return &environ; } 583 # undef environ 584 # define environ (*rpl_environ ()) 585 #endif 586 */ 587 #ifndef _GL_WARN_ON_USE 588 589 # if 4 < __GNUC__ || (__GNUC__ == 4 && 3 <= __GNUC_MINOR__) 590 /* A compiler attribute is available in gcc versions 4.3.0 and later. */ 591 # define _GL_WARN_ON_USE(function, message) \ 592 extern __typeof__ (function) function __attribute__ ((__warning__ (message))) 593 # define _GL_WARN_ON_USE_ATTRIBUTE(message) \ 594 __attribute__ ((__warning__ (message))) 595 # elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING 596 /* Verify the existence of the function. */ 597 # define _GL_WARN_ON_USE(function, message) \ 598 extern __typeof__ (function) function 599 # define _GL_WARN_ON_USE_ATTRIBUTE(message) 600 # else /* Unsupported. */ 601 # define _GL_WARN_ON_USE(function, message) \ 602 _GL_WARN_EXTERN_C int _gl_warn_on_use 603 # define _GL_WARN_ON_USE_ATTRIBUTE(message) 604 # endif 605 #endif 606 607 /* _GL_WARN_ON_USE_CXX (function, rettype, parameters_and_attributes, "string") 608 is like _GL_WARN_ON_USE (function, "string"), except that in C++ mode the 609 function is declared with the given prototype, consisting of return type, 610 parameters, and attributes. 611 This variant is useful for overloaded functions in C++. _GL_WARN_ON_USE does 612 not work in this case. */ 613 #ifndef _GL_WARN_ON_USE_CXX 614 # if !defined __cplusplus 615 # define _GL_WARN_ON_USE_CXX(function,rettype,parameters_and_attributes,msg) \ 616 _GL_WARN_ON_USE (function, msg) 617 # else 618 # if 4 < __GNUC__ || (__GNUC__ == 4 && 3 <= __GNUC_MINOR__) 619 # define _GL_WARN_ON_USE_CXX(function,rettype,parameters_and_attributes,msg) \ 620 extern rettype function parameters_and_attributes \ 621 __attribute__ ((__warning__ (msg))) 622 # elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING 623 /* Verify the existence of the function. */ 624 # define _GL_WARN_ON_USE_CXX(function,rettype,parameters_and_attributes,msg) \ 625 extern rettype function parameters_and_attributes 626 # else /* Unsupported. */ 627 # define _GL_WARN_ON_USE_CXX(function,rettype,parameters_and_attributes,msg) \ 628 _GL_WARN_EXTERN_C int _gl_warn_on_use 629 # endif 630 # endif 631 #endif 632 633 /* _GL_WARN_EXTERN_C declaration; 634 performs the declaration with C linkage. */ 635 #ifndef _GL_WARN_EXTERN_C 636 # if defined __cplusplus 637 # define _GL_WARN_EXTERN_C extern "C" 638 # else 639 # define _GL_WARN_EXTERN_C extern 640 # endif 641 #endif 642 643 644 /* Some systems do not define EXIT_*, despite otherwise supporting C89. */ 645 #ifndef EXIT_SUCCESS 646 # define EXIT_SUCCESS 0 647 #endif 648 /* Tandem/NSK and other platforms that define EXIT_FAILURE as -1 interfere 649 with proper operation of xargs. */ 650 #ifndef EXIT_FAILURE 651 # define EXIT_FAILURE 1 652 #elif EXIT_FAILURE != 1 653 # undef EXIT_FAILURE 654 # define EXIT_FAILURE 1 655 #endif 656 657 658 #if 0 659 /* Terminate the current process with the given return code, without running 660 the 'atexit' handlers. */ 661 # if !1 662 _GL_FUNCDECL_SYS (_Exit, _Noreturn void, (int status)); 663 # endif 664 _GL_CXXALIAS_SYS (_Exit, void, (int status)); 665 _GL_CXXALIASWARN (_Exit); 666 #elif defined GNULIB_POSIXCHECK 667 # undef _Exit 668 # if HAVE_RAW_DECL__EXIT 669 _GL_WARN_ON_USE (_Exit, "_Exit is unportable - " 670 "use gnulib module _Exit for portability"); 671 # endif 672 #endif 673 674 675 #if 0 676 /* Parse a signed decimal integer. 677 Returns the value of the integer. Errors are not detected. */ 678 # if !1 679 _GL_FUNCDECL_SYS (atoll, long long, (const char *string) 680 _GL_ATTRIBUTE_PURE 681 _GL_ARG_NONNULL ((1))); 682 # endif 683 _GL_CXXALIAS_SYS (atoll, long long, (const char *string)); 684 _GL_CXXALIASWARN (atoll); 685 #elif defined GNULIB_POSIXCHECK 686 # undef atoll 687 # if HAVE_RAW_DECL_ATOLL 688 _GL_WARN_ON_USE (atoll, "atoll is unportable - " 689 "use gnulib module atoll for portability"); 690 # endif 691 #endif 692 693 #if 0 694 # if 0 695 # if !(defined __cplusplus && defined GNULIB_NAMESPACE) 696 # undef calloc 697 # define calloc rpl_calloc 698 # endif 699 _GL_FUNCDECL_RPL (calloc, void *, (size_t nmemb, size_t size)); 700 _GL_CXXALIAS_RPL (calloc, void *, (size_t nmemb, size_t size)); 701 # else 702 _GL_CXXALIAS_SYS (calloc, void *, (size_t nmemb, size_t size)); 703 # endif 704 # if __GLIBC__ >= 2 705 _GL_CXXALIASWARN (calloc); 706 # endif 707 #elif defined GNULIB_POSIXCHECK 708 # undef calloc 709 /* Assume calloc is always declared. */ 710 _GL_WARN_ON_USE (calloc, "calloc is not POSIX compliant everywhere - " 711 "use gnulib module calloc-posix for portability"); 712 #endif 713 714 #if 1 715 # if 0 716 # if !(defined __cplusplus && defined GNULIB_NAMESPACE) 717 # define canonicalize_file_name rpl_canonicalize_file_name 718 # endif 719 _GL_FUNCDECL_RPL (canonicalize_file_name, char *, (const char *name) 720 _GL_ARG_NONNULL ((1))); 721 _GL_CXXALIAS_RPL (canonicalize_file_name, char *, (const char *name)); 722 # else 723 # if !0 724 _GL_FUNCDECL_SYS (canonicalize_file_name, char *, (const char *name) 725 _GL_ARG_NONNULL ((1))); 726 # endif 727 _GL_CXXALIAS_SYS (canonicalize_file_name, char *, (const char *name)); 728 # endif 729 # ifndef GNULIB_defined_canonicalize_file_name 730 # define GNULIB_defined_canonicalize_file_name \ 731 (!0 || 0) 732 # endif 733 _GL_CXXALIASWARN (canonicalize_file_name); 734 #elif defined GNULIB_POSIXCHECK 735 # undef canonicalize_file_name 736 # if HAVE_RAW_DECL_CANONICALIZE_FILE_NAME 737 _GL_WARN_ON_USE (canonicalize_file_name, 738 "canonicalize_file_name is unportable - " 739 "use gnulib module canonicalize-lgpl for portability"); 740 # endif 741 #endif 742 743 #if 0 744 /* Store max(NELEM,3) load average numbers in LOADAVG[]. 745 The three numbers are the load average of the last 1 minute, the last 5 746 minutes, and the last 15 minutes, respectively. 747 LOADAVG is an array of NELEM numbers. */ 748 # if !1 749 _GL_FUNCDECL_SYS (getloadavg, int, (double loadavg[], int nelem) 750 _GL_ARG_NONNULL ((1))); 751 # endif 752 _GL_CXXALIAS_SYS (getloadavg, int, (double loadavg[], int nelem)); 753 _GL_CXXALIASWARN (getloadavg); 754 #elif defined GNULIB_POSIXCHECK 755 # undef getloadavg 756 # if HAVE_RAW_DECL_GETLOADAVG 757 _GL_WARN_ON_USE (getloadavg, "getloadavg is not portable - " 758 "use gnulib module getloadavg for portability"); 759 # endif 760 #endif 761 762 #if 0 763 /* Assuming *OPTIONP is a comma separated list of elements of the form 764 "token" or "token=value", getsubopt parses the first of these elements. 765 If the first element refers to a "token" that is member of the given 766 NULL-terminated array of tokens: 767 - It replaces the comma with a NUL byte, updates *OPTIONP to point past 768 the first option and the comma, sets *VALUEP to the value of the 769 element (or NULL if it doesn't contain an "=" sign), 770 - It returns the index of the "token" in the given array of tokens. 771 Otherwise it returns -1, and *OPTIONP and *VALUEP are undefined. 772 For more details see the POSIX specification. 773 https://pubs.opengroup.org/onlinepubs/9699919799/functions/getsubopt.html */ 774 # if !1 775 _GL_FUNCDECL_SYS (getsubopt, int, 776 (char **optionp, char *const *tokens, char **valuep) 777 _GL_ARG_NONNULL ((1, 2, 3))); 778 # endif 779 _GL_CXXALIAS_SYS (getsubopt, int, 780 (char **optionp, char *const *tokens, char **valuep)); 781 _GL_CXXALIASWARN (getsubopt); 782 #elif defined GNULIB_POSIXCHECK 783 # undef getsubopt 784 # if HAVE_RAW_DECL_GETSUBOPT 785 _GL_WARN_ON_USE (getsubopt, "getsubopt is unportable - " 786 "use gnulib module getsubopt for portability"); 787 # endif 788 #endif 789 790 #if 0 791 /* Change the ownership and access permission of the slave side of the 792 pseudo-terminal whose master side is specified by FD. */ 793 # if !1 794 _GL_FUNCDECL_SYS (grantpt, int, (int fd)); 795 # endif 796 _GL_CXXALIAS_SYS (grantpt, int, (int fd)); 797 _GL_CXXALIASWARN (grantpt); 798 #elif defined GNULIB_POSIXCHECK 799 # undef grantpt 800 # if HAVE_RAW_DECL_GRANTPT 801 _GL_WARN_ON_USE (grantpt, "grantpt is not portable - " 802 "use gnulib module grantpt for portability"); 803 # endif 804 #endif 805 806 /* If _GL_USE_STDLIB_ALLOC is nonzero, the including module does not 807 rely on GNU or POSIX semantics for malloc and realloc (for example, 808 by never specifying a zero size), so it does not need malloc or 809 realloc to be redefined. */ 810 #if 1 811 # if 0 812 # if !((defined __cplusplus && defined GNULIB_NAMESPACE) \ 813 || _GL_USE_STDLIB_ALLOC) 814 # undef malloc 815 # define malloc rpl_malloc 816 # endif 817 _GL_FUNCDECL_RPL (malloc, void *, (size_t size)); 818 _GL_CXXALIAS_RPL (malloc, void *, (size_t size)); 819 # else 820 _GL_CXXALIAS_SYS (malloc, void *, (size_t size)); 821 # endif 822 # if __GLIBC__ >= 2 823 _GL_CXXALIASWARN (malloc); 824 # endif 825 #elif defined GNULIB_POSIXCHECK && !_GL_USE_STDLIB_ALLOC 826 # undef malloc 827 /* Assume malloc is always declared. */ 828 _GL_WARN_ON_USE (malloc, "malloc is not POSIX compliant everywhere - " 829 "use gnulib module malloc-posix for portability"); 830 #endif 831 832 /* Convert a multibyte character to a wide character. */ 833 #if 1 834 # if 0 835 # if !(defined __cplusplus && defined GNULIB_NAMESPACE) 836 # undef mbtowc 837 # define mbtowc rpl_mbtowc 838 # endif 839 _GL_FUNCDECL_RPL (mbtowc, int, 840 (wchar_t *restrict pwc, const char *restrict s, size_t n)); 841 _GL_CXXALIAS_RPL (mbtowc, int, 842 (wchar_t *restrict pwc, const char *restrict s, size_t n)); 843 # else 844 # if !1 845 _GL_FUNCDECL_SYS (mbtowc, int, 846 (wchar_t *restrict pwc, const char *restrict s, size_t n)); 847 # endif 848 _GL_CXXALIAS_SYS (mbtowc, int, 849 (wchar_t *restrict pwc, const char *restrict s, size_t n)); 850 # endif 851 # if __GLIBC__ >= 2 852 _GL_CXXALIASWARN (mbtowc); 853 # endif 854 #elif defined GNULIB_POSIXCHECK 855 # undef mbtowc 856 # if HAVE_RAW_DECL_MBTOWC 857 _GL_WARN_ON_USE (mbtowc, "mbtowc is not portable - " 858 "use gnulib module mbtowc for portability"); 859 # endif 860 #endif 861 862 #if 1 863 /* Create a unique temporary directory from TEMPLATE. 864 The last six characters of TEMPLATE must be "XXXXXX"; 865 they are replaced with a string that makes the directory name unique. 866 Returns TEMPLATE, or a null pointer if it cannot get a unique name. 867 The directory is created mode 700. */ 868 # if !1 869 _GL_FUNCDECL_SYS (mkdtemp, char *, (char * /*template*/) _GL_ARG_NONNULL ((1))); 870 # endif 871 _GL_CXXALIAS_SYS (mkdtemp, char *, (char * /*template*/)); 872 _GL_CXXALIASWARN (mkdtemp); 873 #elif defined GNULIB_POSIXCHECK 874 # undef mkdtemp 875 # if HAVE_RAW_DECL_MKDTEMP 876 _GL_WARN_ON_USE (mkdtemp, "mkdtemp is unportable - " 877 "use gnulib module mkdtemp for portability"); 878 # endif 879 #endif 880 881 #if 1 882 /* Create a unique temporary file from TEMPLATE. 883 The last six characters of TEMPLATE must be "XXXXXX"; 884 they are replaced with a string that makes the file name unique. 885 The flags are a bitmask, possibly including O_CLOEXEC (defined in <fcntl.h>) 886 and O_TEXT, O_BINARY (defined in "binary-io.h"). 887 The file is then created, with the specified flags, ensuring it didn't exist 888 before. 889 The file is created read-write (mask at least 0600 & ~umask), but it may be 890 world-readable and world-writable (mask 0666 & ~umask), depending on the 891 implementation. 892 Returns the open file descriptor if successful, otherwise -1 and errno 893 set. */ 894 # if !1 895 _GL_FUNCDECL_SYS (mkostemp, int, (char * /*template*/, int /*flags*/) 896 _GL_ARG_NONNULL ((1))); 897 # endif 898 _GL_CXXALIAS_SYS (mkostemp, int, (char * /*template*/, int /*flags*/)); 899 _GL_CXXALIASWARN (mkostemp); 900 #elif defined GNULIB_POSIXCHECK 901 # undef mkostemp 902 # if HAVE_RAW_DECL_MKOSTEMP 903 _GL_WARN_ON_USE (mkostemp, "mkostemp is unportable - " 904 "use gnulib module mkostemp for portability"); 905 # endif 906 #endif 907 908 #if 0 909 /* Create a unique temporary file from TEMPLATE. 910 The last six characters of TEMPLATE before a suffix of length 911 SUFFIXLEN must be "XXXXXX"; 912 they are replaced with a string that makes the file name unique. 913 The flags are a bitmask, possibly including O_CLOEXEC (defined in <fcntl.h>) 914 and O_TEXT, O_BINARY (defined in "binary-io.h"). 915 The file is then created, with the specified flags, ensuring it didn't exist 916 before. 917 The file is created read-write (mask at least 0600 & ~umask), but it may be 918 world-readable and world-writable (mask 0666 & ~umask), depending on the 919 implementation. 920 Returns the open file descriptor if successful, otherwise -1 and errno 921 set. */ 922 # if !1 923 _GL_FUNCDECL_SYS (mkostemps, int, 924 (char * /*template*/, int /*suffixlen*/, int /*flags*/) 925 _GL_ARG_NONNULL ((1))); 926 # endif 927 _GL_CXXALIAS_SYS (mkostemps, int, 928 (char * /*template*/, int /*suffixlen*/, int /*flags*/)); 929 _GL_CXXALIASWARN (mkostemps); 930 #elif defined GNULIB_POSIXCHECK 931 # undef mkostemps 932 # if HAVE_RAW_DECL_MKOSTEMPS 933 _GL_WARN_ON_USE (mkostemps, "mkostemps is unportable - " 934 "use gnulib module mkostemps for portability"); 935 # endif 936 #endif 937 938 #if 0 939 /* Create a unique temporary file from TEMPLATE. 940 The last six characters of TEMPLATE must be "XXXXXX"; 941 they are replaced with a string that makes the file name unique. 942 The file is then created, ensuring it didn't exist before. 943 The file is created read-write (mask at least 0600 & ~umask), but it may be 944 world-readable and world-writable (mask 0666 & ~umask), depending on the 945 implementation. 946 Returns the open file descriptor if successful, otherwise -1 and errno 947 set. */ 948 # if 0 949 # if !(defined __cplusplus && defined GNULIB_NAMESPACE) 950 # define mkstemp rpl_mkstemp 951 # endif 952 _GL_FUNCDECL_RPL (mkstemp, int, (char * /*template*/) _GL_ARG_NONNULL ((1))); 953 _GL_CXXALIAS_RPL (mkstemp, int, (char * /*template*/)); 954 # else 955 # if ! 1 956 _GL_FUNCDECL_SYS (mkstemp, int, (char * /*template*/) _GL_ARG_NONNULL ((1))); 957 # endif 958 _GL_CXXALIAS_SYS (mkstemp, int, (char * /*template*/)); 959 # endif 960 _GL_CXXALIASWARN (mkstemp); 961 #elif defined GNULIB_POSIXCHECK 962 # undef mkstemp 963 # if HAVE_RAW_DECL_MKSTEMP 964 _GL_WARN_ON_USE (mkstemp, "mkstemp is unportable - " 965 "use gnulib module mkstemp for portability"); 966 # endif 967 #endif 968 969 #if 0 970 /* Create a unique temporary file from TEMPLATE. 971 The last six characters of TEMPLATE prior to a suffix of length 972 SUFFIXLEN must be "XXXXXX"; 973 they are replaced with a string that makes the file name unique. 974 The file is then created, ensuring it didn't exist before. 975 The file is created read-write (mask at least 0600 & ~umask), but it may be 976 world-readable and world-writable (mask 0666 & ~umask), depending on the 977 implementation. 978 Returns the open file descriptor if successful, otherwise -1 and errno 979 set. */ 980 # if !1 981 _GL_FUNCDECL_SYS (mkstemps, int, (char * /*template*/, int /*suffixlen*/) 982 _GL_ARG_NONNULL ((1))); 983 # endif 984 _GL_CXXALIAS_SYS (mkstemps, int, (char * /*template*/, int /*suffixlen*/)); 985 _GL_CXXALIASWARN (mkstemps); 986 #elif defined GNULIB_POSIXCHECK 987 # undef mkstemps 988 # if HAVE_RAW_DECL_MKSTEMPS 989 _GL_WARN_ON_USE (mkstemps, "mkstemps is unportable - " 990 "use gnulib module mkstemps for portability"); 991 # endif 992 #endif 993 994 #if 0 995 /* Return an FD open to the master side of a pseudo-terminal. Flags should 996 include O_RDWR, and may also include O_NOCTTY. */ 997 # if !1 998 _GL_FUNCDECL_SYS (posix_openpt, int, (int flags)); 999 # endif 1000 _GL_CXXALIAS_SYS (posix_openpt, int, (int flags)); 1001 _GL_CXXALIASWARN (posix_openpt); 1002 #elif defined GNULIB_POSIXCHECK 1003 # undef posix_openpt 1004 # if HAVE_RAW_DECL_POSIX_OPENPT 1005 _GL_WARN_ON_USE (posix_openpt, "posix_openpt is not portable - " 1006 "use gnulib module posix_openpt for portability"); 1007 # endif 1008 #endif 1009 1010 #if 0 1011 /* Return the pathname of the pseudo-terminal slave associated with 1012 the master FD is open on, or NULL on errors. */ 1013 # if 0 1014 # if !(defined __cplusplus && defined GNULIB_NAMESPACE) 1015 # undef ptsname 1016 # define ptsname rpl_ptsname 1017 # endif 1018 _GL_FUNCDECL_RPL (ptsname, char *, (int fd)); 1019 _GL_CXXALIAS_RPL (ptsname, char *, (int fd)); 1020 # else 1021 # if !1 1022 _GL_FUNCDECL_SYS (ptsname, char *, (int fd)); 1023 # endif 1024 _GL_CXXALIAS_SYS (ptsname, char *, (int fd)); 1025 # endif 1026 _GL_CXXALIASWARN (ptsname); 1027 #elif defined GNULIB_POSIXCHECK 1028 # undef ptsname 1029 # if HAVE_RAW_DECL_PTSNAME 1030 _GL_WARN_ON_USE (ptsname, "ptsname is not portable - " 1031 "use gnulib module ptsname for portability"); 1032 # endif 1033 #endif 1034 1035 #if 0 1036 /* Set the pathname of the pseudo-terminal slave associated with 1037 the master FD is open on and return 0, or set errno and return 1038 non-zero on errors. */ 1039 # if 0 1040 # if !(defined __cplusplus && defined GNULIB_NAMESPACE) 1041 # undef ptsname_r 1042 # define ptsname_r rpl_ptsname_r 1043 # endif 1044 _GL_FUNCDECL_RPL (ptsname_r, int, (int fd, char *buf, size_t len)); 1045 _GL_CXXALIAS_RPL (ptsname_r, int, (int fd, char *buf, size_t len)); 1046 # else 1047 # if !1 1048 _GL_FUNCDECL_SYS (ptsname_r, int, (int fd, char *buf, size_t len)); 1049 # endif 1050 _GL_CXXALIAS_SYS (ptsname_r, int, (int fd, char *buf, size_t len)); 1051 # endif 1052 # ifndef GNULIB_defined_ptsname_r 1053 # define GNULIB_defined_ptsname_r (!1 || 0) 1054 # endif 1055 _GL_CXXALIASWARN (ptsname_r); 1056 #elif defined GNULIB_POSIXCHECK 1057 # undef ptsname_r 1058 # if HAVE_RAW_DECL_PTSNAME_R 1059 _GL_WARN_ON_USE (ptsname_r, "ptsname_r is not portable - " 1060 "use gnulib module ptsname_r for portability"); 1061 # endif 1062 #endif 1063 1064 #if 0 1065 # if 0 1066 # if !(defined __cplusplus && defined GNULIB_NAMESPACE) 1067 # undef putenv 1068 # define putenv rpl_putenv 1069 # endif 1070 _GL_FUNCDECL_RPL (putenv, int, (char *string) _GL_ARG_NONNULL ((1))); 1071 _GL_CXXALIAS_RPL (putenv, int, (char *string)); 1072 # else 1073 _GL_CXXALIAS_SYS (putenv, int, (char *string)); 1074 # endif 1075 _GL_CXXALIASWARN (putenv); 1076 #endif 1077 1078 #if 0 1079 /* Sort an array of NMEMB elements, starting at address BASE, each element 1080 occupying SIZE bytes, in ascending order according to the comparison 1081 function COMPARE. */ 1082 # if 0 1083 # if !(defined __cplusplus && defined GNULIB_NAMESPACE) 1084 # undef qsort_r 1085 # define qsort_r rpl_qsort_r 1086 # endif 1087 _GL_FUNCDECL_RPL (qsort_r, void, (void *base, size_t nmemb, size_t size, 1088 int (*compare) (void const *, void const *, 1089 void *), 1090 void *arg) _GL_ARG_NONNULL ((1, 4))); 1091 _GL_CXXALIAS_RPL (qsort_r, void, (void *base, size_t nmemb, size_t size, 1092 int (*compare) (void const *, void const *, 1093 void *), 1094 void *arg)); 1095 # else 1096 # if !1 1097 _GL_FUNCDECL_SYS (qsort_r, void, (void *base, size_t nmemb, size_t size, 1098 int (*compare) (void const *, void const *, 1099 void *), 1100 void *arg) _GL_ARG_NONNULL ((1, 4))); 1101 # endif 1102 _GL_CXXALIAS_SYS (qsort_r, void, (void *base, size_t nmemb, size_t size, 1103 int (*compare) (void const *, void const *, 1104 void *), 1105 void *arg)); 1106 # endif 1107 _GL_CXXALIASWARN (qsort_r); 1108 #elif defined GNULIB_POSIXCHECK 1109 # undef qsort_r 1110 # if HAVE_RAW_DECL_QSORT_R 1111 _GL_WARN_ON_USE (qsort_r, "qsort_r is not portable - " 1112 "use gnulib module qsort_r for portability"); 1113 # endif 1114 #endif 1115 1116 1117 #if 0 1118 # if !1 1119 # ifndef RAND_MAX 1120 # define RAND_MAX 2147483647 1121 # endif 1122 # endif 1123 #endif 1124 1125 1126 #if 0 1127 # if 0 1128 # if !(defined __cplusplus && defined GNULIB_NAMESPACE) 1129 # undef random 1130 # define random rpl_random 1131 # endif 1132 _GL_FUNCDECL_RPL (random, long, (void)); 1133 _GL_CXXALIAS_RPL (random, long, (void)); 1134 # else 1135 # if !1 1136 _GL_FUNCDECL_SYS (random, long, (void)); 1137 # endif 1138 /* Need to cast, because on Haiku, the return type is 1139 int. */ 1140 _GL_CXXALIAS_SYS_CAST (random, long, (void)); 1141 # endif 1142 _GL_CXXALIASWARN (random); 1143 #elif defined GNULIB_POSIXCHECK 1144 # undef random 1145 # if HAVE_RAW_DECL_RANDOM 1146 _GL_WARN_ON_USE (random, "random is unportable - " 1147 "use gnulib module random for portability"); 1148 # endif 1149 #endif 1150 1151 #if 0 1152 # if 0 1153 # if !(defined __cplusplus && defined GNULIB_NAMESPACE) 1154 # undef srandom 1155 # define srandom rpl_srandom 1156 # endif 1157 _GL_FUNCDECL_RPL (srandom, void, (unsigned int seed)); 1158 _GL_CXXALIAS_RPL (srandom, void, (unsigned int seed)); 1159 # else 1160 # if !1 1161 _GL_FUNCDECL_SYS (srandom, void, (unsigned int seed)); 1162 # endif 1163 /* Need to cast, because on FreeBSD, the first parameter is 1164 unsigned long seed. */ 1165 _GL_CXXALIAS_SYS_CAST (srandom, void, (unsigned int seed)); 1166 # endif 1167 _GL_CXXALIASWARN (srandom); 1168 #elif defined GNULIB_POSIXCHECK 1169 # undef srandom 1170 # if HAVE_RAW_DECL_SRANDOM 1171 _GL_WARN_ON_USE (srandom, "srandom is unportable - " 1172 "use gnulib module random for portability"); 1173 # endif 1174 #endif 1175 1176 #if 0 1177 # if 0 1178 # if !(defined __cplusplus && defined GNULIB_NAMESPACE) 1179 # undef initstate 1180 # define initstate rpl_initstate 1181 # endif 1182 _GL_FUNCDECL_RPL (initstate, char *, 1183 (unsigned int seed, char *buf, size_t buf_size) 1184 _GL_ARG_NONNULL ((2))); 1185 _GL_CXXALIAS_RPL (initstate, char *, 1186 (unsigned int seed, char *buf, size_t buf_size)); 1187 # else 1188 # if !1 || !1 1189 _GL_FUNCDECL_SYS (initstate, char *, 1190 (unsigned int seed, char *buf, size_t buf_size) 1191 _GL_ARG_NONNULL ((2))); 1192 # endif 1193 /* Need to cast, because on FreeBSD, the first parameter is 1194 unsigned long seed. */ 1195 _GL_CXXALIAS_SYS_CAST (initstate, char *, 1196 (unsigned int seed, char *buf, size_t buf_size)); 1197 # endif 1198 _GL_CXXALIASWARN (initstate); 1199 #elif defined GNULIB_POSIXCHECK 1200 # undef initstate 1201 # if HAVE_RAW_DECL_INITSTATE 1202 _GL_WARN_ON_USE (initstate, "initstate is unportable - " 1203 "use gnulib module random for portability"); 1204 # endif 1205 #endif 1206 1207 #if 0 1208 # if 0 1209 # if !(defined __cplusplus && defined GNULIB_NAMESPACE) 1210 # undef setstate 1211 # define setstate rpl_setstate 1212 # endif 1213 _GL_FUNCDECL_RPL (setstate, char *, (char *arg_state) _GL_ARG_NONNULL ((1))); 1214 _GL_CXXALIAS_RPL (setstate, char *, (char *arg_state)); 1215 # else 1216 # if !1 || !1 1217 _GL_FUNCDECL_SYS (setstate, char *, (char *arg_state) _GL_ARG_NONNULL ((1))); 1218 # endif 1219 /* Need to cast, because on Mac OS X 10.13, HP-UX, Solaris the first parameter 1220 is const char *arg_state. */ 1221 _GL_CXXALIAS_SYS_CAST (setstate, char *, (char *arg_state)); 1222 # endif 1223 _GL_CXXALIASWARN (setstate); 1224 #elif defined GNULIB_POSIXCHECK 1225 # undef setstate 1226 # if HAVE_RAW_DECL_SETSTATE 1227 _GL_WARN_ON_USE (setstate, "setstate is unportable - " 1228 "use gnulib module random for portability"); 1229 # endif 1230 #endif 1231 1232 1233 #if 0 1234 # if 0 1235 # if !(defined __cplusplus && defined GNULIB_NAMESPACE) 1236 # undef random_r 1237 # define random_r rpl_random_r 1238 # endif 1239 _GL_FUNCDECL_RPL (random_r, int, (struct random_data *buf, int32_t *result) 1240 _GL_ARG_NONNULL ((1, 2))); 1241 _GL_CXXALIAS_RPL (random_r, int, (struct random_data *buf, int32_t *result)); 1242 # else 1243 # if !1 1244 _GL_FUNCDECL_SYS (random_r, int, (struct random_data *buf, int32_t *result) 1245 _GL_ARG_NONNULL ((1, 2))); 1246 # endif 1247 _GL_CXXALIAS_SYS (random_r, int, (struct random_data *buf, int32_t *result)); 1248 # endif 1249 _GL_CXXALIASWARN (random_r); 1250 #elif defined GNULIB_POSIXCHECK 1251 # undef random_r 1252 # if HAVE_RAW_DECL_RANDOM_R 1253 _GL_WARN_ON_USE (random_r, "random_r is unportable - " 1254 "use gnulib module random_r for portability"); 1255 # endif 1256 #endif 1257 1258 #if 0 1259 # if 0 1260 # if !(defined __cplusplus && defined GNULIB_NAMESPACE) 1261 # undef srandom_r 1262 # define srandom_r rpl_srandom_r 1263 # endif 1264 _GL_FUNCDECL_RPL (srandom_r, int, 1265 (unsigned int seed, struct random_data *rand_state) 1266 _GL_ARG_NONNULL ((2))); 1267 _GL_CXXALIAS_RPL (srandom_r, int, 1268 (unsigned int seed, struct random_data *rand_state)); 1269 # else 1270 # if !1 1271 _GL_FUNCDECL_SYS (srandom_r, int, 1272 (unsigned int seed, struct random_data *rand_state) 1273 _GL_ARG_NONNULL ((2))); 1274 # endif 1275 _GL_CXXALIAS_SYS (srandom_r, int, 1276 (unsigned int seed, struct random_data *rand_state)); 1277 # endif 1278 _GL_CXXALIASWARN (srandom_r); 1279 #elif defined GNULIB_POSIXCHECK 1280 # undef srandom_r 1281 # if HAVE_RAW_DECL_SRANDOM_R 1282 _GL_WARN_ON_USE (srandom_r, "srandom_r is unportable - " 1283 "use gnulib module random_r for portability"); 1284 # endif 1285 #endif 1286 1287 #if 0 1288 # if 0 1289 # if !(defined __cplusplus && defined GNULIB_NAMESPACE) 1290 # undef initstate_r 1291 # define initstate_r rpl_initstate_r 1292 # endif 1293 _GL_FUNCDECL_RPL (initstate_r, int, 1294 (unsigned int seed, char *buf, size_t buf_size, 1295 struct random_data *rand_state) 1296 _GL_ARG_NONNULL ((2, 4))); 1297 _GL_CXXALIAS_RPL (initstate_r, int, 1298 (unsigned int seed, char *buf, size_t buf_size, 1299 struct random_data *rand_state)); 1300 # else 1301 # if !1 1302 _GL_FUNCDECL_SYS (initstate_r, int, 1303 (unsigned int seed, char *buf, size_t buf_size, 1304 struct random_data *rand_state) 1305 _GL_ARG_NONNULL ((2, 4))); 1306 # endif 1307 /* Need to cast, because on Haiku, the third parameter is 1308 unsigned long buf_size. */ 1309 _GL_CXXALIAS_SYS_CAST (initstate_r, int, 1310 (unsigned int seed, char *buf, size_t buf_size, 1311 struct random_data *rand_state)); 1312 # endif 1313 _GL_CXXALIASWARN (initstate_r); 1314 #elif defined GNULIB_POSIXCHECK 1315 # undef initstate_r 1316 # if HAVE_RAW_DECL_INITSTATE_R 1317 _GL_WARN_ON_USE (initstate_r, "initstate_r is unportable - " 1318 "use gnulib module random_r for portability"); 1319 # endif 1320 #endif 1321 1322 #if 0 1323 # if 0 1324 # if !(defined __cplusplus && defined GNULIB_NAMESPACE) 1325 # undef setstate_r 1326 # define setstate_r rpl_setstate_r 1327 # endif 1328 _GL_FUNCDECL_RPL (setstate_r, int, 1329 (char *arg_state, struct random_data *rand_state) 1330 _GL_ARG_NONNULL ((1, 2))); 1331 _GL_CXXALIAS_RPL (setstate_r, int, 1332 (char *arg_state, struct random_data *rand_state)); 1333 # else 1334 # if !1 1335 _GL_FUNCDECL_SYS (setstate_r, int, 1336 (char *arg_state, struct random_data *rand_state) 1337 _GL_ARG_NONNULL ((1, 2))); 1338 # endif 1339 /* Need to cast, because on Haiku, the first parameter is 1340 void *arg_state. */ 1341 _GL_CXXALIAS_SYS_CAST (setstate_r, int, 1342 (char *arg_state, struct random_data *rand_state)); 1343 # endif 1344 _GL_CXXALIASWARN (setstate_r); 1345 #elif defined GNULIB_POSIXCHECK 1346 # undef setstate_r 1347 # if HAVE_RAW_DECL_SETSTATE_R 1348 _GL_WARN_ON_USE (setstate_r, "setstate_r is unportable - " 1349 "use gnulib module random_r for portability"); 1350 # endif 1351 #endif 1352 1353 1354 #if 1 1355 # if 0 1356 # if !((defined __cplusplus && defined GNULIB_NAMESPACE) \ 1357 || _GL_USE_STDLIB_ALLOC) 1358 # undef realloc 1359 # define realloc rpl_realloc 1360 # endif 1361 _GL_FUNCDECL_RPL (realloc, void *, (void *ptr, size_t size)); 1362 _GL_CXXALIAS_RPL (realloc, void *, (void *ptr, size_t size)); 1363 # else 1364 _GL_CXXALIAS_SYS (realloc, void *, (void *ptr, size_t size)); 1365 # endif 1366 # if __GLIBC__ >= 2 1367 _GL_CXXALIASWARN (realloc); 1368 # endif 1369 #elif defined GNULIB_POSIXCHECK && !_GL_USE_STDLIB_ALLOC 1370 # undef realloc 1371 /* Assume realloc is always declared. */ 1372 _GL_WARN_ON_USE (realloc, "realloc is not POSIX compliant everywhere - " 1373 "use gnulib module realloc-posix for portability"); 1374 #endif 1375 1376 1377 #if 0 1378 # if ! 1 1379 _GL_FUNCDECL_SYS (reallocarray, void *, 1380 (void *ptr, size_t nmemb, size_t size)); 1381 # endif 1382 _GL_CXXALIAS_SYS (reallocarray, void *, 1383 (void *ptr, size_t nmemb, size_t size)); 1384 _GL_CXXALIASWARN (reallocarray); 1385 #elif defined GNULIB_POSIXCHECK 1386 # undef reallocarray 1387 # if HAVE_RAW_DECL_REALLOCARRAY 1388 _GL_WARN_ON_USE (reallocarray, "reallocarray is not portable - " 1389 "use gnulib module reallocarray for portability"); 1390 # endif 1391 #endif 1392 1393 #if 1 1394 # if 1 1395 # if !(defined __cplusplus && defined GNULIB_NAMESPACE) 1396 # define realpath rpl_realpath 1397 # endif 1398 _GL_FUNCDECL_RPL (realpath, char *, 1399 (const char *restrict name, char *restrict resolved) 1400 _GL_ARG_NONNULL ((1))); 1401 _GL_CXXALIAS_RPL (realpath, char *, 1402 (const char *restrict name, char *restrict resolved)); 1403 # else 1404 # if !1 1405 _GL_FUNCDECL_SYS (realpath, char *, 1406 (const char *restrict name, char *restrict resolved) 1407 _GL_ARG_NONNULL ((1))); 1408 # endif 1409 _GL_CXXALIAS_SYS (realpath, char *, 1410 (const char *restrict name, char *restrict resolved)); 1411 # endif 1412 _GL_CXXALIASWARN (realpath); 1413 #elif defined GNULIB_POSIXCHECK 1414 # undef realpath 1415 # if HAVE_RAW_DECL_REALPATH 1416 _GL_WARN_ON_USE (realpath, "realpath is unportable - use gnulib module " 1417 "canonicalize or canonicalize-lgpl for portability"); 1418 # endif 1419 #endif 1420 1421 #if 0 1422 /* Test a user response to a question. 1423 Return 1 if it is affirmative, 0 if it is negative, or -1 if not clear. */ 1424 # if !1 1425 _GL_FUNCDECL_SYS (rpmatch, int, (const char *response) _GL_ARG_NONNULL ((1))); 1426 # endif 1427 _GL_CXXALIAS_SYS (rpmatch, int, (const char *response)); 1428 _GL_CXXALIASWARN (rpmatch); 1429 #elif defined GNULIB_POSIXCHECK 1430 # undef rpmatch 1431 # if HAVE_RAW_DECL_RPMATCH 1432 _GL_WARN_ON_USE (rpmatch, "rpmatch is unportable - " 1433 "use gnulib module rpmatch for portability"); 1434 # endif 1435 #endif 1436 1437 #if 0 1438 /* Look up NAME in the environment, returning 0 in insecure situations. */ 1439 # if !1 1440 _GL_FUNCDECL_SYS (secure_getenv, char *, 1441 (char const *name) _GL_ARG_NONNULL ((1))); 1442 # endif 1443 _GL_CXXALIAS_SYS (secure_getenv, char *, (char const *name)); 1444 _GL_CXXALIASWARN (secure_getenv); 1445 #elif defined GNULIB_POSIXCHECK 1446 # undef secure_getenv 1447 # if HAVE_RAW_DECL_SECURE_GETENV 1448 _GL_WARN_ON_USE (secure_getenv, "secure_getenv is unportable - " 1449 "use gnulib module secure_getenv for portability"); 1450 # endif 1451 #endif 1452 1453 #if 1 1454 /* Set NAME to VALUE in the environment. 1455 If REPLACE is nonzero, overwrite an existing value. */ 1456 # if 0 1457 # if !(defined __cplusplus && defined GNULIB_NAMESPACE) 1458 # undef setenv 1459 # define setenv rpl_setenv 1460 # endif 1461 _GL_FUNCDECL_RPL (setenv, int, 1462 (const char *name, const char *value, int replace) 1463 _GL_ARG_NONNULL ((1))); 1464 _GL_CXXALIAS_RPL (setenv, int, 1465 (const char *name, const char *value, int replace)); 1466 # else 1467 # if !1 1468 _GL_FUNCDECL_SYS (setenv, int, 1469 (const char *name, const char *value, int replace) 1470 _GL_ARG_NONNULL ((1))); 1471 # endif 1472 _GL_CXXALIAS_SYS (setenv, int, 1473 (const char *name, const char *value, int replace)); 1474 # endif 1475 # if !(0 && !1) 1476 _GL_CXXALIASWARN (setenv); 1477 # endif 1478 #elif defined GNULIB_POSIXCHECK 1479 # undef setenv 1480 # if HAVE_RAW_DECL_SETENV 1481 _GL_WARN_ON_USE (setenv, "setenv is unportable - " 1482 "use gnulib module setenv for portability"); 1483 # endif 1484 #endif 1485 1486 #if 0 1487 /* Parse a double from STRING, updating ENDP if appropriate. */ 1488 # if 0 1489 # if !(defined __cplusplus && defined GNULIB_NAMESPACE) 1490 # define strtod rpl_strtod 1491 # endif 1492 # define GNULIB_defined_strtod_function 1 1493 _GL_FUNCDECL_RPL (strtod, double, 1494 (const char *restrict str, char **restrict endp) 1495 _GL_ARG_NONNULL ((1))); 1496 _GL_CXXALIAS_RPL (strtod, double, 1497 (const char *restrict str, char **restrict endp)); 1498 # else 1499 # if !1 1500 _GL_FUNCDECL_SYS (strtod, double, 1501 (const char *restrict str, char **restrict endp) 1502 _GL_ARG_NONNULL ((1))); 1503 # endif 1504 _GL_CXXALIAS_SYS (strtod, double, 1505 (const char *restrict str, char **restrict endp)); 1506 # endif 1507 # if __GLIBC__ >= 2 1508 _GL_CXXALIASWARN (strtod); 1509 # endif 1510 #elif defined GNULIB_POSIXCHECK 1511 # undef strtod 1512 # if HAVE_RAW_DECL_STRTOD 1513 _GL_WARN_ON_USE (strtod, "strtod is unportable - " 1514 "use gnulib module strtod for portability"); 1515 # endif 1516 #endif 1517 1518 #if 0 1519 /* Parse a 'long double' from STRING, updating ENDP if appropriate. */ 1520 # if 0 1521 # if !(defined __cplusplus && defined GNULIB_NAMESPACE) 1522 # define strtold rpl_strtold 1523 # endif 1524 # define GNULIB_defined_strtold_function 1 1525 _GL_FUNCDECL_RPL (strtold, long double, 1526 (const char *restrict str, char **restrict endp) 1527 _GL_ARG_NONNULL ((1))); 1528 _GL_CXXALIAS_RPL (strtold, long double, 1529 (const char *restrict str, char **restrict endp)); 1530 # else 1531 # if !1 1532 _GL_FUNCDECL_SYS (strtold, long double, 1533 (const char *restrict str, char **restrict endp) 1534 _GL_ARG_NONNULL ((1))); 1535 # endif 1536 _GL_CXXALIAS_SYS (strtold, long double, 1537 (const char *restrict str, char **restrict endp)); 1538 # endif 1539 _GL_CXXALIASWARN (strtold); 1540 #elif defined GNULIB_POSIXCHECK 1541 # undef strtold 1542 # if HAVE_RAW_DECL_STRTOLD 1543 _GL_WARN_ON_USE (strtold, "strtold is unportable - " 1544 "use gnulib module strtold for portability"); 1545 # endif 1546 #endif 1547 1548 #if 0 1549 /* Parse a signed integer whose textual representation starts at STRING. 1550 The integer is expected to be in base BASE (2 <= BASE <= 36); if BASE == 0, 1551 it may be decimal or octal (with prefix "0") or hexadecimal (with prefix 1552 "0x"). 1553 If ENDPTR is not NULL, the address of the first byte after the integer is 1554 stored in *ENDPTR. 1555 Upon overflow, the return value is LLONG_MAX or LLONG_MIN, and errno is set 1556 to ERANGE. */ 1557 # if !1 1558 _GL_FUNCDECL_SYS (strtoll, long long, 1559 (const char *restrict string, char **restrict endptr, 1560 int base) 1561 _GL_ARG_NONNULL ((1))); 1562 # endif 1563 _GL_CXXALIAS_SYS (strtoll, long long, 1564 (const char *restrict string, char **restrict endptr, 1565 int base)); 1566 _GL_CXXALIASWARN (strtoll); 1567 #elif defined GNULIB_POSIXCHECK 1568 # undef strtoll 1569 # if HAVE_RAW_DECL_STRTOLL 1570 _GL_WARN_ON_USE (strtoll, "strtoll is unportable - " 1571 "use gnulib module strtoll for portability"); 1572 # endif 1573 #endif 1574 1575 #if 0 1576 /* Parse an unsigned integer whose textual representation starts at STRING. 1577 The integer is expected to be in base BASE (2 <= BASE <= 36); if BASE == 0, 1578 it may be decimal or octal (with prefix "0") or hexadecimal (with prefix 1579 "0x"). 1580 If ENDPTR is not NULL, the address of the first byte after the integer is 1581 stored in *ENDPTR. 1582 Upon overflow, the return value is ULLONG_MAX, and errno is set to 1583 ERANGE. */ 1584 # if !1 1585 _GL_FUNCDECL_SYS (strtoull, unsigned long long, 1586 (const char *restrict string, char **restrict endptr, 1587 int base) 1588 _GL_ARG_NONNULL ((1))); 1589 # endif 1590 _GL_CXXALIAS_SYS (strtoull, unsigned long long, 1591 (const char *restrict string, char **restrict endptr, 1592 int base)); 1593 _GL_CXXALIASWARN (strtoull); 1594 #elif defined GNULIB_POSIXCHECK 1595 # undef strtoull 1596 # if HAVE_RAW_DECL_STRTOULL 1597 _GL_WARN_ON_USE (strtoull, "strtoull is unportable - " 1598 "use gnulib module strtoull for portability"); 1599 # endif 1600 #endif 1601 1602 #if 0 1603 /* Unlock the slave side of the pseudo-terminal whose master side is specified 1604 by FD, so that it can be opened. */ 1605 # if !1 1606 _GL_FUNCDECL_SYS (unlockpt, int, (int fd)); 1607 # endif 1608 _GL_CXXALIAS_SYS (unlockpt, int, (int fd)); 1609 _GL_CXXALIASWARN (unlockpt); 1610 #elif defined GNULIB_POSIXCHECK 1611 # undef unlockpt 1612 # if HAVE_RAW_DECL_UNLOCKPT 1613 _GL_WARN_ON_USE (unlockpt, "unlockpt is not portable - " 1614 "use gnulib module unlockpt for portability"); 1615 # endif 1616 #endif 1617 1618 #if 1 1619 /* Remove the variable NAME from the environment. */ 1620 # if 0 1621 # if !(defined __cplusplus && defined GNULIB_NAMESPACE) 1622 # undef unsetenv 1623 # define unsetenv rpl_unsetenv 1624 # endif 1625 _GL_FUNCDECL_RPL (unsetenv, int, (const char *name) _GL_ARG_NONNULL ((1))); 1626 _GL_CXXALIAS_RPL (unsetenv, int, (const char *name)); 1627 # else 1628 # if !1 1629 _GL_FUNCDECL_SYS (unsetenv, int, (const char *name) _GL_ARG_NONNULL ((1))); 1630 # endif 1631 _GL_CXXALIAS_SYS (unsetenv, int, (const char *name)); 1632 # endif 1633 # if !(0 && !1) 1634 _GL_CXXALIASWARN (unsetenv); 1635 # endif 1636 #elif defined GNULIB_POSIXCHECK 1637 # undef unsetenv 1638 # if HAVE_RAW_DECL_UNSETENV 1639 _GL_WARN_ON_USE (unsetenv, "unsetenv is unportable - " 1640 "use gnulib module unsetenv for portability"); 1641 # endif 1642 #endif 1643 1644 /* Convert a wide character to a multibyte character. */ 1645 #if 0 1646 # if 0 1647 # if !(defined __cplusplus && defined GNULIB_NAMESPACE) 1648 # undef wctomb 1649 # define wctomb rpl_wctomb 1650 # endif 1651 _GL_FUNCDECL_RPL (wctomb, int, (char *s, wchar_t wc)); 1652 _GL_CXXALIAS_RPL (wctomb, int, (char *s, wchar_t wc)); 1653 # else 1654 _GL_CXXALIAS_SYS (wctomb, int, (char *s, wchar_t wc)); 1655 # endif 1656 # if __GLIBC__ >= 2 1657 _GL_CXXALIASWARN (wctomb); 1658 # endif 1659 #endif 1660 1661 1662 #endif /* _GL_STDLIB_H */ 1663 #endif /* _GL_STDLIB_H */ 1664 #endif 1665