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