Home | History | Annotate | Line # | Download | only in import
      1 /* This file is automatically generated.  DO NOT EDIT! */
      2 /* Generated from: NetBSD: mknative-gdb,v 1.16 2023/07/31 17:09:59 christos Exp  */
      3 /* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp  */
      4 
      5 /* DO NOT EDIT! GENERATED AUTOMATICALLY! */
      6 /* A GNU-like <signal.h>.
      7 
      8    Copyright (C) 2006-2022 Free Software Foundation, Inc.
      9 
     10    This file is free software: you can redistribute it and/or modify
     11    it under the terms of the GNU Lesser General Public License as
     12    published by the Free Software Foundation; either version 2.1 of the
     13    License, or (at your option) any later version.
     14 
     15    This file 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 Lesser General Public License for more details.
     19 
     20    You should have received a copy of the GNU Lesser 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_sig_atomic_t || defined __need_sigset_t || defined _GL_ALREADY_INCLUDING_SIGNAL_H || (defined _SIGNAL_H && !defined __SIZEOF_PTHREAD_MUTEX_T)
     29 /* Special invocation convention:
     30    - Inside glibc header files.
     31    - On glibc systems we have a sequence of nested includes
     32      <signal.h> -> <ucontext.h> -> <signal.h>.
     33      In this situation, the functions are not yet declared, therefore we cannot
     34      provide the C++ aliases.
     35    - On glibc systems with GCC 4.3 we have a sequence of nested includes
     36      <csignal> -> </usr/include/signal.h> -> <sys/ucontext.h> -> <signal.h>.
     37      In this situation, some of the functions are not yet declared, therefore
     38      we cannot provide the C++ aliases.  */
     39 
     40 # include_next <signal.h>
     41 
     42 #else
     43 /* Normal invocation convention.  */
     44 
     45 #ifndef _GL_SIGNAL_H
     46 
     47 #define _GL_ALREADY_INCLUDING_SIGNAL_H
     48 
     49 /* Define pid_t, uid_t.
     50    Also, mingw defines sigset_t not in <signal.h>, but in <sys/types.h>.
     51    On Solaris 10, <signal.h> includes <sys/types.h>, which eventually includes
     52    us; so include <sys/types.h> now, before the second inclusion guard.  */
     53 #include <sys/types.h>
     54 
     55 /* The include_next requires a split double-inclusion guard.  */
     56 #include_next <signal.h>
     57 
     58 #undef _GL_ALREADY_INCLUDING_SIGNAL_H
     59 
     60 #ifndef _GL_SIGNAL_H
     61 #define _GL_SIGNAL_H
     62 
     63 /* Mac OS X 10.3, FreeBSD 6.4, OpenBSD 3.8, OSF/1 4.0, Solaris 2.6, Android,
     64    OS/2 kLIBC declare pthread_sigmask in <pthread.h>, not in <signal.h>.
     65    But avoid namespace pollution on glibc systems.*/
     66 #if (0 || defined GNULIB_POSIXCHECK) \
     67     && ((defined __APPLE__ && defined __MACH__) \
     68         || defined __FreeBSD__ || defined __OpenBSD__ || defined __osf__ \
     69         || defined __sun || defined __ANDROID__ || defined __KLIBC__) \
     70     && ! defined __GLIBC__
     71 # include <pthread.h>
     72 #endif
     73 
     74 /* The definitions of _GL_FUNCDECL_RPL etc. are copied here.  */
     75 /* C++ compatible function declaration macros.
     76    Copyright (C) 2010-2022 Free Software Foundation, Inc.
     77 
     78    This program is free software: you can redistribute it and/or modify it
     79    under the terms of the GNU Lesser General Public License as published
     80    by the Free Software Foundation; either version 2 of the License, or
     81    (at your option) any later version.
     82 
     83    This program is distributed in the hope that it will be useful,
     84    but WITHOUT ANY WARRANTY; without even the implied warranty of
     85    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
     86    Lesser General Public License for more details.
     87 
     88    You should have received a copy of the GNU Lesser General Public License
     89    along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
     90 
     91 #ifndef _GL_CXXDEFS_H
     92 #define _GL_CXXDEFS_H
     93 
     94 /* Begin/end the GNULIB_NAMESPACE namespace.  */
     95 #if defined __cplusplus && defined GNULIB_NAMESPACE
     96 # define _GL_BEGIN_NAMESPACE namespace GNULIB_NAMESPACE {
     97 # define _GL_END_NAMESPACE }
     98 #else
     99 # define _GL_BEGIN_NAMESPACE
    100 # define _GL_END_NAMESPACE
    101 #endif
    102 
    103 /* The three most frequent use cases of these macros are:
    104 
    105    * For providing a substitute for a function that is missing on some
    106      platforms, but is declared and works fine on the platforms on which
    107      it exists:
    108 
    109        #if @GNULIB_FOO@
    110        # if !@HAVE_FOO@
    111        _GL_FUNCDECL_SYS (foo, ...);
    112        # endif
    113        _GL_CXXALIAS_SYS (foo, ...);
    114        _GL_CXXALIASWARN (foo);
    115        #elif defined GNULIB_POSIXCHECK
    116        ...
    117        #endif
    118 
    119    * For providing a replacement for a function that exists on all platforms,
    120      but is broken/insufficient and needs to be replaced on some platforms:
    121 
    122        #if @GNULIB_FOO@
    123        # if @REPLACE_FOO@
    124        #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
    125        #   undef foo
    126        #   define foo rpl_foo
    127        #  endif
    128        _GL_FUNCDECL_RPL (foo, ...);
    129        _GL_CXXALIAS_RPL (foo, ...);
    130        # else
    131        _GL_CXXALIAS_SYS (foo, ...);
    132        # endif
    133        _GL_CXXALIASWARN (foo);
    134        #elif defined GNULIB_POSIXCHECK
    135        ...
    136        #endif
    137 
    138    * For providing a replacement for a function that exists on some platforms
    139      but is broken/insufficient and needs to be replaced on some of them and
    140      is additionally either missing or undeclared on some other platforms:
    141 
    142        #if @GNULIB_FOO@
    143        # if @REPLACE_FOO@
    144        #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
    145        #   undef foo
    146        #   define foo rpl_foo
    147        #  endif
    148        _GL_FUNCDECL_RPL (foo, ...);
    149        _GL_CXXALIAS_RPL (foo, ...);
    150        # else
    151        #  if !@HAVE_FOO@   or   if !@HAVE_DECL_FOO@
    152        _GL_FUNCDECL_SYS (foo, ...);
    153        #  endif
    154        _GL_CXXALIAS_SYS (foo, ...);
    155        # endif
    156        _GL_CXXALIASWARN (foo);
    157        #elif defined GNULIB_POSIXCHECK
    158        ...
    159        #endif
    160 */
    161 
    162 /* _GL_EXTERN_C declaration;
    163    performs the declaration with C linkage.  */
    164 #if defined __cplusplus
    165 # define _GL_EXTERN_C extern "C"
    166 #else
    167 # define _GL_EXTERN_C extern
    168 #endif
    169 
    170 /* _GL_FUNCDECL_RPL (func, rettype, parameters_and_attributes);
    171    declares a replacement function, named rpl_func, with the given prototype,
    172    consisting of return type, parameters, and attributes.
    173    Example:
    174      _GL_FUNCDECL_RPL (open, int, (const char *filename, int flags, ...)
    175                                   _GL_ARG_NONNULL ((1)));
    176  */
    177 #define _GL_FUNCDECL_RPL(func,rettype,parameters_and_attributes) \
    178   _GL_FUNCDECL_RPL_1 (rpl_##func, rettype, parameters_and_attributes)
    179 #define _GL_FUNCDECL_RPL_1(rpl_func,rettype,parameters_and_attributes) \
    180   _GL_EXTERN_C rettype rpl_func parameters_and_attributes
    181 
    182 /* _GL_FUNCDECL_SYS (func, rettype, parameters_and_attributes);
    183    declares the system function, named func, with the given prototype,
    184    consisting of return type, parameters, and attributes.
    185    Example:
    186      _GL_FUNCDECL_SYS (open, int, (const char *filename, int flags, ...)
    187                                   _GL_ARG_NONNULL ((1)));
    188  */
    189 #define _GL_FUNCDECL_SYS(func,rettype,parameters_and_attributes) \
    190   _GL_EXTERN_C rettype func parameters_and_attributes
    191 
    192 /* _GL_CXXALIAS_RPL (func, rettype, parameters);
    193    declares a C++ alias called GNULIB_NAMESPACE::func
    194    that redirects to rpl_func, if GNULIB_NAMESPACE is defined.
    195    Example:
    196      _GL_CXXALIAS_RPL (open, int, (const char *filename, int flags, ...));
    197 
    198    Wrapping rpl_func in an object with an inline conversion operator
    199    avoids a reference to rpl_func unless GNULIB_NAMESPACE::func is
    200    actually used in the program.  */
    201 #define _GL_CXXALIAS_RPL(func,rettype,parameters) \
    202   _GL_CXXALIAS_RPL_1 (func, rpl_##func, rettype, parameters)
    203 #if defined __cplusplus && defined GNULIB_NAMESPACE
    204 # define _GL_CXXALIAS_RPL_1(func,rpl_func,rettype,parameters) \
    205     namespace GNULIB_NAMESPACE                                \
    206     {                                                         \
    207       static const struct _gl_ ## func ## _wrapper            \
    208       {                                                       \
    209         typedef rettype (*type) parameters;                   \
    210                                                               \
    211         inline operator type () const                         \
    212         {                                                     \
    213           return ::rpl_func;                                  \
    214         }                                                     \
    215       } func = {};                                            \
    216     }                                                         \
    217     _GL_EXTERN_C int _gl_cxxalias_dummy
    218 #else
    219 # define _GL_CXXALIAS_RPL_1(func,rpl_func,rettype,parameters) \
    220     _GL_EXTERN_C int _gl_cxxalias_dummy
    221 #endif
    222 
    223 /* _GL_CXXALIAS_MDA (func, rettype, parameters);
    224    is to be used when func is a Microsoft deprecated alias, on native Windows.
    225    It declares a C++ alias called GNULIB_NAMESPACE::func
    226    that redirects to _func, if GNULIB_NAMESPACE is defined.
    227    Example:
    228      _GL_CXXALIAS_MDA (open, int, (const char *filename, int flags, ...));
    229  */
    230 #define _GL_CXXALIAS_MDA(func,rettype,parameters) \
    231   _GL_CXXALIAS_RPL_1 (func, _##func, rettype, parameters)
    232 
    233 /* _GL_CXXALIAS_RPL_CAST_1 (func, rpl_func, rettype, parameters);
    234    is like  _GL_CXXALIAS_RPL_1 (func, rpl_func, rettype, parameters);
    235    except that the C function rpl_func may have a slightly different
    236    declaration.  A cast is used to silence the "invalid conversion" error
    237    that would otherwise occur.  */
    238 #if defined __cplusplus && defined GNULIB_NAMESPACE
    239 # define _GL_CXXALIAS_RPL_CAST_1(func,rpl_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 reinterpret_cast<type>(::rpl_func);               \
    249         }                                                          \
    250       } func = {};                                                 \
    251     }                                                              \
    252     _GL_EXTERN_C int _gl_cxxalias_dummy
    253 #else
    254 # define _GL_CXXALIAS_RPL_CAST_1(func,rpl_func,rettype,parameters) \
    255     _GL_EXTERN_C int _gl_cxxalias_dummy
    256 #endif
    257 
    258 /* _GL_CXXALIAS_MDA_CAST (func, rettype, parameters);
    259    is like  _GL_CXXALIAS_MDA (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 #define _GL_CXXALIAS_MDA_CAST(func,rettype,parameters) \
    264   _GL_CXXALIAS_RPL_CAST_1 (func, _##func, rettype, parameters)
    265 
    266 /* _GL_CXXALIAS_SYS (func, rettype, parameters);
    267    declares a C++ alias called GNULIB_NAMESPACE::func
    268    that redirects to the system provided function func, if GNULIB_NAMESPACE
    269    is defined.
    270    Example:
    271      _GL_CXXALIAS_SYS (open, int, (const char *filename, int flags, ...));
    272 
    273    Wrapping func in an object with an inline conversion operator
    274    avoids a reference to func unless GNULIB_NAMESPACE::func is
    275    actually used in the program.  */
    276 #if defined __cplusplus && defined GNULIB_NAMESPACE
    277 # define _GL_CXXALIAS_SYS(func,rettype,parameters)            \
    278     namespace GNULIB_NAMESPACE                                \
    279     {                                                         \
    280       static const struct _gl_ ## func ## _wrapper            \
    281       {                                                       \
    282         typedef rettype (*type) parameters;                   \
    283                                                               \
    284         inline operator type () const                         \
    285         {                                                     \
    286           return ::func;                                      \
    287         }                                                     \
    288       } func = {};                                            \
    289     }                                                         \
    290     _GL_EXTERN_C int _gl_cxxalias_dummy
    291 #else
    292 # define _GL_CXXALIAS_SYS(func,rettype,parameters) \
    293     _GL_EXTERN_C int _gl_cxxalias_dummy
    294 #endif
    295 
    296 /* _GL_CXXALIAS_SYS_CAST (func, rettype, parameters);
    297    is like  _GL_CXXALIAS_SYS (func, rettype, parameters);
    298    except that the C function func may have a slightly different declaration.
    299    A cast is used to silence the "invalid conversion" error that would
    300    otherwise occur.  */
    301 #if defined __cplusplus && defined GNULIB_NAMESPACE
    302 # define _GL_CXXALIAS_SYS_CAST(func,rettype,parameters) \
    303     namespace GNULIB_NAMESPACE                          \
    304     {                                                   \
    305       static const struct _gl_ ## func ## _wrapper      \
    306       {                                                 \
    307         typedef rettype (*type) parameters;             \
    308                                                         \
    309         inline operator type () const                   \
    310         {                                               \
    311           return reinterpret_cast<type>(::func);        \
    312         }                                               \
    313       } func = {};                                      \
    314     }                                                   \
    315     _GL_EXTERN_C int _gl_cxxalias_dummy
    316 #else
    317 # define _GL_CXXALIAS_SYS_CAST(func,rettype,parameters) \
    318     _GL_EXTERN_C int _gl_cxxalias_dummy
    319 #endif
    320 
    321 /* _GL_CXXALIAS_SYS_CAST2 (func, rettype, parameters, rettype2, parameters2);
    322    is like  _GL_CXXALIAS_SYS (func, rettype, parameters);
    323    except that the C function is picked among a set of overloaded functions,
    324    namely the one with rettype2 and parameters2.  Two consecutive casts
    325    are used to silence the "cannot find a match" and "invalid conversion"
    326    errors that would otherwise occur.  */
    327 #if defined __cplusplus && defined GNULIB_NAMESPACE
    328   /* The outer cast must be a reinterpret_cast.
    329      The inner cast: When the function is defined as a set of overloaded
    330      functions, it works as a static_cast<>, choosing the designated variant.
    331      When the function is defined as a single variant, it works as a
    332      reinterpret_cast<>. The parenthesized cast syntax works both ways.  */
    333 # define _GL_CXXALIAS_SYS_CAST2(func,rettype,parameters,rettype2,parameters2) \
    334     namespace GNULIB_NAMESPACE                                                \
    335     {                                                                         \
    336       static const struct _gl_ ## func ## _wrapper                            \
    337       {                                                                       \
    338         typedef rettype (*type) parameters;                                   \
    339                                                                               \
    340         inline operator type () const                                         \
    341         {                                                                     \
    342           return reinterpret_cast<type>((rettype2 (*) parameters2)(::func));  \
    343         }                                                                     \
    344       } func = {};                                                            \
    345     }                                                                         \
    346     _GL_EXTERN_C int _gl_cxxalias_dummy
    347 #else
    348 # define _GL_CXXALIAS_SYS_CAST2(func,rettype,parameters,rettype2,parameters2) \
    349     _GL_EXTERN_C int _gl_cxxalias_dummy
    350 #endif
    351 
    352 /* _GL_CXXALIASWARN (func);
    353    causes a warning to be emitted when ::func is used but not when
    354    GNULIB_NAMESPACE::func is used.  func must be defined without overloaded
    355    variants.  */
    356 #if defined __cplusplus && defined GNULIB_NAMESPACE
    357 # define _GL_CXXALIASWARN(func) \
    358    _GL_CXXALIASWARN_1 (func, GNULIB_NAMESPACE)
    359 # define _GL_CXXALIASWARN_1(func,namespace) \
    360    _GL_CXXALIASWARN_2 (func, namespace)
    361 /* To work around GCC bug <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=43881>,
    362    we enable the warning only when not optimizing.  */
    363 # if !(defined __GNUC__ && !defined __clang__ && __OPTIMIZE__)
    364 #  define _GL_CXXALIASWARN_2(func,namespace) \
    365     _GL_WARN_ON_USE (func, \
    366                      "The symbol ::" #func " refers to the system function. " \
    367                      "Use " #namespace "::" #func " instead.")
    368 # elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING
    369 #  define _GL_CXXALIASWARN_2(func,namespace) \
    370      extern __typeof__ (func) func
    371 # else
    372 #  define _GL_CXXALIASWARN_2(func,namespace) \
    373      _GL_EXTERN_C int _gl_cxxalias_dummy
    374 # endif
    375 #else
    376 # define _GL_CXXALIASWARN(func) \
    377     _GL_EXTERN_C int _gl_cxxalias_dummy
    378 #endif
    379 
    380 /* _GL_CXXALIASWARN1 (func, rettype, parameters_and_attributes);
    381    causes a warning to be emitted when the given overloaded variant of ::func
    382    is used but not when GNULIB_NAMESPACE::func is used.  */
    383 #if defined __cplusplus && defined GNULIB_NAMESPACE
    384 # define _GL_CXXALIASWARN1(func,rettype,parameters_and_attributes) \
    385    _GL_CXXALIASWARN1_1 (func, rettype, parameters_and_attributes, \
    386                         GNULIB_NAMESPACE)
    387 # define _GL_CXXALIASWARN1_1(func,rettype,parameters_and_attributes,namespace) \
    388    _GL_CXXALIASWARN1_2 (func, rettype, parameters_and_attributes, namespace)
    389 /* To work around GCC bug <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=43881>,
    390    we enable the warning only when not optimizing.  */
    391 # if !(defined __GNUC__ && !defined __clang__ && __OPTIMIZE__)
    392 #  define _GL_CXXALIASWARN1_2(func,rettype,parameters_and_attributes,namespace) \
    393     _GL_WARN_ON_USE_CXX (func, rettype, rettype, parameters_and_attributes, \
    394                          "The symbol ::" #func " refers to the system function. " \
    395                          "Use " #namespace "::" #func " instead.")
    396 # else
    397 #  define _GL_CXXALIASWARN1_2(func,rettype,parameters_and_attributes,namespace) \
    398      _GL_EXTERN_C int _gl_cxxalias_dummy
    399 # endif
    400 #else
    401 # define _GL_CXXALIASWARN1(func,rettype,parameters_and_attributes) \
    402     _GL_EXTERN_C int _gl_cxxalias_dummy
    403 #endif
    404 
    405 #endif /* _GL_CXXDEFS_H */
    406 
    407 /* The definition of _GL_ARG_NONNULL is copied here.  */
    408 /* A C macro for declaring that specific arguments must not be NULL.
    409    Copyright (C) 2009-2022 Free Software Foundation, Inc.
    410 
    411    This program is free software: you can redistribute it and/or modify it
    412    under the terms of the GNU Lesser General Public License as published
    413    by the Free Software Foundation; either version 2 of the License, or
    414    (at your option) any later version.
    415 
    416    This program is distributed in the hope that it will be useful,
    417    but WITHOUT ANY WARRANTY; without even the implied warranty of
    418    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    419    Lesser General Public License for more details.
    420 
    421    You should have received a copy of the GNU Lesser General Public License
    422    along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
    423 
    424 /* _GL_ARG_NONNULL((n,...,m)) tells the compiler and static analyzer tools
    425    that the values passed as arguments n, ..., m must be non-NULL pointers.
    426    n = 1 stands for the first argument, n = 2 for the second argument etc.  */
    427 #ifndef _GL_ARG_NONNULL
    428 # if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3) || defined __clang__
    429 #  define _GL_ARG_NONNULL(params) __attribute__ ((__nonnull__ params))
    430 # else
    431 #  define _GL_ARG_NONNULL(params)
    432 # endif
    433 #endif
    434 
    435 /* The definition of _GL_WARN_ON_USE is copied here.  */
    436 /* A C macro for emitting warnings if a function is used.
    437    Copyright (C) 2010-2022 Free Software Foundation, Inc.
    438 
    439    This program is free software: you can redistribute it and/or modify it
    440    under the terms of the GNU Lesser General Public License as published
    441    by the Free Software Foundation; either version 2 of the License, or
    442    (at your option) any later version.
    443 
    444    This program is distributed in the hope that it will be useful,
    445    but WITHOUT ANY WARRANTY; without even the implied warranty of
    446    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    447    Lesser General Public License for more details.
    448 
    449    You should have received a copy of the GNU Lesser General Public License
    450    along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
    451 
    452 /* _GL_WARN_ON_USE (function, "literal string") issues a declaration
    453    for FUNCTION which will then trigger a compiler warning containing
    454    the text of "literal string" anywhere that function is called, if
    455    supported by the compiler.  If the compiler does not support this
    456    feature, the macro expands to an unused extern declaration.
    457 
    458    _GL_WARN_ON_USE_ATTRIBUTE ("literal string") expands to the
    459    attribute used in _GL_WARN_ON_USE.  If the compiler does not support
    460    this feature, it expands to empty.
    461 
    462    These macros are useful for marking a function as a potential
    463    portability trap, with the intent that "literal string" include
    464    instructions on the replacement function that should be used
    465    instead.
    466    _GL_WARN_ON_USE is for functions with 'extern' linkage.
    467    _GL_WARN_ON_USE_ATTRIBUTE is for functions with 'static' or 'inline'
    468    linkage.
    469 
    470    However, one of the reasons that a function is a portability trap is
    471    if it has the wrong signature.  Declaring FUNCTION with a different
    472    signature in C is a compilation error, so this macro must use the
    473    same type as any existing declaration so that programs that avoid
    474    the problematic FUNCTION do not fail to compile merely because they
    475    included a header that poisoned the function.  But this implies that
    476    _GL_WARN_ON_USE is only safe to use if FUNCTION is known to already
    477    have a declaration.  Use of this macro implies that there must not
    478    be any other macro hiding the declaration of FUNCTION; but
    479    undefining FUNCTION first is part of the poisoning process anyway
    480    (although for symbols that are provided only via a macro, the result
    481    is a compilation error rather than a warning containing
    482    "literal string").  Also note that in C++, it is only safe to use if
    483    FUNCTION has no overloads.
    484 
    485    For an example, it is possible to poison 'getline' by:
    486    - adding a call to gl_WARN_ON_USE_PREPARE([[#include <stdio.h>]],
    487      [getline]) in configure.ac, which potentially defines
    488      HAVE_RAW_DECL_GETLINE
    489    - adding this code to a header that wraps the system <stdio.h>:
    490      #undef getline
    491      #if HAVE_RAW_DECL_GETLINE
    492      _GL_WARN_ON_USE (getline, "getline is required by POSIX 2008, but"
    493        "not universally present; use the gnulib module getline");
    494      #endif
    495 
    496    It is not possible to directly poison global variables.  But it is
    497    possible to write a wrapper accessor function, and poison that
    498    (less common usage, like &environ, will cause a compilation error
    499    rather than issue the nice warning, but the end result of informing
    500    the developer about their portability problem is still achieved):
    501      #if HAVE_RAW_DECL_ENVIRON
    502      static char ***
    503      rpl_environ (void) { return &environ; }
    504      _GL_WARN_ON_USE (rpl_environ, "environ is not always properly declared");
    505      # undef environ
    506      # define environ (*rpl_environ ())
    507      #endif
    508    or better (avoiding contradictory use of 'static' and 'extern'):
    509      #if HAVE_RAW_DECL_ENVIRON
    510      static char ***
    511      _GL_WARN_ON_USE_ATTRIBUTE ("environ is not always properly declared")
    512      rpl_environ (void) { return &environ; }
    513      # undef environ
    514      # define environ (*rpl_environ ())
    515      #endif
    516    */
    517 #ifndef _GL_WARN_ON_USE
    518 
    519 # if 4 < __GNUC__ || (__GNUC__ == 4 && 3 <= __GNUC_MINOR__)
    520 /* A compiler attribute is available in gcc versions 4.3.0 and later.  */
    521 #  define _GL_WARN_ON_USE(function, message) \
    522 _GL_WARN_EXTERN_C __typeof__ (function) function __attribute__ ((__warning__ (message)))
    523 #  define _GL_WARN_ON_USE_ATTRIBUTE(message) \
    524   __attribute__ ((__warning__ (message)))
    525 # elif __clang_major__ >= 4
    526 /* Another compiler attribute is available in clang.  */
    527 #  define _GL_WARN_ON_USE(function, message) \
    528 _GL_WARN_EXTERN_C __typeof__ (function) function \
    529   __attribute__ ((__diagnose_if__ (1, message, "warning")))
    530 #  define _GL_WARN_ON_USE_ATTRIBUTE(message) \
    531   __attribute__ ((__diagnose_if__ (1, message, "warning")))
    532 # elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING
    533 /* Verify the existence of the function.  */
    534 #  define _GL_WARN_ON_USE(function, message) \
    535 _GL_WARN_EXTERN_C __typeof__ (function) function
    536 #  define _GL_WARN_ON_USE_ATTRIBUTE(message)
    537 # else /* Unsupported.  */
    538 #  define _GL_WARN_ON_USE(function, message) \
    539 _GL_WARN_EXTERN_C int _gl_warn_on_use
    540 #  define _GL_WARN_ON_USE_ATTRIBUTE(message)
    541 # endif
    542 #endif
    543 
    544 /* _GL_WARN_ON_USE_CXX (function, rettype_gcc, rettype_clang, parameters_and_attributes, "message")
    545    is like _GL_WARN_ON_USE (function, "message"), except that in C++ mode the
    546    function is declared with the given prototype, consisting of return type,
    547    parameters, and attributes.
    548    This variant is useful for overloaded functions in C++. _GL_WARN_ON_USE does
    549    not work in this case.  */
    550 #ifndef _GL_WARN_ON_USE_CXX
    551 # if !defined __cplusplus
    552 #  define _GL_WARN_ON_USE_CXX(function,rettype_gcc,rettype_clang,parameters_and_attributes,msg) \
    553      _GL_WARN_ON_USE (function, msg)
    554 # else
    555 #  if 4 < __GNUC__ || (__GNUC__ == 4 && 3 <= __GNUC_MINOR__)
    556 /* A compiler attribute is available in gcc versions 4.3.0 and later.  */
    557 #   define _GL_WARN_ON_USE_CXX(function,rettype_gcc,rettype_clang,parameters_and_attributes,msg) \
    558 extern rettype_gcc function parameters_and_attributes \
    559   __attribute__ ((__warning__ (msg)))
    560 #  elif __clang_major__ >= 4
    561 /* Another compiler attribute is available in clang.  */
    562 #   define _GL_WARN_ON_USE_CXX(function,rettype_gcc,rettype_clang,parameters_and_attributes,msg) \
    563 extern rettype_clang function parameters_and_attributes \
    564   __attribute__ ((__diagnose_if__ (1, msg, "warning")))
    565 #  elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING
    566 /* Verify the existence of the function.  */
    567 #   define _GL_WARN_ON_USE_CXX(function,rettype_gcc,rettype_clang,parameters_and_attributes,msg) \
    568 extern rettype_gcc function parameters_and_attributes
    569 #  else /* Unsupported.  */
    570 #   define _GL_WARN_ON_USE_CXX(function,rettype_gcc,rettype_clang,parameters_and_attributes,msg) \
    571 _GL_WARN_EXTERN_C int _gl_warn_on_use
    572 #  endif
    573 # endif
    574 #endif
    575 
    576 /* _GL_WARN_EXTERN_C declaration;
    577    performs the declaration with C linkage.  */
    578 #ifndef _GL_WARN_EXTERN_C
    579 # if defined __cplusplus
    580 #  define _GL_WARN_EXTERN_C extern "C"
    581 # else
    582 #  define _GL_WARN_EXTERN_C extern
    583 # endif
    584 #endif
    585 
    586 /* On AIX, sig_atomic_t already includes volatile.  C99 requires that
    587    'volatile sig_atomic_t' ignore the extra modifier, but C89 did not.
    588    Hence, redefine this to a non-volatile type as needed.  */
    589 #if ! 1
    590 # if !GNULIB_defined_sig_atomic_t
    591 typedef int rpl_sig_atomic_t;
    592 #  undef sig_atomic_t
    593 #  define sig_atomic_t rpl_sig_atomic_t
    594 #  define GNULIB_defined_sig_atomic_t 1
    595 # endif
    596 #endif
    597 
    598 /* A set or mask of signals.  */
    599 #if !1
    600 # if !GNULIB_defined_sigset_t
    601 typedef unsigned int sigset_t;
    602 #  define GNULIB_defined_sigset_t 1
    603 # endif
    604 #endif
    605 
    606 /* Define sighandler_t, the type of signal handlers.  A GNU extension.  */
    607 #if !0
    608 # ifdef __cplusplus
    609 extern "C" {
    610 # endif
    611 # if !GNULIB_defined_sighandler_t
    612 typedef void (*sighandler_t) (int);
    613 #  define GNULIB_defined_sighandler_t 1
    614 # endif
    615 # ifdef __cplusplus
    616 }
    617 # endif
    618 #endif
    619 
    620 
    621 #if 0
    622 # ifndef SIGPIPE
    623 /* Define SIGPIPE to a value that does not overlap with other signals.  */
    624 #  define SIGPIPE 13
    625 #  define GNULIB_defined_SIGPIPE 1
    626 /* To actually use SIGPIPE, you also need the gnulib modules 'sigprocmask',
    627    'write', 'stdio'.  */
    628 # endif
    629 #endif
    630 
    631 
    632 /* Maximum signal number + 1.  */
    633 #ifndef NSIG
    634 # if defined __TANDEM
    635 #  define NSIG 32
    636 # endif
    637 #endif
    638 
    639 
    640 #if 0
    641 # if 0
    642 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
    643 #   undef pthread_sigmask
    644 #   define pthread_sigmask rpl_pthread_sigmask
    645 #  endif
    646 _GL_FUNCDECL_RPL (pthread_sigmask, int,
    647                   (int how,
    648                    const sigset_t *restrict new_mask,
    649                    sigset_t *restrict old_mask));
    650 _GL_CXXALIAS_RPL (pthread_sigmask, int,
    651                   (int how,
    652                    const sigset_t *restrict new_mask,
    653                    sigset_t *restrict old_mask));
    654 # else
    655 #  if !(1 || defined pthread_sigmask)
    656 _GL_FUNCDECL_SYS (pthread_sigmask, int,
    657                   (int how,
    658                    const sigset_t *restrict new_mask,
    659                    sigset_t *restrict old_mask));
    660 #  endif
    661 _GL_CXXALIAS_SYS (pthread_sigmask, int,
    662                   (int how,
    663                    const sigset_t *restrict new_mask,
    664                    sigset_t *restrict old_mask));
    665 # endif
    666 # if __GLIBC__ >= 2
    667 _GL_CXXALIASWARN (pthread_sigmask);
    668 # endif
    669 #elif defined GNULIB_POSIXCHECK
    670 # undef pthread_sigmask
    671 # if HAVE_RAW_DECL_PTHREAD_SIGMASK
    672 _GL_WARN_ON_USE (pthread_sigmask, "pthread_sigmask is not portable - "
    673                  "use gnulib module pthread_sigmask for portability");
    674 # endif
    675 #endif
    676 
    677 
    678 #if 0
    679 # if 0
    680 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
    681 #   undef raise
    682 #   define raise rpl_raise
    683 #  endif
    684 _GL_FUNCDECL_RPL (raise, int, (int sig));
    685 _GL_CXXALIAS_RPL (raise, int, (int sig));
    686 # else
    687 #  if !1
    688 _GL_FUNCDECL_SYS (raise, int, (int sig));
    689 #  endif
    690 _GL_CXXALIAS_SYS (raise, int, (int sig));
    691 # endif
    692 # if __GLIBC__ >= 2
    693 _GL_CXXALIASWARN (raise);
    694 # endif
    695 #elif defined GNULIB_POSIXCHECK
    696 # undef raise
    697 /* Assume raise is always declared.  */
    698 _GL_WARN_ON_USE (raise, "raise can crash on native Windows - "
    699                  "use gnulib module raise for portability");
    700 #endif
    701 
    702 
    703 #if 0
    704 # if !1
    705 
    706 #  ifndef GNULIB_defined_signal_blocking
    707 #   define GNULIB_defined_signal_blocking 1
    708 #  endif
    709 
    710 /* Maximum signal number + 1.  */
    711 #  ifndef NSIG
    712 #   define NSIG 32
    713 #  endif
    714 
    715 /* This code supports only 32 signals.  */
    716 #  if !GNULIB_defined_verify_NSIG_constraint
    717 typedef int verify_NSIG_constraint[NSIG <= 32 ? 1 : -1];
    718 #   define GNULIB_defined_verify_NSIG_constraint 1
    719 #  endif
    720 
    721 # endif
    722 
    723 /* When also using extern inline, suppress the use of static inline in
    724    standard headers of problematic Apple configurations, as Libc at
    725    least through Libc-825.26 (2013-04-09) mishandles it; see, e.g.,
    726    <https://lists.gnu.org/r/bug-gnulib/2012-12/msg00023.html>.
    727    Perhaps Apple will fix this some day.  */
    728 #if (defined _GL_EXTERN_INLINE_IN_USE && defined __APPLE__ \
    729      && (defined __i386__ || defined __x86_64__))
    730 # undef sigaddset
    731 # undef sigdelset
    732 # undef sigemptyset
    733 # undef sigfillset
    734 # undef sigismember
    735 #endif
    736 
    737 /* Test whether a given signal is contained in a signal set.  */
    738 # if 1
    739 /* This function is defined as a macro on Mac OS X.  */
    740 #  if defined __cplusplus && defined GNULIB_NAMESPACE
    741 #   undef sigismember
    742 #  endif
    743 # else
    744 _GL_FUNCDECL_SYS (sigismember, int, (const sigset_t *set, int sig)
    745                                     _GL_ARG_NONNULL ((1)));
    746 # endif
    747 _GL_CXXALIAS_SYS (sigismember, int, (const sigset_t *set, int sig));
    748 _GL_CXXALIASWARN (sigismember);
    749 
    750 /* Initialize a signal set to the empty set.  */
    751 # if 1
    752 /* This function is defined as a macro on Mac OS X.  */
    753 #  if defined __cplusplus && defined GNULIB_NAMESPACE
    754 #   undef sigemptyset
    755 #  endif
    756 # else
    757 _GL_FUNCDECL_SYS (sigemptyset, int, (sigset_t *set) _GL_ARG_NONNULL ((1)));
    758 # endif
    759 _GL_CXXALIAS_SYS (sigemptyset, int, (sigset_t *set));
    760 _GL_CXXALIASWARN (sigemptyset);
    761 
    762 /* Add a signal to a signal set.  */
    763 # if 1
    764 /* This function is defined as a macro on Mac OS X.  */
    765 #  if defined __cplusplus && defined GNULIB_NAMESPACE
    766 #   undef sigaddset
    767 #  endif
    768 # else
    769 _GL_FUNCDECL_SYS (sigaddset, int, (sigset_t *set, int sig)
    770                                   _GL_ARG_NONNULL ((1)));
    771 # endif
    772 _GL_CXXALIAS_SYS (sigaddset, int, (sigset_t *set, int sig));
    773 _GL_CXXALIASWARN (sigaddset);
    774 
    775 /* Remove a signal from a signal set.  */
    776 # if 1
    777 /* This function is defined as a macro on Mac OS X.  */
    778 #  if defined __cplusplus && defined GNULIB_NAMESPACE
    779 #   undef sigdelset
    780 #  endif
    781 # else
    782 _GL_FUNCDECL_SYS (sigdelset, int, (sigset_t *set, int sig)
    783                                   _GL_ARG_NONNULL ((1)));
    784 # endif
    785 _GL_CXXALIAS_SYS (sigdelset, int, (sigset_t *set, int sig));
    786 _GL_CXXALIASWARN (sigdelset);
    787 
    788 /* Fill a signal set with all possible signals.  */
    789 # if 1
    790 /* This function is defined as a macro on Mac OS X.  */
    791 #  if defined __cplusplus && defined GNULIB_NAMESPACE
    792 #   undef sigfillset
    793 #  endif
    794 # else
    795 _GL_FUNCDECL_SYS (sigfillset, int, (sigset_t *set) _GL_ARG_NONNULL ((1)));
    796 # endif
    797 _GL_CXXALIAS_SYS (sigfillset, int, (sigset_t *set));
    798 _GL_CXXALIASWARN (sigfillset);
    799 
    800 /* Return the set of those blocked signals that are pending.  */
    801 # if !1
    802 _GL_FUNCDECL_SYS (sigpending, int, (sigset_t *set) _GL_ARG_NONNULL ((1)));
    803 # endif
    804 _GL_CXXALIAS_SYS (sigpending, int, (sigset_t *set));
    805 _GL_CXXALIASWARN (sigpending);
    806 
    807 /* If OLD_SET is not NULL, put the current set of blocked signals in *OLD_SET.
    808    Then, if SET is not NULL, affect the current set of blocked signals by
    809    combining it with *SET as indicated in OPERATION.
    810    In this implementation, you are not allowed to change a signal handler
    811    while the signal is blocked.  */
    812 # if !1
    813 #  define SIG_BLOCK   0  /* blocked_set = blocked_set | *set; */
    814 #  define SIG_SETMASK 1  /* blocked_set = *set; */
    815 #  define SIG_UNBLOCK 2  /* blocked_set = blocked_set & ~*set; */
    816 _GL_FUNCDECL_SYS (sigprocmask, int,
    817                   (int operation,
    818                    const sigset_t *restrict set,
    819                    sigset_t *restrict old_set));
    820 # endif
    821 _GL_CXXALIAS_SYS (sigprocmask, int,
    822                   (int operation,
    823                    const sigset_t *restrict set,
    824                    sigset_t *restrict old_set));
    825 _GL_CXXALIASWARN (sigprocmask);
    826 
    827 /* Install the handler FUNC for signal SIG, and return the previous
    828    handler.  */
    829 # ifdef __cplusplus
    830 extern "C" {
    831 # endif
    832 # if !GNULIB_defined_function_taking_int_returning_void_t
    833 typedef void (*_gl_function_taking_int_returning_void_t) (int);
    834 #  define GNULIB_defined_function_taking_int_returning_void_t 1
    835 # endif
    836 # ifdef __cplusplus
    837 }
    838 # endif
    839 # if !1
    840 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
    841 #   define signal rpl_signal
    842 #  endif
    843 _GL_FUNCDECL_RPL (signal, _gl_function_taking_int_returning_void_t,
    844                   (int sig, _gl_function_taking_int_returning_void_t func));
    845 _GL_CXXALIAS_RPL (signal, _gl_function_taking_int_returning_void_t,
    846                   (int sig, _gl_function_taking_int_returning_void_t func));
    847 # else
    848 /* On OpenBSD, the declaration of 'signal' may not be present at this point,
    849    because it occurs in <sys/signal.h>, not <signal.h> directly.  */
    850 #  if defined __OpenBSD__
    851 _GL_FUNCDECL_SYS (signal, _gl_function_taking_int_returning_void_t,
    852                   (int sig, _gl_function_taking_int_returning_void_t func));
    853 #  endif
    854 _GL_CXXALIAS_SYS (signal, _gl_function_taking_int_returning_void_t,
    855                   (int sig, _gl_function_taking_int_returning_void_t func));
    856 # endif
    857 # if __GLIBC__ >= 2
    858 _GL_CXXALIASWARN (signal);
    859 # endif
    860 
    861 # if !1 && GNULIB_defined_SIGPIPE
    862 /* Raise signal SIGPIPE.  */
    863 _GL_EXTERN_C int _gl_raise_SIGPIPE (void);
    864 # endif
    865 
    866 #elif defined GNULIB_POSIXCHECK
    867 # undef sigaddset
    868 # if HAVE_RAW_DECL_SIGADDSET
    869 _GL_WARN_ON_USE (sigaddset, "sigaddset is unportable - "
    870                  "use the gnulib module sigprocmask for portability");
    871 # endif
    872 # undef sigdelset
    873 # if HAVE_RAW_DECL_SIGDELSET
    874 _GL_WARN_ON_USE (sigdelset, "sigdelset is unportable - "
    875                  "use the gnulib module sigprocmask for portability");
    876 # endif
    877 # undef sigemptyset
    878 # if HAVE_RAW_DECL_SIGEMPTYSET
    879 _GL_WARN_ON_USE (sigemptyset, "sigemptyset is unportable - "
    880                  "use the gnulib module sigprocmask for portability");
    881 # endif
    882 # undef sigfillset
    883 # if HAVE_RAW_DECL_SIGFILLSET
    884 _GL_WARN_ON_USE (sigfillset, "sigfillset is unportable - "
    885                  "use the gnulib module sigprocmask for portability");
    886 # endif
    887 # undef sigismember
    888 # if HAVE_RAW_DECL_SIGISMEMBER
    889 _GL_WARN_ON_USE (sigismember, "sigismember is unportable - "
    890                  "use the gnulib module sigprocmask for portability");
    891 # endif
    892 # undef sigpending
    893 # if HAVE_RAW_DECL_SIGPENDING
    894 _GL_WARN_ON_USE (sigpending, "sigpending is unportable - "
    895                  "use the gnulib module sigprocmask for portability");
    896 # endif
    897 # undef sigprocmask
    898 # if HAVE_RAW_DECL_SIGPROCMASK
    899 _GL_WARN_ON_USE (sigprocmask, "sigprocmask is unportable - "
    900                  "use the gnulib module sigprocmask for portability");
    901 # endif
    902 #endif /* 0 */
    903 
    904 
    905 #if 0
    906 # if !1
    907 
    908 #  if !1
    909 
    910 #   if !GNULIB_defined_siginfo_types
    911 
    912 /* Present to allow compilation, but unsupported by gnulib.  */
    913 union sigval
    914 {
    915   int sival_int;
    916   void *sival_ptr;
    917 };
    918 
    919 /* Present to allow compilation, but unsupported by gnulib.  */
    920 struct siginfo_t
    921 {
    922   int si_signo;
    923   int si_code;
    924   int si_errno;
    925   pid_t si_pid;
    926   uid_t si_uid;
    927   void *si_addr;
    928   int si_status;
    929   long si_band;
    930   union sigval si_value;
    931 };
    932 typedef struct siginfo_t siginfo_t;
    933 
    934 #    define GNULIB_defined_siginfo_types 1
    935 #   endif
    936 
    937 #  endif /* !1 */
    938 
    939 /* We assume that platforms which lack the sigaction() function also lack
    940    the 'struct sigaction' type, and vice versa.  */
    941 
    942 #  if !GNULIB_defined_struct_sigaction
    943 
    944 struct sigaction
    945 {
    946   union
    947   {
    948     void (*_sa_handler) (int);
    949     /* Present to allow compilation, but unsupported by gnulib.  POSIX
    950        says that implementations may, but not must, make sa_sigaction
    951        overlap with sa_handler, but we know of no implementation where
    952        they do not overlap.  */
    953     void (*_sa_sigaction) (int, siginfo_t *, void *);
    954   } _sa_func;
    955   sigset_t sa_mask;
    956   /* Not all POSIX flags are supported.  */
    957   int sa_flags;
    958 };
    959 #   define sa_handler _sa_func._sa_handler
    960 #   define sa_sigaction _sa_func._sa_sigaction
    961 /* Unsupported flags are not present.  */
    962 #   define SA_RESETHAND 1
    963 #   define SA_NODEFER 2
    964 #   define SA_RESTART 4
    965 
    966 #   define GNULIB_defined_struct_sigaction 1
    967 #  endif
    968 
    969 _GL_FUNCDECL_SYS (sigaction, int, (int, const struct sigaction *restrict,
    970                                    struct sigaction *restrict));
    971 
    972 # elif !1
    973 
    974 #  define sa_sigaction sa_handler
    975 
    976 # endif /* !1, !1 */
    977 
    978 _GL_CXXALIAS_SYS (sigaction, int, (int, const struct sigaction *restrict,
    979                                    struct sigaction *restrict));
    980 _GL_CXXALIASWARN (sigaction);
    981 
    982 #elif defined GNULIB_POSIXCHECK
    983 # undef sigaction
    984 # if HAVE_RAW_DECL_SIGACTION
    985 _GL_WARN_ON_USE (sigaction, "sigaction is unportable - "
    986                  "use the gnulib module sigaction for portability");
    987 # endif
    988 #endif
    989 
    990 /* Some systems don't have SA_NODEFER.  */
    991 #ifndef SA_NODEFER
    992 # define SA_NODEFER 0
    993 #endif
    994 
    995 
    996 #endif /* _GL_SIGNAL_H */
    997 #endif /* _GL_SIGNAL_H */
    998 #endif
    999