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/* glob.h -- Find a path matching a pattern. 7 8 Copyright (C) 2005-2007, 2009-2022 Free Software Foundation, Inc. 9 10 Written by Derek Price <derek@ximbiot.com> & Paul Eggert <eggert@CS.UCLA.EDU> 11 12 This file is free software: you can redistribute it and/or modify 13 it under the terms of the GNU Lesser General Public License as 14 published by the Free Software Foundation; either version 2.1 of the 15 License, or (at your option) any later version. 16 17 This file is distributed in the hope that it will be useful, 18 but WITHOUT ANY WARRANTY; without even the implied warranty of 19 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 20 GNU Lesser General Public License for more details. 21 22 You should have received a copy of the GNU Lesser General Public License 23 along with this program. If not, see <https://www.gnu.org/licenses/>. */ 24 25#ifndef _GL_GLOB_H 26 27#if __GNUC__ >= 3 28#pragma GCC system_header 29#endif 30 31 32/* The include_next requires a split double-inclusion guard. */ 33#if 1 && !1 34# include_next <glob.h> 35#endif 36 37#ifndef _GL_GLOB_H 38#define _GL_GLOB_H 39 40/* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */ 41/* C++ compatible function declaration macros. 42 Copyright (C) 2010-2022 Free Software Foundation, Inc. 43 44 This program is free software: you can redistribute it and/or modify it 45 under the terms of the GNU Lesser General Public License as published 46 by the Free Software Foundation; either version 2 of the License, or 47 (at your option) any later version. 48 49 This program is distributed in the hope that it will be useful, 50 but WITHOUT ANY WARRANTY; without even the implied warranty of 51 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 52 Lesser General Public License for more details. 53 54 You should have received a copy of the GNU Lesser General Public License 55 along with this program. If not, see <https://www.gnu.org/licenses/>. */ 56 57#ifndef _GL_CXXDEFS_H 58#define _GL_CXXDEFS_H 59 60/* Begin/end the GNULIB_NAMESPACE namespace. */ 61#if defined __cplusplus && defined GNULIB_NAMESPACE 62# define _GL_BEGIN_NAMESPACE namespace GNULIB_NAMESPACE { 63# define _GL_END_NAMESPACE } 64#else 65# define _GL_BEGIN_NAMESPACE 66# define _GL_END_NAMESPACE 67#endif 68 69/* The three most frequent use cases of these macros are: 70 71 * For providing a substitute for a function that is missing on some 72 platforms, but is declared and works fine on the platforms on which 73 it exists: 74 75 #if @GNULIB_FOO@ 76 # if !@HAVE_FOO@ 77 _GL_FUNCDECL_SYS (foo, ...); 78 # endif 79 _GL_CXXALIAS_SYS (foo, ...); 80 _GL_CXXALIASWARN (foo); 81 #elif defined GNULIB_POSIXCHECK 82 ... 83 #endif 84 85 * For providing a replacement for a function that exists on all platforms, 86 but is broken/insufficient and needs to be replaced on some platforms: 87 88 #if @GNULIB_FOO@ 89 # if @REPLACE_FOO@ 90 # if !(defined __cplusplus && defined GNULIB_NAMESPACE) 91 # undef foo 92 # define foo rpl_foo 93 # endif 94 _GL_FUNCDECL_RPL (foo, ...); 95 _GL_CXXALIAS_RPL (foo, ...); 96 # else 97 _GL_CXXALIAS_SYS (foo, ...); 98 # endif 99 _GL_CXXALIASWARN (foo); 100 #elif defined GNULIB_POSIXCHECK 101 ... 102 #endif 103 104 * For providing a replacement for a function that exists on some platforms 105 but is broken/insufficient and needs to be replaced on some of them and 106 is additionally either missing or undeclared on some other 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 # if !@HAVE_FOO@ or if !@HAVE_DECL_FOO@ 118 _GL_FUNCDECL_SYS (foo, ...); 119 # endif 120 _GL_CXXALIAS_SYS (foo, ...); 121 # endif 122 _GL_CXXALIASWARN (foo); 123 #elif defined GNULIB_POSIXCHECK 124 ... 125 #endif 126*/ 127 128/* _GL_EXTERN_C declaration; 129 performs the declaration with C linkage. */ 130#if defined __cplusplus 131# define _GL_EXTERN_C extern "C" 132#else 133# define _GL_EXTERN_C extern 134#endif 135 136/* _GL_FUNCDECL_RPL (func, rettype, parameters_and_attributes); 137 declares a replacement function, named rpl_func, with the given prototype, 138 consisting of return type, parameters, and attributes. 139 Example: 140 _GL_FUNCDECL_RPL (open, int, (const char *filename, int flags, ...) 141 _GL_ARG_NONNULL ((1))); 142 */ 143#define _GL_FUNCDECL_RPL(func,rettype,parameters_and_attributes) \ 144 _GL_FUNCDECL_RPL_1 (rpl_##func, rettype, parameters_and_attributes) 145#define _GL_FUNCDECL_RPL_1(rpl_func,rettype,parameters_and_attributes) \ 146 _GL_EXTERN_C rettype rpl_func parameters_and_attributes 147 148/* _GL_FUNCDECL_SYS (func, rettype, parameters_and_attributes); 149 declares the system function, named func, with the given prototype, 150 consisting of return type, parameters, and attributes. 151 Example: 152 _GL_FUNCDECL_SYS (open, int, (const char *filename, int flags, ...) 153 _GL_ARG_NONNULL ((1))); 154 */ 155#define _GL_FUNCDECL_SYS(func,rettype,parameters_and_attributes) \ 156 _GL_EXTERN_C rettype func parameters_and_attributes 157 158/* _GL_CXXALIAS_RPL (func, rettype, parameters); 159 declares a C++ alias called GNULIB_NAMESPACE::func 160 that redirects to rpl_func, if GNULIB_NAMESPACE is defined. 161 Example: 162 _GL_CXXALIAS_RPL (open, int, (const char *filename, int flags, ...)); 163 164 Wrapping rpl_func in an object with an inline conversion operator 165 avoids a reference to rpl_func unless GNULIB_NAMESPACE::func is 166 actually used in the program. */ 167#define _GL_CXXALIAS_RPL(func,rettype,parameters) \ 168 _GL_CXXALIAS_RPL_1 (func, rpl_##func, rettype, parameters) 169#if defined __cplusplus && defined GNULIB_NAMESPACE 170# define _GL_CXXALIAS_RPL_1(func,rpl_func,rettype,parameters) \ 171 namespace GNULIB_NAMESPACE \ 172 { \ 173 static const struct _gl_ ## func ## _wrapper \ 174 { \ 175 typedef rettype (*type) parameters; \ 176 \ 177 inline operator type () const \ 178 { \ 179 return ::rpl_func; \ 180 } \ 181 } func = {}; \ 182 } \ 183 _GL_EXTERN_C int _gl_cxxalias_dummy 184#else 185# define _GL_CXXALIAS_RPL_1(func,rpl_func,rettype,parameters) \ 186 _GL_EXTERN_C int _gl_cxxalias_dummy 187#endif 188 189/* _GL_CXXALIAS_MDA (func, rettype, parameters); 190 is to be used when func is a Microsoft deprecated alias, on native Windows. 191 It declares a C++ alias called GNULIB_NAMESPACE::func 192 that redirects to _func, if GNULIB_NAMESPACE is defined. 193 Example: 194 _GL_CXXALIAS_MDA (open, int, (const char *filename, int flags, ...)); 195 */ 196#define _GL_CXXALIAS_MDA(func,rettype,parameters) \ 197 _GL_CXXALIAS_RPL_1 (func, _##func, rettype, parameters) 198 199/* _GL_CXXALIAS_RPL_CAST_1 (func, rpl_func, rettype, parameters); 200 is like _GL_CXXALIAS_RPL_1 (func, rpl_func, rettype, parameters); 201 except that the C function rpl_func may have a slightly different 202 declaration. A cast is used to silence the "invalid conversion" error 203 that would otherwise occur. */ 204#if defined __cplusplus && defined GNULIB_NAMESPACE 205# define _GL_CXXALIAS_RPL_CAST_1(func,rpl_func,rettype,parameters) \ 206 namespace GNULIB_NAMESPACE \ 207 { \ 208 static const struct _gl_ ## func ## _wrapper \ 209 { \ 210 typedef rettype (*type) parameters; \ 211 \ 212 inline operator type () const \ 213 { \ 214 return reinterpret_cast<type>(::rpl_func); \ 215 } \ 216 } func = {}; \ 217 } \ 218 _GL_EXTERN_C int _gl_cxxalias_dummy 219#else 220# define _GL_CXXALIAS_RPL_CAST_1(func,rpl_func,rettype,parameters) \ 221 _GL_EXTERN_C int _gl_cxxalias_dummy 222#endif 223 224/* _GL_CXXALIAS_MDA_CAST (func, rettype, parameters); 225 is like _GL_CXXALIAS_MDA (func, rettype, parameters); 226 except that the C function func may have a slightly different declaration. 227 A cast is used to silence the "invalid conversion" error that would 228 otherwise occur. */ 229#define _GL_CXXALIAS_MDA_CAST(func,rettype,parameters) \ 230 _GL_CXXALIAS_RPL_CAST_1 (func, _##func, rettype, parameters) 231 232/* _GL_CXXALIAS_SYS (func, rettype, parameters); 233 declares a C++ alias called GNULIB_NAMESPACE::func 234 that redirects to the system provided function func, if GNULIB_NAMESPACE 235 is defined. 236 Example: 237 _GL_CXXALIAS_SYS (open, int, (const char *filename, int flags, ...)); 238 239 Wrapping func in an object with an inline conversion operator 240 avoids a reference to func unless GNULIB_NAMESPACE::func is 241 actually used in the program. */ 242#if defined __cplusplus && defined GNULIB_NAMESPACE 243# define _GL_CXXALIAS_SYS(func,rettype,parameters) \ 244 namespace GNULIB_NAMESPACE \ 245 { \ 246 static const struct _gl_ ## func ## _wrapper \ 247 { \ 248 typedef rettype (*type) parameters; \ 249 \ 250 inline operator type () const \ 251 { \ 252 return ::func; \ 253 } \ 254 } func = {}; \ 255 } \ 256 _GL_EXTERN_C int _gl_cxxalias_dummy 257#else 258# define _GL_CXXALIAS_SYS(func,rettype,parameters) \ 259 _GL_EXTERN_C int _gl_cxxalias_dummy 260#endif 261 262/* _GL_CXXALIAS_SYS_CAST (func, rettype, parameters); 263 is like _GL_CXXALIAS_SYS (func, rettype, parameters); 264 except that the C function func may have a slightly different declaration. 265 A cast is used to silence the "invalid conversion" error that would 266 otherwise occur. */ 267#if defined __cplusplus && defined GNULIB_NAMESPACE 268# define _GL_CXXALIAS_SYS_CAST(func,rettype,parameters) \ 269 namespace GNULIB_NAMESPACE \ 270 { \ 271 static const struct _gl_ ## func ## _wrapper \ 272 { \ 273 typedef rettype (*type) parameters; \ 274 \ 275 inline operator type () const \ 276 { \ 277 return reinterpret_cast<type>(::func); \ 278 } \ 279 } func = {}; \ 280 } \ 281 _GL_EXTERN_C int _gl_cxxalias_dummy 282#else 283# define _GL_CXXALIAS_SYS_CAST(func,rettype,parameters) \ 284 _GL_EXTERN_C int _gl_cxxalias_dummy 285#endif 286 287/* _GL_CXXALIAS_SYS_CAST2 (func, rettype, parameters, rettype2, parameters2); 288 is like _GL_CXXALIAS_SYS (func, rettype, parameters); 289 except that the C function is picked among a set of overloaded functions, 290 namely the one with rettype2 and parameters2. Two consecutive casts 291 are used to silence the "cannot find a match" and "invalid conversion" 292 errors that would otherwise occur. */ 293#if defined __cplusplus && defined GNULIB_NAMESPACE 294 /* The outer cast must be a reinterpret_cast. 295 The inner cast: When the function is defined as a set of overloaded 296 functions, it works as a static_cast<>, choosing the designated variant. 297 When the function is defined as a single variant, it works as a 298 reinterpret_cast<>. The parenthesized cast syntax works both ways. */ 299# define _GL_CXXALIAS_SYS_CAST2(func,rettype,parameters,rettype2,parameters2) \ 300 namespace GNULIB_NAMESPACE \ 301 { \ 302 static const struct _gl_ ## func ## _wrapper \ 303 { \ 304 typedef rettype (*type) parameters; \ 305 \ 306 inline operator type () const \ 307 { \ 308 return reinterpret_cast<type>((rettype2 (*) parameters2)(::func)); \ 309 } \ 310 } func = {}; \ 311 } \ 312 _GL_EXTERN_C int _gl_cxxalias_dummy 313#else 314# define _GL_CXXALIAS_SYS_CAST2(func,rettype,parameters,rettype2,parameters2) \ 315 _GL_EXTERN_C int _gl_cxxalias_dummy 316#endif 317 318/* _GL_CXXALIASWARN (func); 319 causes a warning to be emitted when ::func is used but not when 320 GNULIB_NAMESPACE::func is used. func must be defined without overloaded 321 variants. */ 322#if defined __cplusplus && defined GNULIB_NAMESPACE 323# define _GL_CXXALIASWARN(func) \ 324 _GL_CXXALIASWARN_1 (func, GNULIB_NAMESPACE) 325# define _GL_CXXALIASWARN_1(func,namespace) \ 326 _GL_CXXALIASWARN_2 (func, namespace) 327/* To work around GCC bug <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=43881>, 328 we enable the warning only when not optimizing. */ 329# if !(defined __GNUC__ && !defined __clang__ && __OPTIMIZE__) 330# define _GL_CXXALIASWARN_2(func,namespace) \ 331 _GL_WARN_ON_USE (func, \ 332 "The symbol ::" #func " refers to the system function. " \ 333 "Use " #namespace "::" #func " instead.") 334# elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING 335# define _GL_CXXALIASWARN_2(func,namespace) \ 336 extern __typeof__ (func) func 337# else 338# define _GL_CXXALIASWARN_2(func,namespace) \ 339 _GL_EXTERN_C int _gl_cxxalias_dummy 340# endif 341#else 342# define _GL_CXXALIASWARN(func) \ 343 _GL_EXTERN_C int _gl_cxxalias_dummy 344#endif 345 346/* _GL_CXXALIASWARN1 (func, rettype, parameters_and_attributes); 347 causes a warning to be emitted when the given overloaded variant of ::func 348 is used but not when GNULIB_NAMESPACE::func is used. */ 349#if defined __cplusplus && defined GNULIB_NAMESPACE 350# define _GL_CXXALIASWARN1(func,rettype,parameters_and_attributes) \ 351 _GL_CXXALIASWARN1_1 (func, rettype, parameters_and_attributes, \ 352 GNULIB_NAMESPACE) 353# define _GL_CXXALIASWARN1_1(func,rettype,parameters_and_attributes,namespace) \ 354 _GL_CXXALIASWARN1_2 (func, rettype, parameters_and_attributes, namespace) 355/* To work around GCC bug <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=43881>, 356 we enable the warning only when not optimizing. */ 357# if !(defined __GNUC__ && !defined __clang__ && __OPTIMIZE__) 358# define _GL_CXXALIASWARN1_2(func,rettype,parameters_and_attributes,namespace) \ 359 _GL_WARN_ON_USE_CXX (func, rettype, rettype, parameters_and_attributes, \ 360 "The symbol ::" #func " refers to the system function. " \ 361 "Use " #namespace "::" #func " instead.") 362# else 363# define _GL_CXXALIASWARN1_2(func,rettype,parameters_and_attributes,namespace) \ 364 _GL_EXTERN_C int _gl_cxxalias_dummy 365# endif 366#else 367# define _GL_CXXALIASWARN1(func,rettype,parameters_and_attributes) \ 368 _GL_EXTERN_C int _gl_cxxalias_dummy 369#endif 370 371#endif /* _GL_CXXDEFS_H */ 372 373/* The definition of _GL_ARG_NONNULL is copied here. */ 374/* A C macro for declaring that specific arguments must not be NULL. 375 Copyright (C) 2009-2022 Free Software Foundation, Inc. 376 377 This program is free software: you can redistribute it and/or modify it 378 under the terms of the GNU Lesser General Public License as published 379 by the Free Software Foundation; either version 2 of the License, or 380 (at your option) any later version. 381 382 This program is distributed in the hope that it will be useful, 383 but WITHOUT ANY WARRANTY; without even the implied warranty of 384 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 385 Lesser General Public License for more details. 386 387 You should have received a copy of the GNU Lesser General Public License 388 along with this program. If not, see <https://www.gnu.org/licenses/>. */ 389 390/* _GL_ARG_NONNULL((n,...,m)) tells the compiler and static analyzer tools 391 that the values passed as arguments n, ..., m must be non-NULL pointers. 392 n = 1 stands for the first argument, n = 2 for the second argument etc. */ 393#ifndef _GL_ARG_NONNULL 394# if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3) || defined __clang__ 395# define _GL_ARG_NONNULL(params) __attribute__ ((__nonnull__ params)) 396# else 397# define _GL_ARG_NONNULL(params) 398# endif 399#endif 400 401/* The definition of _GL_WARN_ON_USE is copied here. */ 402/* A C macro for emitting warnings if a function is used. 403 Copyright (C) 2010-2022 Free Software Foundation, Inc. 404 405 This program is free software: you can redistribute it and/or modify it 406 under the terms of the GNU Lesser General Public License as published 407 by the Free Software Foundation; either version 2 of the License, or 408 (at your option) any later version. 409 410 This program is distributed in the hope that it will be useful, 411 but WITHOUT ANY WARRANTY; without even the implied warranty of 412 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 413 Lesser General Public License for more details. 414 415 You should have received a copy of the GNU Lesser General Public License 416 along with this program. If not, see <https://www.gnu.org/licenses/>. */ 417 418/* _GL_WARN_ON_USE (function, "literal string") issues a declaration 419 for FUNCTION which will then trigger a compiler warning containing 420 the text of "literal string" anywhere that function is called, if 421 supported by the compiler. If the compiler does not support this 422 feature, the macro expands to an unused extern declaration. 423 424 _GL_WARN_ON_USE_ATTRIBUTE ("literal string") expands to the 425 attribute used in _GL_WARN_ON_USE. If the compiler does not support 426 this feature, it expands to empty. 427 428 These macros are useful for marking a function as a potential 429 portability trap, with the intent that "literal string" include 430 instructions on the replacement function that should be used 431 instead. 432 _GL_WARN_ON_USE is for functions with 'extern' linkage. 433 _GL_WARN_ON_USE_ATTRIBUTE is for functions with 'static' or 'inline' 434 linkage. 435 436 However, one of the reasons that a function is a portability trap is 437 if it has the wrong signature. Declaring FUNCTION with a different 438 signature in C is a compilation error, so this macro must use the 439 same type as any existing declaration so that programs that avoid 440 the problematic FUNCTION do not fail to compile merely because they 441 included a header that poisoned the function. But this implies that 442 _GL_WARN_ON_USE is only safe to use if FUNCTION is known to already 443 have a declaration. Use of this macro implies that there must not 444 be any other macro hiding the declaration of FUNCTION; but 445 undefining FUNCTION first is part of the poisoning process anyway 446 (although for symbols that are provided only via a macro, the result 447 is a compilation error rather than a warning containing 448 "literal string"). Also note that in C++, it is only safe to use if 449 FUNCTION has no overloads. 450 451 For an example, it is possible to poison 'getline' by: 452 - adding a call to gl_WARN_ON_USE_PREPARE([[#include <stdio.h>]], 453 [getline]) in configure.ac, which potentially defines 454 HAVE_RAW_DECL_GETLINE 455 - adding this code to a header that wraps the system <stdio.h>: 456 #undef getline 457 #if HAVE_RAW_DECL_GETLINE 458 _GL_WARN_ON_USE (getline, "getline is required by POSIX 2008, but" 459 "not universally present; use the gnulib module getline"); 460 #endif 461 462 It is not possible to directly poison global variables. But it is 463 possible to write a wrapper accessor function, and poison that 464 (less common usage, like &environ, will cause a compilation error 465 rather than issue the nice warning, but the end result of informing 466 the developer about their portability problem is still achieved): 467 #if HAVE_RAW_DECL_ENVIRON 468 static char *** 469 rpl_environ (void) { return &environ; } 470 _GL_WARN_ON_USE (rpl_environ, "environ is not always properly declared"); 471 # undef environ 472 # define environ (*rpl_environ ()) 473 #endif 474 or better (avoiding contradictory use of 'static' and 'extern'): 475 #if HAVE_RAW_DECL_ENVIRON 476 static char *** 477 _GL_WARN_ON_USE_ATTRIBUTE ("environ is not always properly declared") 478 rpl_environ (void) { return &environ; } 479 # undef environ 480 # define environ (*rpl_environ ()) 481 #endif 482 */ 483#ifndef _GL_WARN_ON_USE 484 485# if 4 < __GNUC__ || (__GNUC__ == 4 && 3 <= __GNUC_MINOR__) 486/* A compiler attribute is available in gcc versions 4.3.0 and later. */ 487# define _GL_WARN_ON_USE(function, message) \ 488_GL_WARN_EXTERN_C __typeof__ (function) function __attribute__ ((__warning__ (message))) 489# define _GL_WARN_ON_USE_ATTRIBUTE(message) \ 490 __attribute__ ((__warning__ (message))) 491# elif __clang_major__ >= 4 492/* Another compiler attribute is available in clang. */ 493# define _GL_WARN_ON_USE(function, message) \ 494_GL_WARN_EXTERN_C __typeof__ (function) function \ 495 __attribute__ ((__diagnose_if__ (1, message, "warning"))) 496# define _GL_WARN_ON_USE_ATTRIBUTE(message) \ 497 __attribute__ ((__diagnose_if__ (1, message, "warning"))) 498# elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING 499/* Verify the existence of the function. */ 500# define _GL_WARN_ON_USE(function, message) \ 501_GL_WARN_EXTERN_C __typeof__ (function) function 502# define _GL_WARN_ON_USE_ATTRIBUTE(message) 503# else /* Unsupported. */ 504# define _GL_WARN_ON_USE(function, message) \ 505_GL_WARN_EXTERN_C int _gl_warn_on_use 506# define _GL_WARN_ON_USE_ATTRIBUTE(message) 507# endif 508#endif 509 510/* _GL_WARN_ON_USE_CXX (function, rettype_gcc, rettype_clang, parameters_and_attributes, "message") 511 is like _GL_WARN_ON_USE (function, "message"), except that in C++ mode the 512 function is declared with the given prototype, consisting of return type, 513 parameters, and attributes. 514 This variant is useful for overloaded functions in C++. _GL_WARN_ON_USE does 515 not work in this case. */ 516#ifndef _GL_WARN_ON_USE_CXX 517# if !defined __cplusplus 518# define _GL_WARN_ON_USE_CXX(function,rettype_gcc,rettype_clang,parameters_and_attributes,msg) \ 519 _GL_WARN_ON_USE (function, msg) 520# else 521# if 4 < __GNUC__ || (__GNUC__ == 4 && 3 <= __GNUC_MINOR__) 522/* A compiler attribute is available in gcc versions 4.3.0 and later. */ 523# define _GL_WARN_ON_USE_CXX(function,rettype_gcc,rettype_clang,parameters_and_attributes,msg) \ 524extern rettype_gcc function parameters_and_attributes \ 525 __attribute__ ((__warning__ (msg))) 526# elif __clang_major__ >= 4 527/* Another compiler attribute is available in clang. */ 528# define _GL_WARN_ON_USE_CXX(function,rettype_gcc,rettype_clang,parameters_and_attributes,msg) \ 529extern rettype_clang function parameters_and_attributes \ 530 __attribute__ ((__diagnose_if__ (1, msg, "warning"))) 531# elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING 532/* Verify the existence of the function. */ 533# define _GL_WARN_ON_USE_CXX(function,rettype_gcc,rettype_clang,parameters_and_attributes,msg) \ 534extern rettype_gcc function parameters_and_attributes 535# else /* Unsupported. */ 536# define _GL_WARN_ON_USE_CXX(function,rettype_gcc,rettype_clang,parameters_and_attributes,msg) \ 537_GL_WARN_EXTERN_C int _gl_warn_on_use 538# endif 539# endif 540#endif 541 542/* _GL_WARN_EXTERN_C declaration; 543 performs the declaration with C linkage. */ 544#ifndef _GL_WARN_EXTERN_C 545# if defined __cplusplus 546# define _GL_WARN_EXTERN_C extern "C" 547# else 548# define _GL_WARN_EXTERN_C extern 549# endif 550#endif 551 552/* For plain 'restrict', use glibc's __restrict if defined. 553 Otherwise, GCC 2.95 and later have "__restrict"; C99 compilers have 554 "restrict", and "configure" may have defined "restrict". 555 Other compilers use __restrict, __restrict__, and _Restrict, and 556 'configure' might #define 'restrict' to those words, so pick a 557 different name. */ 558#ifndef _Restrict_ 559# if defined __restrict \ 560 || 2 < __GNUC__ + (95 <= __GNUC_MINOR__) \ 561 || __clang_major__ >= 3 562# define _Restrict_ __restrict 563# elif 199901L <= __STDC_VERSION__ || defined restrict 564# define _Restrict_ restrict 565# else 566# define _Restrict_ 567# endif 568#endif 569 570#ifdef __cplusplus 571extern "C" { 572#endif 573typedef int (*_gl_glob_errfunc_fn) (const char *, int); 574#ifdef __cplusplus 575} 576#endif 577 578 579#if !1 || 1 580 581 582/* Preparations for including the standard GNU C Library header. */ 583 584# include <stddef.h> 585 586/* On some systems, such as AIX 5.1, <sys/stat.h> does a "#define stat stat64". 587 Make sure this definition is seen before glob-libc.h defines types that 588 rely on 'struct stat'. */ 589# include <sys/stat.h> 590 591# if 1 592# if !(defined __cplusplus && defined GNULIB_NAMESPACE) 593# define glob rpl_glob 594# define globfree rpl_globfree 595# endif 596# endif 597# if 1 598# if !(defined __cplusplus && defined GNULIB_NAMESPACE) 599# define glob_pattern_p rpl_glob_pattern_p 600# endif 601# endif 602# define __glob_pattern_p glob_pattern_p 603 604# define __GLOB_GNULIB 1 605 606 607/* Now the standard GNU C Library header should work. */ 608# include "glob-libc.gl.h" 609 610 611#endif 612 613 614#if 1 615# if 1 616_GL_FUNCDECL_RPL (glob, int, (const char *_Restrict_ __pattern, int __flags, 617 _gl_glob_errfunc_fn __errfunc, 618 glob_t *_Restrict_ __pglob) 619 _GL_ARG_NONNULL ((1))); 620_GL_CXXALIAS_RPL (glob, int, (const char *_Restrict_ __pattern, int __flags, 621 _gl_glob_errfunc_fn __errfunc, 622 glob_t *_Restrict_ __pglob)); 623# else 624# if !1 625_GL_FUNCDECL_SYS (glob, int, (const char *_Restrict_ __pattern, int __flags, 626 _gl_glob_errfunc_fn __errfunc, 627 glob_t *_Restrict_ __pglob) 628 _GL_ARG_NONNULL ((1))); 629# endif 630_GL_CXXALIAS_SYS (glob, int, (const char *_Restrict_ __pattern, int __flags, 631 _gl_glob_errfunc_fn __errfunc, 632 glob_t *_Restrict_ __pglob)); 633# endif 634_GL_CXXALIASWARN (glob); 635#elif defined GNULIB_POSIXCHECK 636# undef glob 637# if HAVE_RAW_DECL_GLOB 638_GL_WARN_ON_USE (glob, 639 "glob is unportable - " 640 "use gnulib module glob for portability"); 641# endif 642#endif 643 644#if 1 645# if 1 646_GL_FUNCDECL_RPL (globfree, void, (glob_t *__pglob) _GL_ARG_NONNULL ((1))); 647_GL_CXXALIAS_RPL (globfree, void, (glob_t *__pglob)); 648# else 649# if !1 650_GL_FUNCDECL_SYS (globfree, void, (glob_t *__pglob) _GL_ARG_NONNULL ((1))); 651# endif 652_GL_CXXALIAS_SYS (globfree, void, (glob_t *__pglob)); 653# endif 654_GL_CXXALIASWARN (globfree); 655#elif defined GNULIB_POSIXCHECK 656# undef globfree 657# if HAVE_RAW_DECL_GLOBFREE 658_GL_WARN_ON_USE (globfree, 659 "globfree is unportable - " 660 "use gnulib module glob for portability"); 661# endif 662#endif 663 664#if 1 665# if 1 666_GL_FUNCDECL_RPL (glob_pattern_p, int, (const char *__pattern, int __quote) 667 _GL_ARG_NONNULL ((1))); 668_GL_CXXALIAS_RPL (glob_pattern_p, int, (const char *__pattern, int __quote)); 669# else 670# if !1 671_GL_FUNCDECL_SYS (glob_pattern_p, int, (const char *__pattern, int __quote) 672 _GL_ARG_NONNULL ((1))); 673# endif 674_GL_CXXALIAS_SYS (glob_pattern_p, int, (const char *__pattern, int __quote)); 675# endif 676_GL_CXXALIASWARN (glob_pattern_p); 677#elif defined GNULIB_POSIXCHECK 678# undef glob_pattern_p 679# if HAVE_RAW_DECL_GLOB_PATTERN_P 680_GL_WARN_ON_USE (glob_pattern_p, 681 "glob_pattern_p is unportable - " 682 "use gnulib module glob for portability"); 683# endif 684#endif 685 686 687#endif /* _GL_GLOB_H */ 688#endif /* _GL_GLOB_H */ 689