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