1*88e42b0fSchristos /* This file is automatically generated. DO NOT EDIT! */ 2*88e42b0fSchristos /* Generated from: NetBSD: mknative-gdb,v 1.14 2020/09/24 14:53:17 christos Exp */ 3*88e42b0fSchristos /* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ 4*88e42b0fSchristos 5*88e42b0fSchristos /* DO NOT EDIT! GENERATED AUTOMATICALLY! */ 6*88e42b0fSchristos /* Copyright (C) 2006-2020 Free Software Foundation, Inc. 7*88e42b0fSchristos Written by Paul Eggert, Bruno Haible, Derek Price. 8*88e42b0fSchristos This file is part of gnulib. 9*88e42b0fSchristos 10*88e42b0fSchristos This program is free software: you can redistribute it and/or modify 11*88e42b0fSchristos it under the terms of the GNU General Public License as published by 12*88e42b0fSchristos the Free Software Foundation; either version 3 of the License, or 13*88e42b0fSchristos (at your option) any later version. 14*88e42b0fSchristos 15*88e42b0fSchristos This program is distributed in the hope that it will be useful, 16*88e42b0fSchristos but WITHOUT ANY WARRANTY; without even the implied warranty of 17*88e42b0fSchristos MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18*88e42b0fSchristos GNU General Public License for more details. 19*88e42b0fSchristos 20*88e42b0fSchristos You should have received a copy of the GNU General Public License 21*88e42b0fSchristos along with this program. If not, see <https://www.gnu.org/licenses/>. */ 22*88e42b0fSchristos 23*88e42b0fSchristos /* 24*88e42b0fSchristos * ISO C 99 <inttypes.h> for platforms that lack it. 25*88e42b0fSchristos * <https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/inttypes.h.html> 26*88e42b0fSchristos */ 27*88e42b0fSchristos 28*88e42b0fSchristos #if __GNUC__ >= 3 29*88e42b0fSchristos #pragma GCC system_header 30*88e42b0fSchristos #endif 31*88e42b0fSchristos 32*88e42b0fSchristos 33*88e42b0fSchristos /* Include the original <inttypes.h> if it exists, and if this file 34*88e42b0fSchristos has not been included yet or if this file includes gnulib stdint.h 35*88e42b0fSchristos which in turn includes this file. 36*88e42b0fSchristos The include_next requires a split double-inclusion guard. */ 37*88e42b0fSchristos #if ! defined INTTYPES_H || defined _GL_JUST_INCLUDE_SYSTEM_INTTYPES_H 38*88e42b0fSchristos # if 1 39*88e42b0fSchristos 40*88e42b0fSchristos /* Some pre-C++11 <stdint.h> implementations need this. */ 41*88e42b0fSchristos # if defined __cplusplus && ! defined __STDC_FORMAT_MACROS 42*88e42b0fSchristos # define __STDC_FORMAT_MACROS 1 43*88e42b0fSchristos # endif 44*88e42b0fSchristos 45*88e42b0fSchristos # include_next <inttypes.h> 46*88e42b0fSchristos 47*88e42b0fSchristos # define _GL_FINISHED_INCLUDING_SYSTEM_INTTYPES_H 48*88e42b0fSchristos # endif 49*88e42b0fSchristos #endif 50*88e42b0fSchristos 51*88e42b0fSchristos #if ! defined INTTYPES_H && ! defined _GL_JUST_INCLUDE_SYSTEM_INTTYPES_H 52*88e42b0fSchristos #define INTTYPES_H 53*88e42b0fSchristos 54*88e42b0fSchristos /* Include <stdint.h> or the gnulib replacement. 55*88e42b0fSchristos But avoid namespace pollution on glibc systems. */ 56*88e42b0fSchristos #ifndef __GLIBC__ 57*88e42b0fSchristos # include <stdint.h> 58*88e42b0fSchristos #endif 59*88e42b0fSchristos /* Get CHAR_BIT, INT_MAX, LONG_MAX, etc. */ 60*88e42b0fSchristos #include <limits.h> 61*88e42b0fSchristos /* On mingw, __USE_MINGW_ANSI_STDIO only works if <stdio.h> is also included */ 62*88e42b0fSchristos #if defined _WIN32 && ! defined __CYGWIN__ 63*88e42b0fSchristos # include <stdio.h> 64*88e42b0fSchristos #endif 65*88e42b0fSchristos 66*88e42b0fSchristos #if !(INT_MAX == 0x7fffffff && INT_MIN + INT_MAX == -1) 67*88e42b0fSchristos # error "This file assumes that 'int' is 32-bit two's complement. Please report your platform and compiler to <bug-gnulib@gnu.org>." 68*88e42b0fSchristos #endif 69*88e42b0fSchristos 70*88e42b0fSchristos /* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */ 71*88e42b0fSchristos /* C++ compatible function declaration macros. 72*88e42b0fSchristos Copyright (C) 2010-2020 Free Software Foundation, Inc. 73*88e42b0fSchristos 74*88e42b0fSchristos This program is free software: you can redistribute it and/or modify it 75*88e42b0fSchristos under the terms of the GNU General Public License as published 76*88e42b0fSchristos by the Free Software Foundation; either version 3 of the License, or 77*88e42b0fSchristos (at your option) any later version. 78*88e42b0fSchristos 79*88e42b0fSchristos This program is distributed in the hope that it will be useful, 80*88e42b0fSchristos but WITHOUT ANY WARRANTY; without even the implied warranty of 81*88e42b0fSchristos MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 82*88e42b0fSchristos General Public License for more details. 83*88e42b0fSchristos 84*88e42b0fSchristos You should have received a copy of the GNU General Public License 85*88e42b0fSchristos along with this program. If not, see <https://www.gnu.org/licenses/>. */ 86*88e42b0fSchristos 87*88e42b0fSchristos #ifndef _GL_CXXDEFS_H 88*88e42b0fSchristos #define _GL_CXXDEFS_H 89*88e42b0fSchristos 90*88e42b0fSchristos /* Begin/end the GNULIB_NAMESPACE namespace. */ 91*88e42b0fSchristos #if defined __cplusplus && defined GNULIB_NAMESPACE 92*88e42b0fSchristos # define _GL_BEGIN_NAMESPACE namespace GNULIB_NAMESPACE { 93*88e42b0fSchristos # define _GL_END_NAMESPACE } 94*88e42b0fSchristos #else 95*88e42b0fSchristos # define _GL_BEGIN_NAMESPACE 96*88e42b0fSchristos # define _GL_END_NAMESPACE 97*88e42b0fSchristos #endif 98*88e42b0fSchristos 99*88e42b0fSchristos /* The three most frequent use cases of these macros are: 100*88e42b0fSchristos 101*88e42b0fSchristos * For providing a substitute for a function that is missing on some 102*88e42b0fSchristos platforms, but is declared and works fine on the platforms on which 103*88e42b0fSchristos it exists: 104*88e42b0fSchristos 105*88e42b0fSchristos #if @GNULIB_FOO@ 106*88e42b0fSchristos # if !@HAVE_FOO@ 107*88e42b0fSchristos _GL_FUNCDECL_SYS (foo, ...); 108*88e42b0fSchristos # endif 109*88e42b0fSchristos _GL_CXXALIAS_SYS (foo, ...); 110*88e42b0fSchristos _GL_CXXALIASWARN (foo); 111*88e42b0fSchristos #elif defined GNULIB_POSIXCHECK 112*88e42b0fSchristos ... 113*88e42b0fSchristos #endif 114*88e42b0fSchristos 115*88e42b0fSchristos * For providing a replacement for a function that exists on all platforms, 116*88e42b0fSchristos but is broken/insufficient and needs to be replaced on some platforms: 117*88e42b0fSchristos 118*88e42b0fSchristos #if @GNULIB_FOO@ 119*88e42b0fSchristos # if @REPLACE_FOO@ 120*88e42b0fSchristos # if !(defined __cplusplus && defined GNULIB_NAMESPACE) 121*88e42b0fSchristos # undef foo 122*88e42b0fSchristos # define foo rpl_foo 123*88e42b0fSchristos # endif 124*88e42b0fSchristos _GL_FUNCDECL_RPL (foo, ...); 125*88e42b0fSchristos _GL_CXXALIAS_RPL (foo, ...); 126*88e42b0fSchristos # else 127*88e42b0fSchristos _GL_CXXALIAS_SYS (foo, ...); 128*88e42b0fSchristos # endif 129*88e42b0fSchristos _GL_CXXALIASWARN (foo); 130*88e42b0fSchristos #elif defined GNULIB_POSIXCHECK 131*88e42b0fSchristos ... 132*88e42b0fSchristos #endif 133*88e42b0fSchristos 134*88e42b0fSchristos * For providing a replacement for a function that exists on some platforms 135*88e42b0fSchristos but is broken/insufficient and needs to be replaced on some of them and 136*88e42b0fSchristos is additionally either missing or undeclared on some other platforms: 137*88e42b0fSchristos 138*88e42b0fSchristos #if @GNULIB_FOO@ 139*88e42b0fSchristos # if @REPLACE_FOO@ 140*88e42b0fSchristos # if !(defined __cplusplus && defined GNULIB_NAMESPACE) 141*88e42b0fSchristos # undef foo 142*88e42b0fSchristos # define foo rpl_foo 143*88e42b0fSchristos # endif 144*88e42b0fSchristos _GL_FUNCDECL_RPL (foo, ...); 145*88e42b0fSchristos _GL_CXXALIAS_RPL (foo, ...); 146*88e42b0fSchristos # else 147*88e42b0fSchristos # if !@HAVE_FOO@ or if !@HAVE_DECL_FOO@ 148*88e42b0fSchristos _GL_FUNCDECL_SYS (foo, ...); 149*88e42b0fSchristos # endif 150*88e42b0fSchristos _GL_CXXALIAS_SYS (foo, ...); 151*88e42b0fSchristos # endif 152*88e42b0fSchristos _GL_CXXALIASWARN (foo); 153*88e42b0fSchristos #elif defined GNULIB_POSIXCHECK 154*88e42b0fSchristos ... 155*88e42b0fSchristos #endif 156*88e42b0fSchristos */ 157*88e42b0fSchristos 158*88e42b0fSchristos /* _GL_EXTERN_C declaration; 159*88e42b0fSchristos performs the declaration with C linkage. */ 160*88e42b0fSchristos #if defined __cplusplus 161*88e42b0fSchristos # define _GL_EXTERN_C extern "C" 162*88e42b0fSchristos #else 163*88e42b0fSchristos # define _GL_EXTERN_C extern 164*88e42b0fSchristos #endif 165*88e42b0fSchristos 166*88e42b0fSchristos /* _GL_FUNCDECL_RPL (func, rettype, parameters_and_attributes); 167*88e42b0fSchristos declares a replacement function, named rpl_func, with the given prototype, 168*88e42b0fSchristos consisting of return type, parameters, and attributes. 169*88e42b0fSchristos Example: 170*88e42b0fSchristos _GL_FUNCDECL_RPL (open, int, (const char *filename, int flags, ...) 171*88e42b0fSchristos _GL_ARG_NONNULL ((1))); 172*88e42b0fSchristos */ 173*88e42b0fSchristos #define _GL_FUNCDECL_RPL(func,rettype,parameters_and_attributes) \ 174*88e42b0fSchristos _GL_FUNCDECL_RPL_1 (rpl_##func, rettype, parameters_and_attributes) 175*88e42b0fSchristos #define _GL_FUNCDECL_RPL_1(rpl_func,rettype,parameters_and_attributes) \ 176*88e42b0fSchristos _GL_EXTERN_C rettype rpl_func parameters_and_attributes 177*88e42b0fSchristos 178*88e42b0fSchristos /* _GL_FUNCDECL_SYS (func, rettype, parameters_and_attributes); 179*88e42b0fSchristos declares the system function, named func, with the given prototype, 180*88e42b0fSchristos consisting of return type, parameters, and attributes. 181*88e42b0fSchristos Example: 182*88e42b0fSchristos _GL_FUNCDECL_SYS (open, int, (const char *filename, int flags, ...) 183*88e42b0fSchristos _GL_ARG_NONNULL ((1))); 184*88e42b0fSchristos */ 185*88e42b0fSchristos #define _GL_FUNCDECL_SYS(func,rettype,parameters_and_attributes) \ 186*88e42b0fSchristos _GL_EXTERN_C rettype func parameters_and_attributes 187*88e42b0fSchristos 188*88e42b0fSchristos /* _GL_CXXALIAS_RPL (func, rettype, parameters); 189*88e42b0fSchristos declares a C++ alias called GNULIB_NAMESPACE::func 190*88e42b0fSchristos that redirects to rpl_func, if GNULIB_NAMESPACE is defined. 191*88e42b0fSchristos Example: 192*88e42b0fSchristos _GL_CXXALIAS_RPL (open, int, (const char *filename, int flags, ...)); 193*88e42b0fSchristos 194*88e42b0fSchristos Wrapping rpl_func in an object with an inline conversion operator 195*88e42b0fSchristos avoids a reference to rpl_func unless GNULIB_NAMESPACE::func is 196*88e42b0fSchristos actually used in the program. */ 197*88e42b0fSchristos #define _GL_CXXALIAS_RPL(func,rettype,parameters) \ 198*88e42b0fSchristos _GL_CXXALIAS_RPL_1 (func, rpl_##func, rettype, parameters) 199*88e42b0fSchristos #if defined __cplusplus && defined GNULIB_NAMESPACE 200*88e42b0fSchristos # define _GL_CXXALIAS_RPL_1(func,rpl_func,rettype,parameters) \ 201*88e42b0fSchristos namespace GNULIB_NAMESPACE \ 202*88e42b0fSchristos { \ 203*88e42b0fSchristos static const struct _gl_ ## func ## _wrapper \ 204*88e42b0fSchristos { \ 205*88e42b0fSchristos typedef rettype (*type) parameters; \ 206*88e42b0fSchristos \ 207*88e42b0fSchristos inline operator type () const \ 208*88e42b0fSchristos { \ 209*88e42b0fSchristos return ::rpl_func; \ 210*88e42b0fSchristos } \ 211*88e42b0fSchristos } func = {}; \ 212*88e42b0fSchristos } \ 213*88e42b0fSchristos _GL_EXTERN_C int _gl_cxxalias_dummy 214*88e42b0fSchristos #else 215*88e42b0fSchristos # define _GL_CXXALIAS_RPL_1(func,rpl_func,rettype,parameters) \ 216*88e42b0fSchristos _GL_EXTERN_C int _gl_cxxalias_dummy 217*88e42b0fSchristos #endif 218*88e42b0fSchristos 219*88e42b0fSchristos /* _GL_CXXALIAS_RPL_CAST_1 (func, rpl_func, rettype, parameters); 220*88e42b0fSchristos is like _GL_CXXALIAS_RPL_1 (func, rpl_func, rettype, parameters); 221*88e42b0fSchristos except that the C function rpl_func may have a slightly different 222*88e42b0fSchristos declaration. A cast is used to silence the "invalid conversion" error 223*88e42b0fSchristos that would otherwise occur. */ 224*88e42b0fSchristos #if defined __cplusplus && defined GNULIB_NAMESPACE 225*88e42b0fSchristos # define _GL_CXXALIAS_RPL_CAST_1(func,rpl_func,rettype,parameters) \ 226*88e42b0fSchristos namespace GNULIB_NAMESPACE \ 227*88e42b0fSchristos { \ 228*88e42b0fSchristos static const struct _gl_ ## func ## _wrapper \ 229*88e42b0fSchristos { \ 230*88e42b0fSchristos typedef rettype (*type) parameters; \ 231*88e42b0fSchristos \ 232*88e42b0fSchristos inline operator type () const \ 233*88e42b0fSchristos { \ 234*88e42b0fSchristos return reinterpret_cast<type>(::rpl_func); \ 235*88e42b0fSchristos } \ 236*88e42b0fSchristos } func = {}; \ 237*88e42b0fSchristos } \ 238*88e42b0fSchristos _GL_EXTERN_C int _gl_cxxalias_dummy 239*88e42b0fSchristos #else 240*88e42b0fSchristos # define _GL_CXXALIAS_RPL_CAST_1(func,rpl_func,rettype,parameters) \ 241*88e42b0fSchristos _GL_EXTERN_C int _gl_cxxalias_dummy 242*88e42b0fSchristos #endif 243*88e42b0fSchristos 244*88e42b0fSchristos /* _GL_CXXALIAS_SYS (func, rettype, parameters); 245*88e42b0fSchristos declares a C++ alias called GNULIB_NAMESPACE::func 246*88e42b0fSchristos that redirects to the system provided function func, if GNULIB_NAMESPACE 247*88e42b0fSchristos is defined. 248*88e42b0fSchristos Example: 249*88e42b0fSchristos _GL_CXXALIAS_SYS (open, int, (const char *filename, int flags, ...)); 250*88e42b0fSchristos 251*88e42b0fSchristos Wrapping func in an object with an inline conversion operator 252*88e42b0fSchristos avoids a reference to func unless GNULIB_NAMESPACE::func is 253*88e42b0fSchristos actually used in the program. */ 254*88e42b0fSchristos #if defined __cplusplus && defined GNULIB_NAMESPACE 255*88e42b0fSchristos # define _GL_CXXALIAS_SYS(func,rettype,parameters) \ 256*88e42b0fSchristos namespace GNULIB_NAMESPACE \ 257*88e42b0fSchristos { \ 258*88e42b0fSchristos static const struct _gl_ ## func ## _wrapper \ 259*88e42b0fSchristos { \ 260*88e42b0fSchristos typedef rettype (*type) parameters; \ 261*88e42b0fSchristos \ 262*88e42b0fSchristos inline operator type () const \ 263*88e42b0fSchristos { \ 264*88e42b0fSchristos return ::func; \ 265*88e42b0fSchristos } \ 266*88e42b0fSchristos } func = {}; \ 267*88e42b0fSchristos } \ 268*88e42b0fSchristos _GL_EXTERN_C int _gl_cxxalias_dummy 269*88e42b0fSchristos #else 270*88e42b0fSchristos # define _GL_CXXALIAS_SYS(func,rettype,parameters) \ 271*88e42b0fSchristos _GL_EXTERN_C int _gl_cxxalias_dummy 272*88e42b0fSchristos #endif 273*88e42b0fSchristos 274*88e42b0fSchristos /* _GL_CXXALIAS_SYS_CAST (func, rettype, parameters); 275*88e42b0fSchristos is like _GL_CXXALIAS_SYS (func, rettype, parameters); 276*88e42b0fSchristos except that the C function func may have a slightly different declaration. 277*88e42b0fSchristos A cast is used to silence the "invalid conversion" error that would 278*88e42b0fSchristos otherwise occur. */ 279*88e42b0fSchristos #if defined __cplusplus && defined GNULIB_NAMESPACE 280*88e42b0fSchristos # define _GL_CXXALIAS_SYS_CAST(func,rettype,parameters) \ 281*88e42b0fSchristos namespace GNULIB_NAMESPACE \ 282*88e42b0fSchristos { \ 283*88e42b0fSchristos static const struct _gl_ ## func ## _wrapper \ 284*88e42b0fSchristos { \ 285*88e42b0fSchristos typedef rettype (*type) parameters; \ 286*88e42b0fSchristos \ 287*88e42b0fSchristos inline operator type () const \ 288*88e42b0fSchristos { \ 289*88e42b0fSchristos return reinterpret_cast<type>(::func); \ 290*88e42b0fSchristos } \ 291*88e42b0fSchristos } func = {}; \ 292*88e42b0fSchristos } \ 293*88e42b0fSchristos _GL_EXTERN_C int _gl_cxxalias_dummy 294*88e42b0fSchristos #else 295*88e42b0fSchristos # define _GL_CXXALIAS_SYS_CAST(func,rettype,parameters) \ 296*88e42b0fSchristos _GL_EXTERN_C int _gl_cxxalias_dummy 297*88e42b0fSchristos #endif 298*88e42b0fSchristos 299*88e42b0fSchristos /* _GL_CXXALIAS_SYS_CAST2 (func, rettype, parameters, rettype2, parameters2); 300*88e42b0fSchristos is like _GL_CXXALIAS_SYS (func, rettype, parameters); 301*88e42b0fSchristos except that the C function is picked among a set of overloaded functions, 302*88e42b0fSchristos namely the one with rettype2 and parameters2. Two consecutive casts 303*88e42b0fSchristos are used to silence the "cannot find a match" and "invalid conversion" 304*88e42b0fSchristos errors that would otherwise occur. */ 305*88e42b0fSchristos #if defined __cplusplus && defined GNULIB_NAMESPACE 306*88e42b0fSchristos /* The outer cast must be a reinterpret_cast. 307*88e42b0fSchristos The inner cast: When the function is defined as a set of overloaded 308*88e42b0fSchristos functions, it works as a static_cast<>, choosing the designated variant. 309*88e42b0fSchristos When the function is defined as a single variant, it works as a 310*88e42b0fSchristos reinterpret_cast<>. The parenthesized cast syntax works both ways. */ 311*88e42b0fSchristos # define _GL_CXXALIAS_SYS_CAST2(func,rettype,parameters,rettype2,parameters2) \ 312*88e42b0fSchristos namespace GNULIB_NAMESPACE \ 313*88e42b0fSchristos { \ 314*88e42b0fSchristos static const struct _gl_ ## func ## _wrapper \ 315*88e42b0fSchristos { \ 316*88e42b0fSchristos typedef rettype (*type) parameters; \ 317*88e42b0fSchristos \ 318*88e42b0fSchristos inline operator type () const \ 319*88e42b0fSchristos { \ 320*88e42b0fSchristos return reinterpret_cast<type>((rettype2 (*) parameters2)(::func)); \ 321*88e42b0fSchristos } \ 322*88e42b0fSchristos } func = {}; \ 323*88e42b0fSchristos } \ 324*88e42b0fSchristos _GL_EXTERN_C int _gl_cxxalias_dummy 325*88e42b0fSchristos #else 326*88e42b0fSchristos # define _GL_CXXALIAS_SYS_CAST2(func,rettype,parameters,rettype2,parameters2) \ 327*88e42b0fSchristos _GL_EXTERN_C int _gl_cxxalias_dummy 328*88e42b0fSchristos #endif 329*88e42b0fSchristos 330*88e42b0fSchristos /* _GL_CXXALIASWARN (func); 331*88e42b0fSchristos causes a warning to be emitted when ::func is used but not when 332*88e42b0fSchristos GNULIB_NAMESPACE::func is used. func must be defined without overloaded 333*88e42b0fSchristos variants. */ 334*88e42b0fSchristos #if defined __cplusplus && defined GNULIB_NAMESPACE 335*88e42b0fSchristos # define _GL_CXXALIASWARN(func) \ 336*88e42b0fSchristos _GL_CXXALIASWARN_1 (func, GNULIB_NAMESPACE) 337*88e42b0fSchristos # define _GL_CXXALIASWARN_1(func,namespace) \ 338*88e42b0fSchristos _GL_CXXALIASWARN_2 (func, namespace) 339*88e42b0fSchristos /* To work around GCC bug <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=43881>, 340*88e42b0fSchristos we enable the warning only when not optimizing. */ 341*88e42b0fSchristos # if !__OPTIMIZE__ 342*88e42b0fSchristos # define _GL_CXXALIASWARN_2(func,namespace) \ 343*88e42b0fSchristos _GL_WARN_ON_USE (func, \ 344*88e42b0fSchristos "The symbol ::" #func " refers to the system function. " \ 345*88e42b0fSchristos "Use " #namespace "::" #func " instead.") 346*88e42b0fSchristos # elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING 347*88e42b0fSchristos # define _GL_CXXALIASWARN_2(func,namespace) \ 348*88e42b0fSchristos extern __typeof__ (func) func 349*88e42b0fSchristos # else 350*88e42b0fSchristos # define _GL_CXXALIASWARN_2(func,namespace) \ 351*88e42b0fSchristos _GL_EXTERN_C int _gl_cxxalias_dummy 352*88e42b0fSchristos # endif 353*88e42b0fSchristos #else 354*88e42b0fSchristos # define _GL_CXXALIASWARN(func) \ 355*88e42b0fSchristos _GL_EXTERN_C int _gl_cxxalias_dummy 356*88e42b0fSchristos #endif 357*88e42b0fSchristos 358*88e42b0fSchristos /* _GL_CXXALIASWARN1 (func, rettype, parameters_and_attributes); 359*88e42b0fSchristos causes a warning to be emitted when the given overloaded variant of ::func 360*88e42b0fSchristos is used but not when GNULIB_NAMESPACE::func is used. */ 361*88e42b0fSchristos #if defined __cplusplus && defined GNULIB_NAMESPACE 362*88e42b0fSchristos # define _GL_CXXALIASWARN1(func,rettype,parameters_and_attributes) \ 363*88e42b0fSchristos _GL_CXXALIASWARN1_1 (func, rettype, parameters_and_attributes, \ 364*88e42b0fSchristos GNULIB_NAMESPACE) 365*88e42b0fSchristos # define _GL_CXXALIASWARN1_1(func,rettype,parameters_and_attributes,namespace) \ 366*88e42b0fSchristos _GL_CXXALIASWARN1_2 (func, rettype, parameters_and_attributes, namespace) 367*88e42b0fSchristos /* To work around GCC bug <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=43881>, 368*88e42b0fSchristos we enable the warning only when not optimizing. */ 369*88e42b0fSchristos # if !__OPTIMIZE__ 370*88e42b0fSchristos # define _GL_CXXALIASWARN1_2(func,rettype,parameters_and_attributes,namespace) \ 371*88e42b0fSchristos _GL_WARN_ON_USE_CXX (func, rettype, parameters_and_attributes, \ 372*88e42b0fSchristos "The symbol ::" #func " refers to the system function. " \ 373*88e42b0fSchristos "Use " #namespace "::" #func " instead.") 374*88e42b0fSchristos # else 375*88e42b0fSchristos # define _GL_CXXALIASWARN1_2(func,rettype,parameters_and_attributes,namespace) \ 376*88e42b0fSchristos _GL_EXTERN_C int _gl_cxxalias_dummy 377*88e42b0fSchristos # endif 378*88e42b0fSchristos #else 379*88e42b0fSchristos # define _GL_CXXALIASWARN1(func,rettype,parameters_and_attributes) \ 380*88e42b0fSchristos _GL_EXTERN_C int _gl_cxxalias_dummy 381*88e42b0fSchristos #endif 382*88e42b0fSchristos 383*88e42b0fSchristos #endif /* _GL_CXXDEFS_H */ 384*88e42b0fSchristos 385*88e42b0fSchristos /* The definition of _GL_ARG_NONNULL is copied here. */ 386*88e42b0fSchristos /* A C macro for declaring that specific arguments must not be NULL. 387*88e42b0fSchristos Copyright (C) 2009-2020 Free Software Foundation, Inc. 388*88e42b0fSchristos 389*88e42b0fSchristos This program is free software: you can redistribute it and/or modify it 390*88e42b0fSchristos under the terms of the GNU General Public License as published 391*88e42b0fSchristos by the Free Software Foundation; either version 3 of the License, or 392*88e42b0fSchristos (at your option) any later version. 393*88e42b0fSchristos 394*88e42b0fSchristos This program is distributed in the hope that it will be useful, 395*88e42b0fSchristos but WITHOUT ANY WARRANTY; without even the implied warranty of 396*88e42b0fSchristos MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 397*88e42b0fSchristos General Public License for more details. 398*88e42b0fSchristos 399*88e42b0fSchristos You should have received a copy of the GNU General Public License 400*88e42b0fSchristos along with this program. If not, see <https://www.gnu.org/licenses/>. */ 401*88e42b0fSchristos 402*88e42b0fSchristos /* _GL_ARG_NONNULL((n,...,m)) tells the compiler and static analyzer tools 403*88e42b0fSchristos that the values passed as arguments n, ..., m must be non-NULL pointers. 404*88e42b0fSchristos n = 1 stands for the first argument, n = 2 for the second argument etc. */ 405*88e42b0fSchristos #ifndef _GL_ARG_NONNULL 406*88e42b0fSchristos # if (__GNUC__ == 3 && __GNUC_MINOR__ >= 3) || __GNUC__ > 3 407*88e42b0fSchristos # define _GL_ARG_NONNULL(params) __attribute__ ((__nonnull__ params)) 408*88e42b0fSchristos # else 409*88e42b0fSchristos # define _GL_ARG_NONNULL(params) 410*88e42b0fSchristos # endif 411*88e42b0fSchristos #endif 412*88e42b0fSchristos 413*88e42b0fSchristos /* The definition of _GL_WARN_ON_USE is copied here. */ 414*88e42b0fSchristos /* A C macro for emitting warnings if a function is used. 415*88e42b0fSchristos Copyright (C) 2010-2020 Free Software Foundation, Inc. 416*88e42b0fSchristos 417*88e42b0fSchristos This program is free software: you can redistribute it and/or modify it 418*88e42b0fSchristos under the terms of the GNU General Public License as published 419*88e42b0fSchristos by the Free Software Foundation; either version 3 of the License, or 420*88e42b0fSchristos (at your option) any later version. 421*88e42b0fSchristos 422*88e42b0fSchristos This program is distributed in the hope that it will be useful, 423*88e42b0fSchristos but WITHOUT ANY WARRANTY; without even the implied warranty of 424*88e42b0fSchristos MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 425*88e42b0fSchristos General Public License for more details. 426*88e42b0fSchristos 427*88e42b0fSchristos You should have received a copy of the GNU General Public License 428*88e42b0fSchristos along with this program. If not, see <https://www.gnu.org/licenses/>. */ 429*88e42b0fSchristos 430*88e42b0fSchristos /* _GL_WARN_ON_USE (function, "literal string") issues a declaration 431*88e42b0fSchristos for FUNCTION which will then trigger a compiler warning containing 432*88e42b0fSchristos the text of "literal string" anywhere that function is called, if 433*88e42b0fSchristos supported by the compiler. If the compiler does not support this 434*88e42b0fSchristos feature, the macro expands to an unused extern declaration. 435*88e42b0fSchristos 436*88e42b0fSchristos _GL_WARN_ON_USE_ATTRIBUTE ("literal string") expands to the 437*88e42b0fSchristos attribute used in _GL_WARN_ON_USE. If the compiler does not support 438*88e42b0fSchristos this feature, it expands to empty. 439*88e42b0fSchristos 440*88e42b0fSchristos These macros are useful for marking a function as a potential 441*88e42b0fSchristos portability trap, with the intent that "literal string" include 442*88e42b0fSchristos instructions on the replacement function that should be used 443*88e42b0fSchristos instead. 444*88e42b0fSchristos _GL_WARN_ON_USE is for functions with 'extern' linkage. 445*88e42b0fSchristos _GL_WARN_ON_USE_ATTRIBUTE is for functions with 'static' or 'inline' 446*88e42b0fSchristos linkage. 447*88e42b0fSchristos 448*88e42b0fSchristos However, one of the reasons that a function is a portability trap is 449*88e42b0fSchristos if it has the wrong signature. Declaring FUNCTION with a different 450*88e42b0fSchristos signature in C is a compilation error, so this macro must use the 451*88e42b0fSchristos same type as any existing declaration so that programs that avoid 452*88e42b0fSchristos the problematic FUNCTION do not fail to compile merely because they 453*88e42b0fSchristos included a header that poisoned the function. But this implies that 454*88e42b0fSchristos _GL_WARN_ON_USE is only safe to use if FUNCTION is known to already 455*88e42b0fSchristos have a declaration. Use of this macro implies that there must not 456*88e42b0fSchristos be any other macro hiding the declaration of FUNCTION; but 457*88e42b0fSchristos undefining FUNCTION first is part of the poisoning process anyway 458*88e42b0fSchristos (although for symbols that are provided only via a macro, the result 459*88e42b0fSchristos is a compilation error rather than a warning containing 460*88e42b0fSchristos "literal string"). Also note that in C++, it is only safe to use if 461*88e42b0fSchristos FUNCTION has no overloads. 462*88e42b0fSchristos 463*88e42b0fSchristos For an example, it is possible to poison 'getline' by: 464*88e42b0fSchristos - adding a call to gl_WARN_ON_USE_PREPARE([[#include <stdio.h>]], 465*88e42b0fSchristos [getline]) in configure.ac, which potentially defines 466*88e42b0fSchristos HAVE_RAW_DECL_GETLINE 467*88e42b0fSchristos - adding this code to a header that wraps the system <stdio.h>: 468*88e42b0fSchristos #undef getline 469*88e42b0fSchristos #if HAVE_RAW_DECL_GETLINE 470*88e42b0fSchristos _GL_WARN_ON_USE (getline, "getline is required by POSIX 2008, but" 471*88e42b0fSchristos "not universally present; use the gnulib module getline"); 472*88e42b0fSchristos #endif 473*88e42b0fSchristos 474*88e42b0fSchristos It is not possible to directly poison global variables. But it is 475*88e42b0fSchristos possible to write a wrapper accessor function, and poison that 476*88e42b0fSchristos (less common usage, like &environ, will cause a compilation error 477*88e42b0fSchristos rather than issue the nice warning, but the end result of informing 478*88e42b0fSchristos the developer about their portability problem is still achieved): 479*88e42b0fSchristos #if HAVE_RAW_DECL_ENVIRON 480*88e42b0fSchristos static char *** 481*88e42b0fSchristos rpl_environ (void) { return &environ; } 482*88e42b0fSchristos _GL_WARN_ON_USE (rpl_environ, "environ is not always properly declared"); 483*88e42b0fSchristos # undef environ 484*88e42b0fSchristos # define environ (*rpl_environ ()) 485*88e42b0fSchristos #endif 486*88e42b0fSchristos or better (avoiding contradictory use of 'static' and 'extern'): 487*88e42b0fSchristos #if HAVE_RAW_DECL_ENVIRON 488*88e42b0fSchristos static char *** 489*88e42b0fSchristos _GL_WARN_ON_USE_ATTRIBUTE ("environ is not always properly declared") 490*88e42b0fSchristos rpl_environ (void) { return &environ; } 491*88e42b0fSchristos # undef environ 492*88e42b0fSchristos # define environ (*rpl_environ ()) 493*88e42b0fSchristos #endif 494*88e42b0fSchristos */ 495*88e42b0fSchristos #ifndef _GL_WARN_ON_USE 496*88e42b0fSchristos 497*88e42b0fSchristos # if 4 < __GNUC__ || (__GNUC__ == 4 && 3 <= __GNUC_MINOR__) 498*88e42b0fSchristos /* A compiler attribute is available in gcc versions 4.3.0 and later. */ 499*88e42b0fSchristos # define _GL_WARN_ON_USE(function, message) \ 500*88e42b0fSchristos extern __typeof__ (function) function __attribute__ ((__warning__ (message))) 501*88e42b0fSchristos # define _GL_WARN_ON_USE_ATTRIBUTE(message) \ 502*88e42b0fSchristos __attribute__ ((__warning__ (message))) 503*88e42b0fSchristos # elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING 504*88e42b0fSchristos /* Verify the existence of the function. */ 505*88e42b0fSchristos # define _GL_WARN_ON_USE(function, message) \ 506*88e42b0fSchristos extern __typeof__ (function) function 507*88e42b0fSchristos # define _GL_WARN_ON_USE_ATTRIBUTE(message) 508*88e42b0fSchristos # else /* Unsupported. */ 509*88e42b0fSchristos # define _GL_WARN_ON_USE(function, message) \ 510*88e42b0fSchristos _GL_WARN_EXTERN_C int _gl_warn_on_use 511*88e42b0fSchristos # define _GL_WARN_ON_USE_ATTRIBUTE(message) 512*88e42b0fSchristos # endif 513*88e42b0fSchristos #endif 514*88e42b0fSchristos 515*88e42b0fSchristos /* _GL_WARN_ON_USE_CXX (function, rettype, parameters_and_attributes, "string") 516*88e42b0fSchristos is like _GL_WARN_ON_USE (function, "string"), except that in C++ mode the 517*88e42b0fSchristos function is declared with the given prototype, consisting of return type, 518*88e42b0fSchristos parameters, and attributes. 519*88e42b0fSchristos This variant is useful for overloaded functions in C++. _GL_WARN_ON_USE does 520*88e42b0fSchristos not work in this case. */ 521*88e42b0fSchristos #ifndef _GL_WARN_ON_USE_CXX 522*88e42b0fSchristos # if !defined __cplusplus 523*88e42b0fSchristos # define _GL_WARN_ON_USE_CXX(function,rettype,parameters_and_attributes,msg) \ 524*88e42b0fSchristos _GL_WARN_ON_USE (function, msg) 525*88e42b0fSchristos # else 526*88e42b0fSchristos # if 4 < __GNUC__ || (__GNUC__ == 4 && 3 <= __GNUC_MINOR__) 527*88e42b0fSchristos # define _GL_WARN_ON_USE_CXX(function,rettype,parameters_and_attributes,msg) \ 528*88e42b0fSchristos extern rettype function parameters_and_attributes \ 529*88e42b0fSchristos __attribute__ ((__warning__ (msg))) 530*88e42b0fSchristos # elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING 531*88e42b0fSchristos /* Verify the existence of the function. */ 532*88e42b0fSchristos # define _GL_WARN_ON_USE_CXX(function,rettype,parameters_and_attributes,msg) \ 533*88e42b0fSchristos extern rettype function parameters_and_attributes 534*88e42b0fSchristos # else /* Unsupported. */ 535*88e42b0fSchristos # define _GL_WARN_ON_USE_CXX(function,rettype,parameters_and_attributes,msg) \ 536*88e42b0fSchristos _GL_WARN_EXTERN_C int _gl_warn_on_use 537*88e42b0fSchristos # endif 538*88e42b0fSchristos # endif 539*88e42b0fSchristos #endif 540*88e42b0fSchristos 541*88e42b0fSchristos /* _GL_WARN_EXTERN_C declaration; 542*88e42b0fSchristos performs the declaration with C linkage. */ 543*88e42b0fSchristos #ifndef _GL_WARN_EXTERN_C 544*88e42b0fSchristos # if defined __cplusplus 545*88e42b0fSchristos # define _GL_WARN_EXTERN_C extern "C" 546*88e42b0fSchristos # else 547*88e42b0fSchristos # define _GL_WARN_EXTERN_C extern 548*88e42b0fSchristos # endif 549*88e42b0fSchristos #endif 550*88e42b0fSchristos 551*88e42b0fSchristos /* 7.8.1 Macros for format specifiers */ 552*88e42b0fSchristos 553*88e42b0fSchristos #if defined _TNS_R_TARGET 554*88e42b0fSchristos /* Tandem NonStop R series and compatible platforms released before 555*88e42b0fSchristos July 2005 support %Ld but not %lld. */ 556*88e42b0fSchristos # define _LONG_LONG_FORMAT_PREFIX "L" 557*88e42b0fSchristos #else 558*88e42b0fSchristos # define _LONG_LONG_FORMAT_PREFIX "ll" 559*88e42b0fSchristos #endif 560*88e42b0fSchristos 561*88e42b0fSchristos #if !defined PRId8 || 0 562*88e42b0fSchristos # undef PRId8 563*88e42b0fSchristos # ifdef INT8_MAX 564*88e42b0fSchristos # define PRId8 "d" 565*88e42b0fSchristos # endif 566*88e42b0fSchristos #endif 567*88e42b0fSchristos #if !defined PRIi8 || 0 568*88e42b0fSchristos # undef PRIi8 569*88e42b0fSchristos # ifdef INT8_MAX 570*88e42b0fSchristos # define PRIi8 "i" 571*88e42b0fSchristos # endif 572*88e42b0fSchristos #endif 573*88e42b0fSchristos #if !defined PRIo8 || 0 574*88e42b0fSchristos # undef PRIo8 575*88e42b0fSchristos # ifdef UINT8_MAX 576*88e42b0fSchristos # define PRIo8 "o" 577*88e42b0fSchristos # endif 578*88e42b0fSchristos #endif 579*88e42b0fSchristos #if !defined PRIu8 || 0 580*88e42b0fSchristos # undef PRIu8 581*88e42b0fSchristos # ifdef UINT8_MAX 582*88e42b0fSchristos # define PRIu8 "u" 583*88e42b0fSchristos # endif 584*88e42b0fSchristos #endif 585*88e42b0fSchristos #if !defined PRIx8 || 0 586*88e42b0fSchristos # undef PRIx8 587*88e42b0fSchristos # ifdef UINT8_MAX 588*88e42b0fSchristos # define PRIx8 "x" 589*88e42b0fSchristos # endif 590*88e42b0fSchristos #endif 591*88e42b0fSchristos #if !defined PRIX8 || 0 592*88e42b0fSchristos # undef PRIX8 593*88e42b0fSchristos # ifdef UINT8_MAX 594*88e42b0fSchristos # define PRIX8 "X" 595*88e42b0fSchristos # endif 596*88e42b0fSchristos #endif 597*88e42b0fSchristos #if !defined PRId16 || 0 598*88e42b0fSchristos # undef PRId16 599*88e42b0fSchristos # ifdef INT16_MAX 600*88e42b0fSchristos # define PRId16 "d" 601*88e42b0fSchristos # endif 602*88e42b0fSchristos #endif 603*88e42b0fSchristos #if !defined PRIi16 || 0 604*88e42b0fSchristos # undef PRIi16 605*88e42b0fSchristos # ifdef INT16_MAX 606*88e42b0fSchristos # define PRIi16 "i" 607*88e42b0fSchristos # endif 608*88e42b0fSchristos #endif 609*88e42b0fSchristos #if !defined PRIo16 || 0 610*88e42b0fSchristos # undef PRIo16 611*88e42b0fSchristos # ifdef UINT16_MAX 612*88e42b0fSchristos # define PRIo16 "o" 613*88e42b0fSchristos # endif 614*88e42b0fSchristos #endif 615*88e42b0fSchristos #if !defined PRIu16 || 0 616*88e42b0fSchristos # undef PRIu16 617*88e42b0fSchristos # ifdef UINT16_MAX 618*88e42b0fSchristos # define PRIu16 "u" 619*88e42b0fSchristos # endif 620*88e42b0fSchristos #endif 621*88e42b0fSchristos #if !defined PRIx16 || 0 622*88e42b0fSchristos # undef PRIx16 623*88e42b0fSchristos # ifdef UINT16_MAX 624*88e42b0fSchristos # define PRIx16 "x" 625*88e42b0fSchristos # endif 626*88e42b0fSchristos #endif 627*88e42b0fSchristos #if !defined PRIX16 || 0 628*88e42b0fSchristos # undef PRIX16 629*88e42b0fSchristos # ifdef UINT16_MAX 630*88e42b0fSchristos # define PRIX16 "X" 631*88e42b0fSchristos # endif 632*88e42b0fSchristos #endif 633*88e42b0fSchristos #if !defined PRId32 || 0 634*88e42b0fSchristos # undef PRId32 635*88e42b0fSchristos # ifdef INT32_MAX 636*88e42b0fSchristos # define PRId32 "d" 637*88e42b0fSchristos # endif 638*88e42b0fSchristos #endif 639*88e42b0fSchristos #if !defined PRIi32 || 0 640*88e42b0fSchristos # undef PRIi32 641*88e42b0fSchristos # ifdef INT32_MAX 642*88e42b0fSchristos # define PRIi32 "i" 643*88e42b0fSchristos # endif 644*88e42b0fSchristos #endif 645*88e42b0fSchristos #if !defined PRIo32 || 0 646*88e42b0fSchristos # undef PRIo32 647*88e42b0fSchristos # ifdef UINT32_MAX 648*88e42b0fSchristos # define PRIo32 "o" 649*88e42b0fSchristos # endif 650*88e42b0fSchristos #endif 651*88e42b0fSchristos #if !defined PRIu32 || 0 652*88e42b0fSchristos # undef PRIu32 653*88e42b0fSchristos # ifdef UINT32_MAX 654*88e42b0fSchristos # define PRIu32 "u" 655*88e42b0fSchristos # endif 656*88e42b0fSchristos #endif 657*88e42b0fSchristos #if !defined PRIx32 || 0 658*88e42b0fSchristos # undef PRIx32 659*88e42b0fSchristos # ifdef UINT32_MAX 660*88e42b0fSchristos # define PRIx32 "x" 661*88e42b0fSchristos # endif 662*88e42b0fSchristos #endif 663*88e42b0fSchristos #if !defined PRIX32 || 0 664*88e42b0fSchristos # undef PRIX32 665*88e42b0fSchristos # ifdef UINT32_MAX 666*88e42b0fSchristos # define PRIX32 "X" 667*88e42b0fSchristos # endif 668*88e42b0fSchristos #endif 669*88e42b0fSchristos #ifdef INT64_MAX 670*88e42b0fSchristos # if (0 ? defined _LP64 : 1) 671*88e42b0fSchristos # define _PRI64_PREFIX "l" 672*88e42b0fSchristos # elif defined _MSC_VER || defined __MINGW32__ 673*88e42b0fSchristos # define _PRI64_PREFIX "I64" 674*88e42b0fSchristos # elif LONG_MAX >> 30 == 1 675*88e42b0fSchristos # define _PRI64_PREFIX _LONG_LONG_FORMAT_PREFIX 676*88e42b0fSchristos # endif 677*88e42b0fSchristos # if !defined PRId64 || 0 678*88e42b0fSchristos # undef PRId64 679*88e42b0fSchristos # define PRId64 _PRI64_PREFIX "d" 680*88e42b0fSchristos # endif 681*88e42b0fSchristos # if !defined PRIi64 || 0 682*88e42b0fSchristos # undef PRIi64 683*88e42b0fSchristos # define PRIi64 _PRI64_PREFIX "i" 684*88e42b0fSchristos # endif 685*88e42b0fSchristos #endif 686*88e42b0fSchristos #ifdef UINT64_MAX 687*88e42b0fSchristos # if (0 ? defined _LP64 : 1) 688*88e42b0fSchristos # define _PRIu64_PREFIX "l" 689*88e42b0fSchristos # elif defined _MSC_VER || defined __MINGW32__ 690*88e42b0fSchristos # define _PRIu64_PREFIX "I64" 691*88e42b0fSchristos # elif ULONG_MAX >> 31 == 1 692*88e42b0fSchristos # define _PRIu64_PREFIX _LONG_LONG_FORMAT_PREFIX 693*88e42b0fSchristos # endif 694*88e42b0fSchristos # if !defined PRIo64 || 0 695*88e42b0fSchristos # undef PRIo64 696*88e42b0fSchristos # define PRIo64 _PRIu64_PREFIX "o" 697*88e42b0fSchristos # endif 698*88e42b0fSchristos # if !defined PRIu64 || 0 699*88e42b0fSchristos # undef PRIu64 700*88e42b0fSchristos # define PRIu64 _PRIu64_PREFIX "u" 701*88e42b0fSchristos # endif 702*88e42b0fSchristos # if !defined PRIx64 || 0 703*88e42b0fSchristos # undef PRIx64 704*88e42b0fSchristos # define PRIx64 _PRIu64_PREFIX "x" 705*88e42b0fSchristos # endif 706*88e42b0fSchristos # if !defined PRIX64 || 0 707*88e42b0fSchristos # undef PRIX64 708*88e42b0fSchristos # define PRIX64 _PRIu64_PREFIX "X" 709*88e42b0fSchristos # endif 710*88e42b0fSchristos #endif 711*88e42b0fSchristos 712*88e42b0fSchristos #if !defined PRIdLEAST8 || 0 713*88e42b0fSchristos # undef PRIdLEAST8 714*88e42b0fSchristos # define PRIdLEAST8 "d" 715*88e42b0fSchristos #endif 716*88e42b0fSchristos #if !defined PRIiLEAST8 || 0 717*88e42b0fSchristos # undef PRIiLEAST8 718*88e42b0fSchristos # define PRIiLEAST8 "i" 719*88e42b0fSchristos #endif 720*88e42b0fSchristos #if !defined PRIoLEAST8 || 0 721*88e42b0fSchristos # undef PRIoLEAST8 722*88e42b0fSchristos # define PRIoLEAST8 "o" 723*88e42b0fSchristos #endif 724*88e42b0fSchristos #if !defined PRIuLEAST8 || 0 725*88e42b0fSchristos # undef PRIuLEAST8 726*88e42b0fSchristos # define PRIuLEAST8 "u" 727*88e42b0fSchristos #endif 728*88e42b0fSchristos #if !defined PRIxLEAST8 || 0 729*88e42b0fSchristos # undef PRIxLEAST8 730*88e42b0fSchristos # define PRIxLEAST8 "x" 731*88e42b0fSchristos #endif 732*88e42b0fSchristos #if !defined PRIXLEAST8 || 0 733*88e42b0fSchristos # undef PRIXLEAST8 734*88e42b0fSchristos # define PRIXLEAST8 "X" 735*88e42b0fSchristos #endif 736*88e42b0fSchristos #if !defined PRIdLEAST16 || 0 737*88e42b0fSchristos # undef PRIdLEAST16 738*88e42b0fSchristos # define PRIdLEAST16 "d" 739*88e42b0fSchristos #endif 740*88e42b0fSchristos #if !defined PRIiLEAST16 || 0 741*88e42b0fSchristos # undef PRIiLEAST16 742*88e42b0fSchristos # define PRIiLEAST16 "i" 743*88e42b0fSchristos #endif 744*88e42b0fSchristos #if !defined PRIoLEAST16 || 0 745*88e42b0fSchristos # undef PRIoLEAST16 746*88e42b0fSchristos # define PRIoLEAST16 "o" 747*88e42b0fSchristos #endif 748*88e42b0fSchristos #if !defined PRIuLEAST16 || 0 749*88e42b0fSchristos # undef PRIuLEAST16 750*88e42b0fSchristos # define PRIuLEAST16 "u" 751*88e42b0fSchristos #endif 752*88e42b0fSchristos #if !defined PRIxLEAST16 || 0 753*88e42b0fSchristos # undef PRIxLEAST16 754*88e42b0fSchristos # define PRIxLEAST16 "x" 755*88e42b0fSchristos #endif 756*88e42b0fSchristos #if !defined PRIXLEAST16 || 0 757*88e42b0fSchristos # undef PRIXLEAST16 758*88e42b0fSchristos # define PRIXLEAST16 "X" 759*88e42b0fSchristos #endif 760*88e42b0fSchristos #if !defined PRIdLEAST32 || 0 761*88e42b0fSchristos # undef PRIdLEAST32 762*88e42b0fSchristos # define PRIdLEAST32 "d" 763*88e42b0fSchristos #endif 764*88e42b0fSchristos #if !defined PRIiLEAST32 || 0 765*88e42b0fSchristos # undef PRIiLEAST32 766*88e42b0fSchristos # define PRIiLEAST32 "i" 767*88e42b0fSchristos #endif 768*88e42b0fSchristos #if !defined PRIoLEAST32 || 0 769*88e42b0fSchristos # undef PRIoLEAST32 770*88e42b0fSchristos # define PRIoLEAST32 "o" 771*88e42b0fSchristos #endif 772*88e42b0fSchristos #if !defined PRIuLEAST32 || 0 773*88e42b0fSchristos # undef PRIuLEAST32 774*88e42b0fSchristos # define PRIuLEAST32 "u" 775*88e42b0fSchristos #endif 776*88e42b0fSchristos #if !defined PRIxLEAST32 || 0 777*88e42b0fSchristos # undef PRIxLEAST32 778*88e42b0fSchristos # define PRIxLEAST32 "x" 779*88e42b0fSchristos #endif 780*88e42b0fSchristos #if !defined PRIXLEAST32 || 0 781*88e42b0fSchristos # undef PRIXLEAST32 782*88e42b0fSchristos # define PRIXLEAST32 "X" 783*88e42b0fSchristos #endif 784*88e42b0fSchristos #ifdef INT64_MAX 785*88e42b0fSchristos # if !defined PRIdLEAST64 || 0 786*88e42b0fSchristos # undef PRIdLEAST64 787*88e42b0fSchristos # define PRIdLEAST64 PRId64 788*88e42b0fSchristos # endif 789*88e42b0fSchristos # if !defined PRIiLEAST64 || 0 790*88e42b0fSchristos # undef PRIiLEAST64 791*88e42b0fSchristos # define PRIiLEAST64 PRIi64 792*88e42b0fSchristos # endif 793*88e42b0fSchristos #endif 794*88e42b0fSchristos #ifdef UINT64_MAX 795*88e42b0fSchristos # if !defined PRIoLEAST64 || 0 796*88e42b0fSchristos # undef PRIoLEAST64 797*88e42b0fSchristos # define PRIoLEAST64 PRIo64 798*88e42b0fSchristos # endif 799*88e42b0fSchristos # if !defined PRIuLEAST64 || 0 800*88e42b0fSchristos # undef PRIuLEAST64 801*88e42b0fSchristos # define PRIuLEAST64 PRIu64 802*88e42b0fSchristos # endif 803*88e42b0fSchristos # if !defined PRIxLEAST64 || 0 804*88e42b0fSchristos # undef PRIxLEAST64 805*88e42b0fSchristos # define PRIxLEAST64 PRIx64 806*88e42b0fSchristos # endif 807*88e42b0fSchristos # if !defined PRIXLEAST64 || 0 808*88e42b0fSchristos # undef PRIXLEAST64 809*88e42b0fSchristos # define PRIXLEAST64 PRIX64 810*88e42b0fSchristos # endif 811*88e42b0fSchristos #endif 812*88e42b0fSchristos 813*88e42b0fSchristos #if !defined PRIdFAST8 || 0 814*88e42b0fSchristos # undef PRIdFAST8 815*88e42b0fSchristos # if INT_FAST8_MAX > INT32_MAX 816*88e42b0fSchristos # define PRIdFAST8 PRId64 817*88e42b0fSchristos # else 818*88e42b0fSchristos # define PRIdFAST8 "d" 819*88e42b0fSchristos # endif 820*88e42b0fSchristos #endif 821*88e42b0fSchristos #if !defined PRIiFAST8 || 0 822*88e42b0fSchristos # undef PRIiFAST8 823*88e42b0fSchristos # if INT_FAST8_MAX > INT32_MAX 824*88e42b0fSchristos # define PRIiFAST8 PRIi64 825*88e42b0fSchristos # else 826*88e42b0fSchristos # define PRIiFAST8 "i" 827*88e42b0fSchristos # endif 828*88e42b0fSchristos #endif 829*88e42b0fSchristos #if !defined PRIoFAST8 || 0 830*88e42b0fSchristos # undef PRIoFAST8 831*88e42b0fSchristos # if UINT_FAST8_MAX > UINT32_MAX 832*88e42b0fSchristos # define PRIoFAST8 PRIo64 833*88e42b0fSchristos # else 834*88e42b0fSchristos # define PRIoFAST8 "o" 835*88e42b0fSchristos # endif 836*88e42b0fSchristos #endif 837*88e42b0fSchristos #if !defined PRIuFAST8 || 0 838*88e42b0fSchristos # undef PRIuFAST8 839*88e42b0fSchristos # if UINT_FAST8_MAX > UINT32_MAX 840*88e42b0fSchristos # define PRIuFAST8 PRIu64 841*88e42b0fSchristos # else 842*88e42b0fSchristos # define PRIuFAST8 "u" 843*88e42b0fSchristos # endif 844*88e42b0fSchristos #endif 845*88e42b0fSchristos #if !defined PRIxFAST8 || 0 846*88e42b0fSchristos # undef PRIxFAST8 847*88e42b0fSchristos # if UINT_FAST8_MAX > UINT32_MAX 848*88e42b0fSchristos # define PRIxFAST8 PRIx64 849*88e42b0fSchristos # else 850*88e42b0fSchristos # define PRIxFAST8 "x" 851*88e42b0fSchristos # endif 852*88e42b0fSchristos #endif 853*88e42b0fSchristos #if !defined PRIXFAST8 || 0 854*88e42b0fSchristos # undef PRIXFAST8 855*88e42b0fSchristos # if UINT_FAST8_MAX > UINT32_MAX 856*88e42b0fSchristos # define PRIXFAST8 PRIX64 857*88e42b0fSchristos # else 858*88e42b0fSchristos # define PRIXFAST8 "X" 859*88e42b0fSchristos # endif 860*88e42b0fSchristos #endif 861*88e42b0fSchristos #if !defined PRIdFAST16 || 0 862*88e42b0fSchristos # undef PRIdFAST16 863*88e42b0fSchristos # if INT_FAST16_MAX > INT32_MAX 864*88e42b0fSchristos # define PRIdFAST16 PRId64 865*88e42b0fSchristos # else 866*88e42b0fSchristos # define PRIdFAST16 "d" 867*88e42b0fSchristos # endif 868*88e42b0fSchristos #endif 869*88e42b0fSchristos #if !defined PRIiFAST16 || 0 870*88e42b0fSchristos # undef PRIiFAST16 871*88e42b0fSchristos # if INT_FAST16_MAX > INT32_MAX 872*88e42b0fSchristos # define PRIiFAST16 PRIi64 873*88e42b0fSchristos # else 874*88e42b0fSchristos # define PRIiFAST16 "i" 875*88e42b0fSchristos # endif 876*88e42b0fSchristos #endif 877*88e42b0fSchristos #if !defined PRIoFAST16 || 0 878*88e42b0fSchristos # undef PRIoFAST16 879*88e42b0fSchristos # if UINT_FAST16_MAX > UINT32_MAX 880*88e42b0fSchristos # define PRIoFAST16 PRIo64 881*88e42b0fSchristos # else 882*88e42b0fSchristos # define PRIoFAST16 "o" 883*88e42b0fSchristos # endif 884*88e42b0fSchristos #endif 885*88e42b0fSchristos #if !defined PRIuFAST16 || 0 886*88e42b0fSchristos # undef PRIuFAST16 887*88e42b0fSchristos # if UINT_FAST16_MAX > UINT32_MAX 888*88e42b0fSchristos # define PRIuFAST16 PRIu64 889*88e42b0fSchristos # else 890*88e42b0fSchristos # define PRIuFAST16 "u" 891*88e42b0fSchristos # endif 892*88e42b0fSchristos #endif 893*88e42b0fSchristos #if !defined PRIxFAST16 || 0 894*88e42b0fSchristos # undef PRIxFAST16 895*88e42b0fSchristos # if UINT_FAST16_MAX > UINT32_MAX 896*88e42b0fSchristos # define PRIxFAST16 PRIx64 897*88e42b0fSchristos # else 898*88e42b0fSchristos # define PRIxFAST16 "x" 899*88e42b0fSchristos # endif 900*88e42b0fSchristos #endif 901*88e42b0fSchristos #if !defined PRIXFAST16 || 0 902*88e42b0fSchristos # undef PRIXFAST16 903*88e42b0fSchristos # if UINT_FAST16_MAX > UINT32_MAX 904*88e42b0fSchristos # define PRIXFAST16 PRIX64 905*88e42b0fSchristos # else 906*88e42b0fSchristos # define PRIXFAST16 "X" 907*88e42b0fSchristos # endif 908*88e42b0fSchristos #endif 909*88e42b0fSchristos #if !defined PRIdFAST32 || 0 910*88e42b0fSchristos # undef PRIdFAST32 911*88e42b0fSchristos # if INT_FAST32_MAX > INT32_MAX 912*88e42b0fSchristos # define PRIdFAST32 PRId64 913*88e42b0fSchristos # else 914*88e42b0fSchristos # define PRIdFAST32 "d" 915*88e42b0fSchristos # endif 916*88e42b0fSchristos #endif 917*88e42b0fSchristos #if !defined PRIiFAST32 || 0 918*88e42b0fSchristos # undef PRIiFAST32 919*88e42b0fSchristos # if INT_FAST32_MAX > INT32_MAX 920*88e42b0fSchristos # define PRIiFAST32 PRIi64 921*88e42b0fSchristos # else 922*88e42b0fSchristos # define PRIiFAST32 "i" 923*88e42b0fSchristos # endif 924*88e42b0fSchristos #endif 925*88e42b0fSchristos #if !defined PRIoFAST32 || 0 926*88e42b0fSchristos # undef PRIoFAST32 927*88e42b0fSchristos # if UINT_FAST32_MAX > UINT32_MAX 928*88e42b0fSchristos # define PRIoFAST32 PRIo64 929*88e42b0fSchristos # else 930*88e42b0fSchristos # define PRIoFAST32 "o" 931*88e42b0fSchristos # endif 932*88e42b0fSchristos #endif 933*88e42b0fSchristos #if !defined PRIuFAST32 || 0 934*88e42b0fSchristos # undef PRIuFAST32 935*88e42b0fSchristos # if UINT_FAST32_MAX > UINT32_MAX 936*88e42b0fSchristos # define PRIuFAST32 PRIu64 937*88e42b0fSchristos # else 938*88e42b0fSchristos # define PRIuFAST32 "u" 939*88e42b0fSchristos # endif 940*88e42b0fSchristos #endif 941*88e42b0fSchristos #if !defined PRIxFAST32 || 0 942*88e42b0fSchristos # undef PRIxFAST32 943*88e42b0fSchristos # if UINT_FAST32_MAX > UINT32_MAX 944*88e42b0fSchristos # define PRIxFAST32 PRIx64 945*88e42b0fSchristos # else 946*88e42b0fSchristos # define PRIxFAST32 "x" 947*88e42b0fSchristos # endif 948*88e42b0fSchristos #endif 949*88e42b0fSchristos #if !defined PRIXFAST32 || 0 950*88e42b0fSchristos # undef PRIXFAST32 951*88e42b0fSchristos # if UINT_FAST32_MAX > UINT32_MAX 952*88e42b0fSchristos # define PRIXFAST32 PRIX64 953*88e42b0fSchristos # else 954*88e42b0fSchristos # define PRIXFAST32 "X" 955*88e42b0fSchristos # endif 956*88e42b0fSchristos #endif 957*88e42b0fSchristos #ifdef INT64_MAX 958*88e42b0fSchristos # if !defined PRIdFAST64 || 0 959*88e42b0fSchristos # undef PRIdFAST64 960*88e42b0fSchristos # define PRIdFAST64 PRId64 961*88e42b0fSchristos # endif 962*88e42b0fSchristos # if !defined PRIiFAST64 || 0 963*88e42b0fSchristos # undef PRIiFAST64 964*88e42b0fSchristos # define PRIiFAST64 PRIi64 965*88e42b0fSchristos # endif 966*88e42b0fSchristos #endif 967*88e42b0fSchristos #ifdef UINT64_MAX 968*88e42b0fSchristos # if !defined PRIoFAST64 || 0 969*88e42b0fSchristos # undef PRIoFAST64 970*88e42b0fSchristos # define PRIoFAST64 PRIo64 971*88e42b0fSchristos # endif 972*88e42b0fSchristos # if !defined PRIuFAST64 || 0 973*88e42b0fSchristos # undef PRIuFAST64 974*88e42b0fSchristos # define PRIuFAST64 PRIu64 975*88e42b0fSchristos # endif 976*88e42b0fSchristos # if !defined PRIxFAST64 || 0 977*88e42b0fSchristos # undef PRIxFAST64 978*88e42b0fSchristos # define PRIxFAST64 PRIx64 979*88e42b0fSchristos # endif 980*88e42b0fSchristos # if !defined PRIXFAST64 || 0 981*88e42b0fSchristos # undef PRIXFAST64 982*88e42b0fSchristos # define PRIXFAST64 PRIX64 983*88e42b0fSchristos # endif 984*88e42b0fSchristos #endif 985*88e42b0fSchristos 986*88e42b0fSchristos #if !defined PRIdMAX || 0 987*88e42b0fSchristos # undef PRIdMAX 988*88e42b0fSchristos # if 1 989*88e42b0fSchristos # define PRIdMAX PRId64 990*88e42b0fSchristos # else 991*88e42b0fSchristos # define PRIdMAX "ld" 992*88e42b0fSchristos # endif 993*88e42b0fSchristos #endif 994*88e42b0fSchristos #if !defined PRIiMAX || 0 995*88e42b0fSchristos # undef PRIiMAX 996*88e42b0fSchristos # if 1 997*88e42b0fSchristos # define PRIiMAX PRIi64 998*88e42b0fSchristos # else 999*88e42b0fSchristos # define PRIiMAX "li" 1000*88e42b0fSchristos # endif 1001*88e42b0fSchristos #endif 1002*88e42b0fSchristos #if !defined PRIoMAX || 0 1003*88e42b0fSchristos # undef PRIoMAX 1004*88e42b0fSchristos # if 1 1005*88e42b0fSchristos # define PRIoMAX PRIo64 1006*88e42b0fSchristos # else 1007*88e42b0fSchristos # define PRIoMAX "lo" 1008*88e42b0fSchristos # endif 1009*88e42b0fSchristos #endif 1010*88e42b0fSchristos #if !defined PRIuMAX || 0 1011*88e42b0fSchristos # undef PRIuMAX 1012*88e42b0fSchristos # if 1 1013*88e42b0fSchristos # define PRIuMAX PRIu64 1014*88e42b0fSchristos # else 1015*88e42b0fSchristos # define PRIuMAX "lu" 1016*88e42b0fSchristos # endif 1017*88e42b0fSchristos #endif 1018*88e42b0fSchristos #if !defined PRIxMAX || 0 1019*88e42b0fSchristos # undef PRIxMAX 1020*88e42b0fSchristos # if 1 1021*88e42b0fSchristos # define PRIxMAX PRIx64 1022*88e42b0fSchristos # else 1023*88e42b0fSchristos # define PRIxMAX "lx" 1024*88e42b0fSchristos # endif 1025*88e42b0fSchristos #endif 1026*88e42b0fSchristos #if !defined PRIXMAX || 0 1027*88e42b0fSchristos # undef PRIXMAX 1028*88e42b0fSchristos # if 1 1029*88e42b0fSchristos # define PRIXMAX PRIX64 1030*88e42b0fSchristos # else 1031*88e42b0fSchristos # define PRIXMAX "lX" 1032*88e42b0fSchristos # endif 1033*88e42b0fSchristos #endif 1034*88e42b0fSchristos 1035*88e42b0fSchristos #if !defined PRIdPTR || 0 1036*88e42b0fSchristos # undef PRIdPTR 1037*88e42b0fSchristos # ifdef INTPTR_MAX 1038*88e42b0fSchristos # define PRIdPTR "l" "d" 1039*88e42b0fSchristos # endif 1040*88e42b0fSchristos #endif 1041*88e42b0fSchristos #if !defined PRIiPTR || 0 1042*88e42b0fSchristos # undef PRIiPTR 1043*88e42b0fSchristos # ifdef INTPTR_MAX 1044*88e42b0fSchristos # define PRIiPTR "l" "i" 1045*88e42b0fSchristos # endif 1046*88e42b0fSchristos #endif 1047*88e42b0fSchristos #if !defined PRIoPTR || 0 1048*88e42b0fSchristos # undef PRIoPTR 1049*88e42b0fSchristos # ifdef UINTPTR_MAX 1050*88e42b0fSchristos # define PRIoPTR "l" "o" 1051*88e42b0fSchristos # endif 1052*88e42b0fSchristos #endif 1053*88e42b0fSchristos #if !defined PRIuPTR || 0 1054*88e42b0fSchristos # undef PRIuPTR 1055*88e42b0fSchristos # ifdef UINTPTR_MAX 1056*88e42b0fSchristos # define PRIuPTR "l" "u" 1057*88e42b0fSchristos # endif 1058*88e42b0fSchristos #endif 1059*88e42b0fSchristos #if !defined PRIxPTR || 0 1060*88e42b0fSchristos # undef PRIxPTR 1061*88e42b0fSchristos # ifdef UINTPTR_MAX 1062*88e42b0fSchristos # define PRIxPTR "l" "x" 1063*88e42b0fSchristos # endif 1064*88e42b0fSchristos #endif 1065*88e42b0fSchristos #if !defined PRIXPTR || 0 1066*88e42b0fSchristos # undef PRIXPTR 1067*88e42b0fSchristos # ifdef UINTPTR_MAX 1068*88e42b0fSchristos # define PRIXPTR "l" "X" 1069*88e42b0fSchristos # endif 1070*88e42b0fSchristos #endif 1071*88e42b0fSchristos 1072*88e42b0fSchristos #if !defined SCNd8 || 0 1073*88e42b0fSchristos # undef SCNd8 1074*88e42b0fSchristos # ifdef INT8_MAX 1075*88e42b0fSchristos # define SCNd8 "hhd" 1076*88e42b0fSchristos # endif 1077*88e42b0fSchristos #endif 1078*88e42b0fSchristos #if !defined SCNi8 || 0 1079*88e42b0fSchristos # undef SCNi8 1080*88e42b0fSchristos # ifdef INT8_MAX 1081*88e42b0fSchristos # define SCNi8 "hhi" 1082*88e42b0fSchristos # endif 1083*88e42b0fSchristos #endif 1084*88e42b0fSchristos #if !defined SCNo8 || 0 1085*88e42b0fSchristos # undef SCNo8 1086*88e42b0fSchristos # ifdef UINT8_MAX 1087*88e42b0fSchristos # define SCNo8 "hho" 1088*88e42b0fSchristos # endif 1089*88e42b0fSchristos #endif 1090*88e42b0fSchristos #if !defined SCNu8 || 0 1091*88e42b0fSchristos # undef SCNu8 1092*88e42b0fSchristos # ifdef UINT8_MAX 1093*88e42b0fSchristos # define SCNu8 "hhu" 1094*88e42b0fSchristos # endif 1095*88e42b0fSchristos #endif 1096*88e42b0fSchristos #if !defined SCNx8 || 0 1097*88e42b0fSchristos # undef SCNx8 1098*88e42b0fSchristos # ifdef UINT8_MAX 1099*88e42b0fSchristos # define SCNx8 "hhx" 1100*88e42b0fSchristos # endif 1101*88e42b0fSchristos #endif 1102*88e42b0fSchristos #if !defined SCNd16 || 0 1103*88e42b0fSchristos # undef SCNd16 1104*88e42b0fSchristos # ifdef INT16_MAX 1105*88e42b0fSchristos # define SCNd16 "hd" 1106*88e42b0fSchristos # endif 1107*88e42b0fSchristos #endif 1108*88e42b0fSchristos #if !defined SCNi16 || 0 1109*88e42b0fSchristos # undef SCNi16 1110*88e42b0fSchristos # ifdef INT16_MAX 1111*88e42b0fSchristos # define SCNi16 "hi" 1112*88e42b0fSchristos # endif 1113*88e42b0fSchristos #endif 1114*88e42b0fSchristos #if !defined SCNo16 || 0 1115*88e42b0fSchristos # undef SCNo16 1116*88e42b0fSchristos # ifdef UINT16_MAX 1117*88e42b0fSchristos # define SCNo16 "ho" 1118*88e42b0fSchristos # endif 1119*88e42b0fSchristos #endif 1120*88e42b0fSchristos #if !defined SCNu16 || 0 1121*88e42b0fSchristos # undef SCNu16 1122*88e42b0fSchristos # ifdef UINT16_MAX 1123*88e42b0fSchristos # define SCNu16 "hu" 1124*88e42b0fSchristos # endif 1125*88e42b0fSchristos #endif 1126*88e42b0fSchristos #if !defined SCNx16 || 0 1127*88e42b0fSchristos # undef SCNx16 1128*88e42b0fSchristos # ifdef UINT16_MAX 1129*88e42b0fSchristos # define SCNx16 "hx" 1130*88e42b0fSchristos # endif 1131*88e42b0fSchristos #endif 1132*88e42b0fSchristos #if !defined SCNd32 || 0 1133*88e42b0fSchristos # undef SCNd32 1134*88e42b0fSchristos # ifdef INT32_MAX 1135*88e42b0fSchristos # define SCNd32 "d" 1136*88e42b0fSchristos # endif 1137*88e42b0fSchristos #endif 1138*88e42b0fSchristos #if !defined SCNi32 || 0 1139*88e42b0fSchristos # undef SCNi32 1140*88e42b0fSchristos # ifdef INT32_MAX 1141*88e42b0fSchristos # define SCNi32 "i" 1142*88e42b0fSchristos # endif 1143*88e42b0fSchristos #endif 1144*88e42b0fSchristos #if !defined SCNo32 || 0 1145*88e42b0fSchristos # undef SCNo32 1146*88e42b0fSchristos # ifdef UINT32_MAX 1147*88e42b0fSchristos # define SCNo32 "o" 1148*88e42b0fSchristos # endif 1149*88e42b0fSchristos #endif 1150*88e42b0fSchristos #if !defined SCNu32 || 0 1151*88e42b0fSchristos # undef SCNu32 1152*88e42b0fSchristos # ifdef UINT32_MAX 1153*88e42b0fSchristos # define SCNu32 "u" 1154*88e42b0fSchristos # endif 1155*88e42b0fSchristos #endif 1156*88e42b0fSchristos #if !defined SCNx32 || 0 1157*88e42b0fSchristos # undef SCNx32 1158*88e42b0fSchristos # ifdef UINT32_MAX 1159*88e42b0fSchristos # define SCNx32 "x" 1160*88e42b0fSchristos # endif 1161*88e42b0fSchristos #endif 1162*88e42b0fSchristos #ifdef INT64_MAX 1163*88e42b0fSchristos # if (0 ? defined _LP64 : 1) 1164*88e42b0fSchristos # define _SCN64_PREFIX "l" 1165*88e42b0fSchristos # elif defined _MSC_VER || defined __MINGW32__ 1166*88e42b0fSchristos # define _SCN64_PREFIX "I64" 1167*88e42b0fSchristos # elif LONG_MAX >> 30 == 1 1168*88e42b0fSchristos # define _SCN64_PREFIX _LONG_LONG_FORMAT_PREFIX 1169*88e42b0fSchristos # endif 1170*88e42b0fSchristos # if !defined SCNd64 || 0 1171*88e42b0fSchristos # undef SCNd64 1172*88e42b0fSchristos # define SCNd64 _SCN64_PREFIX "d" 1173*88e42b0fSchristos # endif 1174*88e42b0fSchristos # if !defined SCNi64 || 0 1175*88e42b0fSchristos # undef SCNi64 1176*88e42b0fSchristos # define SCNi64 _SCN64_PREFIX "i" 1177*88e42b0fSchristos # endif 1178*88e42b0fSchristos #endif 1179*88e42b0fSchristos #ifdef UINT64_MAX 1180*88e42b0fSchristos # if (0 ? defined _LP64 : 1) 1181*88e42b0fSchristos # define _SCNu64_PREFIX "l" 1182*88e42b0fSchristos # elif defined _MSC_VER || defined __MINGW32__ 1183*88e42b0fSchristos # define _SCNu64_PREFIX "I64" 1184*88e42b0fSchristos # elif ULONG_MAX >> 31 == 1 1185*88e42b0fSchristos # define _SCNu64_PREFIX _LONG_LONG_FORMAT_PREFIX 1186*88e42b0fSchristos # endif 1187*88e42b0fSchristos # if !defined SCNo64 || 0 1188*88e42b0fSchristos # undef SCNo64 1189*88e42b0fSchristos # define SCNo64 _SCNu64_PREFIX "o" 1190*88e42b0fSchristos # endif 1191*88e42b0fSchristos # if !defined SCNu64 || 0 1192*88e42b0fSchristos # undef SCNu64 1193*88e42b0fSchristos # define SCNu64 _SCNu64_PREFIX "u" 1194*88e42b0fSchristos # endif 1195*88e42b0fSchristos # if !defined SCNx64 || 0 1196*88e42b0fSchristos # undef SCNx64 1197*88e42b0fSchristos # define SCNx64 _SCNu64_PREFIX "x" 1198*88e42b0fSchristos # endif 1199*88e42b0fSchristos #endif 1200*88e42b0fSchristos 1201*88e42b0fSchristos #if !defined SCNdLEAST8 || 0 1202*88e42b0fSchristos # undef SCNdLEAST8 1203*88e42b0fSchristos # define SCNdLEAST8 "hhd" 1204*88e42b0fSchristos #endif 1205*88e42b0fSchristos #if !defined SCNiLEAST8 || 0 1206*88e42b0fSchristos # undef SCNiLEAST8 1207*88e42b0fSchristos # define SCNiLEAST8 "hhi" 1208*88e42b0fSchristos #endif 1209*88e42b0fSchristos #if !defined SCNoLEAST8 || 0 1210*88e42b0fSchristos # undef SCNoLEAST8 1211*88e42b0fSchristos # define SCNoLEAST8 "hho" 1212*88e42b0fSchristos #endif 1213*88e42b0fSchristos #if !defined SCNuLEAST8 || 0 1214*88e42b0fSchristos # undef SCNuLEAST8 1215*88e42b0fSchristos # define SCNuLEAST8 "hhu" 1216*88e42b0fSchristos #endif 1217*88e42b0fSchristos #if !defined SCNxLEAST8 || 0 1218*88e42b0fSchristos # undef SCNxLEAST8 1219*88e42b0fSchristos # define SCNxLEAST8 "hhx" 1220*88e42b0fSchristos #endif 1221*88e42b0fSchristos #if !defined SCNdLEAST16 || 0 1222*88e42b0fSchristos # undef SCNdLEAST16 1223*88e42b0fSchristos # define SCNdLEAST16 "hd" 1224*88e42b0fSchristos #endif 1225*88e42b0fSchristos #if !defined SCNiLEAST16 || 0 1226*88e42b0fSchristos # undef SCNiLEAST16 1227*88e42b0fSchristos # define SCNiLEAST16 "hi" 1228*88e42b0fSchristos #endif 1229*88e42b0fSchristos #if !defined SCNoLEAST16 || 0 1230*88e42b0fSchristos # undef SCNoLEAST16 1231*88e42b0fSchristos # define SCNoLEAST16 "ho" 1232*88e42b0fSchristos #endif 1233*88e42b0fSchristos #if !defined SCNuLEAST16 || 0 1234*88e42b0fSchristos # undef SCNuLEAST16 1235*88e42b0fSchristos # define SCNuLEAST16 "hu" 1236*88e42b0fSchristos #endif 1237*88e42b0fSchristos #if !defined SCNxLEAST16 || 0 1238*88e42b0fSchristos # undef SCNxLEAST16 1239*88e42b0fSchristos # define SCNxLEAST16 "hx" 1240*88e42b0fSchristos #endif 1241*88e42b0fSchristos #if !defined SCNdLEAST32 || 0 1242*88e42b0fSchristos # undef SCNdLEAST32 1243*88e42b0fSchristos # define SCNdLEAST32 "d" 1244*88e42b0fSchristos #endif 1245*88e42b0fSchristos #if !defined SCNiLEAST32 || 0 1246*88e42b0fSchristos # undef SCNiLEAST32 1247*88e42b0fSchristos # define SCNiLEAST32 "i" 1248*88e42b0fSchristos #endif 1249*88e42b0fSchristos #if !defined SCNoLEAST32 || 0 1250*88e42b0fSchristos # undef SCNoLEAST32 1251*88e42b0fSchristos # define SCNoLEAST32 "o" 1252*88e42b0fSchristos #endif 1253*88e42b0fSchristos #if !defined SCNuLEAST32 || 0 1254*88e42b0fSchristos # undef SCNuLEAST32 1255*88e42b0fSchristos # define SCNuLEAST32 "u" 1256*88e42b0fSchristos #endif 1257*88e42b0fSchristos #if !defined SCNxLEAST32 || 0 1258*88e42b0fSchristos # undef SCNxLEAST32 1259*88e42b0fSchristos # define SCNxLEAST32 "x" 1260*88e42b0fSchristos #endif 1261*88e42b0fSchristos #ifdef INT64_MAX 1262*88e42b0fSchristos # if !defined SCNdLEAST64 || 0 1263*88e42b0fSchristos # undef SCNdLEAST64 1264*88e42b0fSchristos # define SCNdLEAST64 SCNd64 1265*88e42b0fSchristos # endif 1266*88e42b0fSchristos # if !defined SCNiLEAST64 || 0 1267*88e42b0fSchristos # undef SCNiLEAST64 1268*88e42b0fSchristos # define SCNiLEAST64 SCNi64 1269*88e42b0fSchristos # endif 1270*88e42b0fSchristos #endif 1271*88e42b0fSchristos #ifdef UINT64_MAX 1272*88e42b0fSchristos # if !defined SCNoLEAST64 || 0 1273*88e42b0fSchristos # undef SCNoLEAST64 1274*88e42b0fSchristos # define SCNoLEAST64 SCNo64 1275*88e42b0fSchristos # endif 1276*88e42b0fSchristos # if !defined SCNuLEAST64 || 0 1277*88e42b0fSchristos # undef SCNuLEAST64 1278*88e42b0fSchristos # define SCNuLEAST64 SCNu64 1279*88e42b0fSchristos # endif 1280*88e42b0fSchristos # if !defined SCNxLEAST64 || 0 1281*88e42b0fSchristos # undef SCNxLEAST64 1282*88e42b0fSchristos # define SCNxLEAST64 SCNx64 1283*88e42b0fSchristos # endif 1284*88e42b0fSchristos #endif 1285*88e42b0fSchristos 1286*88e42b0fSchristos #if !defined SCNdFAST8 || 0 1287*88e42b0fSchristos # undef SCNdFAST8 1288*88e42b0fSchristos # if INT_FAST8_MAX > INT32_MAX 1289*88e42b0fSchristos # define SCNdFAST8 SCNd64 1290*88e42b0fSchristos # elif INT_FAST8_MAX == 0x7fff 1291*88e42b0fSchristos # define SCNdFAST8 "hd" 1292*88e42b0fSchristos # elif INT_FAST8_MAX == 0x7f 1293*88e42b0fSchristos # define SCNdFAST8 "hhd" 1294*88e42b0fSchristos # else 1295*88e42b0fSchristos # define SCNdFAST8 "d" 1296*88e42b0fSchristos # endif 1297*88e42b0fSchristos #endif 1298*88e42b0fSchristos #if !defined SCNiFAST8 || 0 1299*88e42b0fSchristos # undef SCNiFAST8 1300*88e42b0fSchristos # if INT_FAST8_MAX > INT32_MAX 1301*88e42b0fSchristos # define SCNiFAST8 SCNi64 1302*88e42b0fSchristos # elif INT_FAST8_MAX == 0x7fff 1303*88e42b0fSchristos # define SCNiFAST8 "hi" 1304*88e42b0fSchristos # elif INT_FAST8_MAX == 0x7f 1305*88e42b0fSchristos # define SCNiFAST8 "hhi" 1306*88e42b0fSchristos # else 1307*88e42b0fSchristos # define SCNiFAST8 "i" 1308*88e42b0fSchristos # endif 1309*88e42b0fSchristos #endif 1310*88e42b0fSchristos #if !defined SCNoFAST8 || 0 1311*88e42b0fSchristos # undef SCNoFAST8 1312*88e42b0fSchristos # if UINT_FAST8_MAX > UINT32_MAX 1313*88e42b0fSchristos # define SCNoFAST8 SCNo64 1314*88e42b0fSchristos # elif UINT_FAST8_MAX == 0xffff 1315*88e42b0fSchristos # define SCNoFAST8 "ho" 1316*88e42b0fSchristos # elif UINT_FAST8_MAX == 0xff 1317*88e42b0fSchristos # define SCNoFAST8 "hho" 1318*88e42b0fSchristos # else 1319*88e42b0fSchristos # define SCNoFAST8 "o" 1320*88e42b0fSchristos # endif 1321*88e42b0fSchristos #endif 1322*88e42b0fSchristos #if !defined SCNuFAST8 || 0 1323*88e42b0fSchristos # undef SCNuFAST8 1324*88e42b0fSchristos # if UINT_FAST8_MAX > UINT32_MAX 1325*88e42b0fSchristos # define SCNuFAST8 SCNu64 1326*88e42b0fSchristos # elif UINT_FAST8_MAX == 0xffff 1327*88e42b0fSchristos # define SCNuFAST8 "hu" 1328*88e42b0fSchristos # elif UINT_FAST8_MAX == 0xff 1329*88e42b0fSchristos # define SCNuFAST8 "hhu" 1330*88e42b0fSchristos # else 1331*88e42b0fSchristos # define SCNuFAST8 "u" 1332*88e42b0fSchristos # endif 1333*88e42b0fSchristos #endif 1334*88e42b0fSchristos #if !defined SCNxFAST8 || 0 1335*88e42b0fSchristos # undef SCNxFAST8 1336*88e42b0fSchristos # if UINT_FAST8_MAX > UINT32_MAX 1337*88e42b0fSchristos # define SCNxFAST8 SCNx64 1338*88e42b0fSchristos # elif UINT_FAST8_MAX == 0xffff 1339*88e42b0fSchristos # define SCNxFAST8 "hx" 1340*88e42b0fSchristos # elif UINT_FAST8_MAX == 0xff 1341*88e42b0fSchristos # define SCNxFAST8 "hhx" 1342*88e42b0fSchristos # else 1343*88e42b0fSchristos # define SCNxFAST8 "x" 1344*88e42b0fSchristos # endif 1345*88e42b0fSchristos #endif 1346*88e42b0fSchristos #if !defined SCNdFAST16 || 0 1347*88e42b0fSchristos # undef SCNdFAST16 1348*88e42b0fSchristos # if INT_FAST16_MAX > INT32_MAX 1349*88e42b0fSchristos # define SCNdFAST16 SCNd64 1350*88e42b0fSchristos # elif INT_FAST16_MAX == 0x7fff 1351*88e42b0fSchristos # define SCNdFAST16 "hd" 1352*88e42b0fSchristos # else 1353*88e42b0fSchristos # define SCNdFAST16 "d" 1354*88e42b0fSchristos # endif 1355*88e42b0fSchristos #endif 1356*88e42b0fSchristos #if !defined SCNiFAST16 || 0 1357*88e42b0fSchristos # undef SCNiFAST16 1358*88e42b0fSchristos # if INT_FAST16_MAX > INT32_MAX 1359*88e42b0fSchristos # define SCNiFAST16 SCNi64 1360*88e42b0fSchristos # elif INT_FAST16_MAX == 0x7fff 1361*88e42b0fSchristos # define SCNiFAST16 "hi" 1362*88e42b0fSchristos # else 1363*88e42b0fSchristos # define SCNiFAST16 "i" 1364*88e42b0fSchristos # endif 1365*88e42b0fSchristos #endif 1366*88e42b0fSchristos #if !defined SCNoFAST16 || 0 1367*88e42b0fSchristos # undef SCNoFAST16 1368*88e42b0fSchristos # if UINT_FAST16_MAX > UINT32_MAX 1369*88e42b0fSchristos # define SCNoFAST16 SCNo64 1370*88e42b0fSchristos # elif UINT_FAST16_MAX == 0xffff 1371*88e42b0fSchristos # define SCNoFAST16 "ho" 1372*88e42b0fSchristos # else 1373*88e42b0fSchristos # define SCNoFAST16 "o" 1374*88e42b0fSchristos # endif 1375*88e42b0fSchristos #endif 1376*88e42b0fSchristos #if !defined SCNuFAST16 || 0 1377*88e42b0fSchristos # undef SCNuFAST16 1378*88e42b0fSchristos # if UINT_FAST16_MAX > UINT32_MAX 1379*88e42b0fSchristos # define SCNuFAST16 SCNu64 1380*88e42b0fSchristos # elif UINT_FAST16_MAX == 0xffff 1381*88e42b0fSchristos # define SCNuFAST16 "hu" 1382*88e42b0fSchristos # else 1383*88e42b0fSchristos # define SCNuFAST16 "u" 1384*88e42b0fSchristos # endif 1385*88e42b0fSchristos #endif 1386*88e42b0fSchristos #if !defined SCNxFAST16 || 0 1387*88e42b0fSchristos # undef SCNxFAST16 1388*88e42b0fSchristos # if UINT_FAST16_MAX > UINT32_MAX 1389*88e42b0fSchristos # define SCNxFAST16 SCNx64 1390*88e42b0fSchristos # elif UINT_FAST16_MAX == 0xffff 1391*88e42b0fSchristos # define SCNxFAST16 "hx" 1392*88e42b0fSchristos # else 1393*88e42b0fSchristos # define SCNxFAST16 "x" 1394*88e42b0fSchristos # endif 1395*88e42b0fSchristos #endif 1396*88e42b0fSchristos #if !defined SCNdFAST32 || 0 1397*88e42b0fSchristos # undef SCNdFAST32 1398*88e42b0fSchristos # if INT_FAST32_MAX > INT32_MAX 1399*88e42b0fSchristos # define SCNdFAST32 SCNd64 1400*88e42b0fSchristos # else 1401*88e42b0fSchristos # define SCNdFAST32 "d" 1402*88e42b0fSchristos # endif 1403*88e42b0fSchristos #endif 1404*88e42b0fSchristos #if !defined SCNiFAST32 || 0 1405*88e42b0fSchristos # undef SCNiFAST32 1406*88e42b0fSchristos # if INT_FAST32_MAX > INT32_MAX 1407*88e42b0fSchristos # define SCNiFAST32 SCNi64 1408*88e42b0fSchristos # else 1409*88e42b0fSchristos # define SCNiFAST32 "i" 1410*88e42b0fSchristos # endif 1411*88e42b0fSchristos #endif 1412*88e42b0fSchristos #if !defined SCNoFAST32 || 0 1413*88e42b0fSchristos # undef SCNoFAST32 1414*88e42b0fSchristos # if UINT_FAST32_MAX > UINT32_MAX 1415*88e42b0fSchristos # define SCNoFAST32 SCNo64 1416*88e42b0fSchristos # else 1417*88e42b0fSchristos # define SCNoFAST32 "o" 1418*88e42b0fSchristos # endif 1419*88e42b0fSchristos #endif 1420*88e42b0fSchristos #if !defined SCNuFAST32 || 0 1421*88e42b0fSchristos # undef SCNuFAST32 1422*88e42b0fSchristos # if UINT_FAST32_MAX > UINT32_MAX 1423*88e42b0fSchristos # define SCNuFAST32 SCNu64 1424*88e42b0fSchristos # else 1425*88e42b0fSchristos # define SCNuFAST32 "u" 1426*88e42b0fSchristos # endif 1427*88e42b0fSchristos #endif 1428*88e42b0fSchristos #if !defined SCNxFAST32 || 0 1429*88e42b0fSchristos # undef SCNxFAST32 1430*88e42b0fSchristos # if UINT_FAST32_MAX > UINT32_MAX 1431*88e42b0fSchristos # define SCNxFAST32 SCNx64 1432*88e42b0fSchristos # else 1433*88e42b0fSchristos # define SCNxFAST32 "x" 1434*88e42b0fSchristos # endif 1435*88e42b0fSchristos #endif 1436*88e42b0fSchristos #ifdef INT64_MAX 1437*88e42b0fSchristos # if !defined SCNdFAST64 || 0 1438*88e42b0fSchristos # undef SCNdFAST64 1439*88e42b0fSchristos # define SCNdFAST64 SCNd64 1440*88e42b0fSchristos # endif 1441*88e42b0fSchristos # if !defined SCNiFAST64 || 0 1442*88e42b0fSchristos # undef SCNiFAST64 1443*88e42b0fSchristos # define SCNiFAST64 SCNi64 1444*88e42b0fSchristos # endif 1445*88e42b0fSchristos #endif 1446*88e42b0fSchristos #ifdef UINT64_MAX 1447*88e42b0fSchristos # if !defined SCNoFAST64 || 0 1448*88e42b0fSchristos # undef SCNoFAST64 1449*88e42b0fSchristos # define SCNoFAST64 SCNo64 1450*88e42b0fSchristos # endif 1451*88e42b0fSchristos # if !defined SCNuFAST64 || 0 1452*88e42b0fSchristos # undef SCNuFAST64 1453*88e42b0fSchristos # define SCNuFAST64 SCNu64 1454*88e42b0fSchristos # endif 1455*88e42b0fSchristos # if !defined SCNxFAST64 || 0 1456*88e42b0fSchristos # undef SCNxFAST64 1457*88e42b0fSchristos # define SCNxFAST64 SCNx64 1458*88e42b0fSchristos # endif 1459*88e42b0fSchristos #endif 1460*88e42b0fSchristos 1461*88e42b0fSchristos #if !defined SCNdMAX || 0 1462*88e42b0fSchristos # undef SCNdMAX 1463*88e42b0fSchristos # if 1 1464*88e42b0fSchristos # define SCNdMAX SCNd64 1465*88e42b0fSchristos # else 1466*88e42b0fSchristos # define SCNdMAX "ld" 1467*88e42b0fSchristos # endif 1468*88e42b0fSchristos #endif 1469*88e42b0fSchristos #if !defined SCNiMAX || 0 1470*88e42b0fSchristos # undef SCNiMAX 1471*88e42b0fSchristos # if 1 1472*88e42b0fSchristos # define SCNiMAX SCNi64 1473*88e42b0fSchristos # else 1474*88e42b0fSchristos # define SCNiMAX "li" 1475*88e42b0fSchristos # endif 1476*88e42b0fSchristos #endif 1477*88e42b0fSchristos #if !defined SCNoMAX || 0 1478*88e42b0fSchristos # undef SCNoMAX 1479*88e42b0fSchristos # if 1 1480*88e42b0fSchristos # define SCNoMAX SCNo64 1481*88e42b0fSchristos # else 1482*88e42b0fSchristos # define SCNoMAX "lo" 1483*88e42b0fSchristos # endif 1484*88e42b0fSchristos #endif 1485*88e42b0fSchristos #if !defined SCNuMAX || 0 1486*88e42b0fSchristos # undef SCNuMAX 1487*88e42b0fSchristos # if 1 1488*88e42b0fSchristos # define SCNuMAX SCNu64 1489*88e42b0fSchristos # else 1490*88e42b0fSchristos # define SCNuMAX "lu" 1491*88e42b0fSchristos # endif 1492*88e42b0fSchristos #endif 1493*88e42b0fSchristos #if !defined SCNxMAX || 0 1494*88e42b0fSchristos # undef SCNxMAX 1495*88e42b0fSchristos # if 1 1496*88e42b0fSchristos # define SCNxMAX SCNx64 1497*88e42b0fSchristos # else 1498*88e42b0fSchristos # define SCNxMAX "lx" 1499*88e42b0fSchristos # endif 1500*88e42b0fSchristos #endif 1501*88e42b0fSchristos 1502*88e42b0fSchristos #if !defined SCNdPTR || 0 1503*88e42b0fSchristos # undef SCNdPTR 1504*88e42b0fSchristos # ifdef INTPTR_MAX 1505*88e42b0fSchristos # define SCNdPTR "l" "d" 1506*88e42b0fSchristos # endif 1507*88e42b0fSchristos #endif 1508*88e42b0fSchristos #if !defined SCNiPTR || 0 1509*88e42b0fSchristos # undef SCNiPTR 1510*88e42b0fSchristos # ifdef INTPTR_MAX 1511*88e42b0fSchristos # define SCNiPTR "l" "i" 1512*88e42b0fSchristos # endif 1513*88e42b0fSchristos #endif 1514*88e42b0fSchristos #if !defined SCNoPTR || 0 1515*88e42b0fSchristos # undef SCNoPTR 1516*88e42b0fSchristos # ifdef UINTPTR_MAX 1517*88e42b0fSchristos # define SCNoPTR "l" "o" 1518*88e42b0fSchristos # endif 1519*88e42b0fSchristos #endif 1520*88e42b0fSchristos #if !defined SCNuPTR || 0 1521*88e42b0fSchristos # undef SCNuPTR 1522*88e42b0fSchristos # ifdef UINTPTR_MAX 1523*88e42b0fSchristos # define SCNuPTR "l" "u" 1524*88e42b0fSchristos # endif 1525*88e42b0fSchristos #endif 1526*88e42b0fSchristos #if !defined SCNxPTR || 0 1527*88e42b0fSchristos # undef SCNxPTR 1528*88e42b0fSchristos # ifdef UINTPTR_MAX 1529*88e42b0fSchristos # define SCNxPTR "l" "x" 1530*88e42b0fSchristos # endif 1531*88e42b0fSchristos #endif 1532*88e42b0fSchristos 1533*88e42b0fSchristos /* 7.8.2 Functions for greatest-width integer types */ 1534*88e42b0fSchristos 1535*88e42b0fSchristos #ifdef __cplusplus 1536*88e42b0fSchristos extern "C" { 1537*88e42b0fSchristos #endif 1538*88e42b0fSchristos 1539*88e42b0fSchristos #if 0 1540*88e42b0fSchristos # if !1 1541*88e42b0fSchristos extern intmax_t imaxabs (intmax_t); 1542*88e42b0fSchristos # endif 1543*88e42b0fSchristos #elif defined GNULIB_POSIXCHECK 1544*88e42b0fSchristos # undef imaxabs 1545*88e42b0fSchristos # if HAVE_RAW_DECL_IMAXABS 1546*88e42b0fSchristos _GL_WARN_ON_USE (imaxabs, "imaxabs is unportable - " 1547*88e42b0fSchristos "use gnulib module imaxabs for portability"); 1548*88e42b0fSchristos # endif 1549*88e42b0fSchristos #endif 1550*88e42b0fSchristos 1551*88e42b0fSchristos #if 0 1552*88e42b0fSchristos # if !1 1553*88e42b0fSchristos # if !GNULIB_defined_imaxdiv_t 1554*88e42b0fSchristos typedef struct { intmax_t quot; intmax_t rem; } imaxdiv_t; 1555*88e42b0fSchristos # define GNULIB_defined_imaxdiv_t 1 1556*88e42b0fSchristos # endif 1557*88e42b0fSchristos # endif 1558*88e42b0fSchristos # if !1 1559*88e42b0fSchristos extern imaxdiv_t imaxdiv (intmax_t, intmax_t); 1560*88e42b0fSchristos # endif 1561*88e42b0fSchristos #elif defined GNULIB_POSIXCHECK 1562*88e42b0fSchristos # undef imaxdiv 1563*88e42b0fSchristos # if HAVE_RAW_DECL_IMAXDIV 1564*88e42b0fSchristos _GL_WARN_ON_USE (imaxdiv, "imaxdiv is unportable - " 1565*88e42b0fSchristos "use gnulib module imaxdiv for portability"); 1566*88e42b0fSchristos # endif 1567*88e42b0fSchristos #endif 1568*88e42b0fSchristos 1569*88e42b0fSchristos #if 0 1570*88e42b0fSchristos # if 0 1571*88e42b0fSchristos # if !(defined __cplusplus && defined GNULIB_NAMESPACE) 1572*88e42b0fSchristos # undef strtoimax 1573*88e42b0fSchristos # define strtoimax rpl_strtoimax 1574*88e42b0fSchristos # endif 1575*88e42b0fSchristos _GL_FUNCDECL_RPL (strtoimax, intmax_t, 1576*88e42b0fSchristos (const char *restrict, char **restrict, int) 1577*88e42b0fSchristos _GL_ARG_NONNULL ((1))); 1578*88e42b0fSchristos _GL_CXXALIAS_RPL (strtoimax, intmax_t, 1579*88e42b0fSchristos (const char *restrict, char **restrict, int)); 1580*88e42b0fSchristos # else 1581*88e42b0fSchristos # if !1 1582*88e42b0fSchristos # undef strtoimax 1583*88e42b0fSchristos _GL_FUNCDECL_SYS (strtoimax, intmax_t, 1584*88e42b0fSchristos (const char *restrict, char **restrict, int) 1585*88e42b0fSchristos _GL_ARG_NONNULL ((1))); 1586*88e42b0fSchristos # endif 1587*88e42b0fSchristos _GL_CXXALIAS_SYS (strtoimax, intmax_t, 1588*88e42b0fSchristos (const char *restrict, char **restrict, int)); 1589*88e42b0fSchristos # endif 1590*88e42b0fSchristos _GL_CXXALIASWARN (strtoimax); 1591*88e42b0fSchristos #elif defined GNULIB_POSIXCHECK 1592*88e42b0fSchristos # undef strtoimax 1593*88e42b0fSchristos # if HAVE_RAW_DECL_STRTOIMAX 1594*88e42b0fSchristos _GL_WARN_ON_USE (strtoimax, "strtoimax is unportable - " 1595*88e42b0fSchristos "use gnulib module strtoimax for portability"); 1596*88e42b0fSchristos # endif 1597*88e42b0fSchristos #endif 1598*88e42b0fSchristos 1599*88e42b0fSchristos #if 0 1600*88e42b0fSchristos # if 0 1601*88e42b0fSchristos # if !(defined __cplusplus && defined GNULIB_NAMESPACE) 1602*88e42b0fSchristos # undef strtoumax 1603*88e42b0fSchristos # define strtoumax rpl_strtoumax 1604*88e42b0fSchristos # endif 1605*88e42b0fSchristos _GL_FUNCDECL_RPL (strtoumax, uintmax_t, 1606*88e42b0fSchristos (const char *restrict, char **restrict, int) 1607*88e42b0fSchristos _GL_ARG_NONNULL ((1))); 1608*88e42b0fSchristos _GL_CXXALIAS_RPL (strtoumax, uintmax_t, 1609*88e42b0fSchristos (const char *restrict, char **restrict, int)); 1610*88e42b0fSchristos # else 1611*88e42b0fSchristos # if !1 1612*88e42b0fSchristos # undef strtoumax 1613*88e42b0fSchristos _GL_FUNCDECL_SYS (strtoumax, uintmax_t, 1614*88e42b0fSchristos (const char *restrict, char **restrict, int) 1615*88e42b0fSchristos _GL_ARG_NONNULL ((1))); 1616*88e42b0fSchristos # endif 1617*88e42b0fSchristos _GL_CXXALIAS_SYS (strtoumax, uintmax_t, 1618*88e42b0fSchristos (const char *restrict, char **restrict, int)); 1619*88e42b0fSchristos # endif 1620*88e42b0fSchristos _GL_CXXALIASWARN (strtoumax); 1621*88e42b0fSchristos #elif defined GNULIB_POSIXCHECK 1622*88e42b0fSchristos # undef strtoumax 1623*88e42b0fSchristos # if HAVE_RAW_DECL_STRTOUMAX 1624*88e42b0fSchristos _GL_WARN_ON_USE (strtoumax, "strtoumax is unportable - " 1625*88e42b0fSchristos "use gnulib module strtoumax for portability"); 1626*88e42b0fSchristos # endif 1627*88e42b0fSchristos #endif 1628*88e42b0fSchristos 1629*88e42b0fSchristos /* Don't bother defining or declaring wcstoimax and wcstoumax, since 1630*88e42b0fSchristos wide-character functions like this are hardly ever useful. */ 1631*88e42b0fSchristos 1632*88e42b0fSchristos #ifdef __cplusplus 1633*88e42b0fSchristos } 1634*88e42b0fSchristos #endif 1635*88e42b0fSchristos 1636*88e42b0fSchristos #endif /* !defined INTTYPES_H && !defined _GL_JUST_INCLUDE_SYSTEM_INTTYPES_H */ 1637