stdlib.in.h 34 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993
  1. /* A GNU-like <stdlib.h>.
  2. Copyright (C) 1995, 2001-2004, 2006-2017 Free Software Foundation, Inc.
  3. This program is free software: you can redistribute it and/or modify
  4. it under the terms of the GNU Lesser General Public License as published by
  5. the Free Software Foundation; either version 3 of the License, or
  6. (at your option) any later version.
  7. This program is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. GNU Lesser General Public License for more details.
  11. You should have received a copy of the GNU Lesser General Public License
  12. along with this program. If not, see <http://www.gnu.org/licenses/>. */
  13. #if __GNUC__ >= 3
  14. @PRAGMA_SYSTEM_HEADER@
  15. #endif
  16. @PRAGMA_COLUMNS@
  17. #if defined __need_system_stdlib_h || defined __need_malloc_and_calloc
  18. /* Special invocation conventions inside some gnulib header files,
  19. and inside some glibc header files, respectively. */
  20. #@INCLUDE_NEXT@ @NEXT_STDLIB_H@
  21. #else
  22. /* Normal invocation convention. */
  23. #ifndef _@GUARD_PREFIX@_STDLIB_H
  24. /* The include_next requires a split double-inclusion guard. */
  25. #@INCLUDE_NEXT@ @NEXT_STDLIB_H@
  26. #ifndef _@GUARD_PREFIX@_STDLIB_H
  27. #define _@GUARD_PREFIX@_STDLIB_H
  28. /* NetBSD 5.0 mis-defines NULL. */
  29. #include <stddef.h>
  30. /* MirBSD 10 defines WEXITSTATUS in <sys/wait.h>, not in <stdlib.h>. */
  31. #if @GNULIB_SYSTEM_POSIX@ && !defined WEXITSTATUS
  32. # include <sys/wait.h>
  33. #endif
  34. /* Solaris declares getloadavg() in <sys/loadavg.h>. */
  35. #if (@GNULIB_GETLOADAVG@ || defined GNULIB_POSIXCHECK) && @HAVE_SYS_LOADAVG_H@
  36. # include <sys/loadavg.h>
  37. #endif
  38. /* Native Windows platforms declare mktemp() in <io.h>. */
  39. #if 0 && ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__)
  40. # include <io.h>
  41. #endif
  42. #if @GNULIB_RANDOM_R@
  43. /* OSF/1 5.1 declares 'struct random_data' in <random.h>, which is included
  44. from <stdlib.h> if _REENTRANT is defined. Include it whenever we need
  45. 'struct random_data'. */
  46. # if @HAVE_RANDOM_H@
  47. # include <random.h>
  48. # endif
  49. # if !@HAVE_STRUCT_RANDOM_DATA@ || @REPLACE_RANDOM_R@ || !@HAVE_RANDOM_R@
  50. # include <stdint.h>
  51. # endif
  52. # if !@HAVE_STRUCT_RANDOM_DATA@
  53. /* Define 'struct random_data'.
  54. But allow multiple gnulib generated <stdlib.h> replacements to coexist. */
  55. # if !GNULIB_defined_struct_random_data
  56. struct random_data
  57. {
  58. int32_t *fptr; /* Front pointer. */
  59. int32_t *rptr; /* Rear pointer. */
  60. int32_t *state; /* Array of state values. */
  61. int rand_type; /* Type of random number generator. */
  62. int rand_deg; /* Degree of random number generator. */
  63. int rand_sep; /* Distance between front and rear. */
  64. int32_t *end_ptr; /* Pointer behind state table. */
  65. };
  66. # define GNULIB_defined_struct_random_data 1
  67. # endif
  68. # endif
  69. #endif
  70. #if (@GNULIB_MKSTEMP@ || @GNULIB_MKSTEMPS@ || @GNULIB_GETSUBOPT@ || defined GNULIB_POSIXCHECK) && ! defined __GLIBC__ && !((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__)
  71. /* On Mac OS X 10.3, only <unistd.h> declares mkstemp. */
  72. /* On Mac OS X 10.5, only <unistd.h> declares mkstemps. */
  73. /* On Cygwin 1.7.1, only <unistd.h> declares getsubopt. */
  74. /* But avoid namespace pollution on glibc systems and native Windows. */
  75. # include <unistd.h>
  76. #endif
  77. /* The __attribute__ feature is available in gcc versions 2.5 and later.
  78. The attribute __pure__ was added in gcc 2.96. */
  79. #if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96)
  80. # define _GL_ATTRIBUTE_PURE __attribute__ ((__pure__))
  81. #else
  82. # define _GL_ATTRIBUTE_PURE /* empty */
  83. #endif
  84. /* The definition of _Noreturn is copied here. */
  85. /* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */
  86. /* The definition of _GL_ARG_NONNULL is copied here. */
  87. /* The definition of _GL_WARN_ON_USE is copied here. */
  88. /* Some systems do not define EXIT_*, despite otherwise supporting C89. */
  89. #ifndef EXIT_SUCCESS
  90. # define EXIT_SUCCESS 0
  91. #endif
  92. /* Tandem/NSK and other platforms that define EXIT_FAILURE as -1 interfere
  93. with proper operation of xargs. */
  94. #ifndef EXIT_FAILURE
  95. # define EXIT_FAILURE 1
  96. #elif EXIT_FAILURE != 1
  97. # undef EXIT_FAILURE
  98. # define EXIT_FAILURE 1
  99. #endif
  100. #if @GNULIB__EXIT@
  101. /* Terminate the current process with the given return code, without running
  102. the 'atexit' handlers. */
  103. # if !@HAVE__EXIT@
  104. _GL_FUNCDECL_SYS (_Exit, _Noreturn void, (int status));
  105. # endif
  106. _GL_CXXALIAS_SYS (_Exit, void, (int status));
  107. _GL_CXXALIASWARN (_Exit);
  108. #elif defined GNULIB_POSIXCHECK
  109. # undef _Exit
  110. # if HAVE_RAW_DECL__EXIT
  111. _GL_WARN_ON_USE (_Exit, "_Exit is unportable - "
  112. "use gnulib module _Exit for portability");
  113. # endif
  114. #endif
  115. #if @GNULIB_ATOLL@
  116. /* Parse a signed decimal integer.
  117. Returns the value of the integer. Errors are not detected. */
  118. # if !@HAVE_ATOLL@
  119. _GL_FUNCDECL_SYS (atoll, long long, (const char *string)
  120. _GL_ATTRIBUTE_PURE
  121. _GL_ARG_NONNULL ((1)));
  122. # endif
  123. _GL_CXXALIAS_SYS (atoll, long long, (const char *string));
  124. _GL_CXXALIASWARN (atoll);
  125. #elif defined GNULIB_POSIXCHECK
  126. # undef atoll
  127. # if HAVE_RAW_DECL_ATOLL
  128. _GL_WARN_ON_USE (atoll, "atoll is unportable - "
  129. "use gnulib module atoll for portability");
  130. # endif
  131. #endif
  132. #if @GNULIB_CALLOC_POSIX@
  133. # if @REPLACE_CALLOC@
  134. # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
  135. # undef calloc
  136. # define calloc rpl_calloc
  137. # endif
  138. _GL_FUNCDECL_RPL (calloc, void *, (size_t nmemb, size_t size));
  139. _GL_CXXALIAS_RPL (calloc, void *, (size_t nmemb, size_t size));
  140. # else
  141. _GL_CXXALIAS_SYS (calloc, void *, (size_t nmemb, size_t size));
  142. # endif
  143. _GL_CXXALIASWARN (calloc);
  144. #elif defined GNULIB_POSIXCHECK
  145. # undef calloc
  146. /* Assume calloc is always declared. */
  147. _GL_WARN_ON_USE (calloc, "calloc is not POSIX compliant everywhere - "
  148. "use gnulib module calloc-posix for portability");
  149. #endif
  150. #if @GNULIB_CANONICALIZE_FILE_NAME@
  151. # if @REPLACE_CANONICALIZE_FILE_NAME@
  152. # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
  153. # define canonicalize_file_name rpl_canonicalize_file_name
  154. # endif
  155. _GL_FUNCDECL_RPL (canonicalize_file_name, char *, (const char *name)
  156. _GL_ARG_NONNULL ((1)));
  157. _GL_CXXALIAS_RPL (canonicalize_file_name, char *, (const char *name));
  158. # else
  159. # if !@HAVE_CANONICALIZE_FILE_NAME@
  160. _GL_FUNCDECL_SYS (canonicalize_file_name, char *, (const char *name)
  161. _GL_ARG_NONNULL ((1)));
  162. # endif
  163. _GL_CXXALIAS_SYS (canonicalize_file_name, char *, (const char *name));
  164. # endif
  165. _GL_CXXALIASWARN (canonicalize_file_name);
  166. #elif defined GNULIB_POSIXCHECK
  167. # undef canonicalize_file_name
  168. # if HAVE_RAW_DECL_CANONICALIZE_FILE_NAME
  169. _GL_WARN_ON_USE (canonicalize_file_name,
  170. "canonicalize_file_name is unportable - "
  171. "use gnulib module canonicalize-lgpl for portability");
  172. # endif
  173. #endif
  174. #if @GNULIB_GETLOADAVG@
  175. /* Store max(NELEM,3) load average numbers in LOADAVG[].
  176. The three numbers are the load average of the last 1 minute, the last 5
  177. minutes, and the last 15 minutes, respectively.
  178. LOADAVG is an array of NELEM numbers. */
  179. # if !@HAVE_DECL_GETLOADAVG@
  180. _GL_FUNCDECL_SYS (getloadavg, int, (double loadavg[], int nelem)
  181. _GL_ARG_NONNULL ((1)));
  182. # endif
  183. _GL_CXXALIAS_SYS (getloadavg, int, (double loadavg[], int nelem));
  184. _GL_CXXALIASWARN (getloadavg);
  185. #elif defined GNULIB_POSIXCHECK
  186. # undef getloadavg
  187. # if HAVE_RAW_DECL_GETLOADAVG
  188. _GL_WARN_ON_USE (getloadavg, "getloadavg is not portable - "
  189. "use gnulib module getloadavg for portability");
  190. # endif
  191. #endif
  192. #if @GNULIB_GETSUBOPT@
  193. /* Assuming *OPTIONP is a comma separated list of elements of the form
  194. "token" or "token=value", getsubopt parses the first of these elements.
  195. If the first element refers to a "token" that is member of the given
  196. NULL-terminated array of tokens:
  197. - It replaces the comma with a NUL byte, updates *OPTIONP to point past
  198. the first option and the comma, sets *VALUEP to the value of the
  199. element (or NULL if it doesn't contain an "=" sign),
  200. - It returns the index of the "token" in the given array of tokens.
  201. Otherwise it returns -1, and *OPTIONP and *VALUEP are undefined.
  202. For more details see the POSIX:2001 specification.
  203. http://www.opengroup.org/susv3xsh/getsubopt.html */
  204. # if !@HAVE_GETSUBOPT@
  205. _GL_FUNCDECL_SYS (getsubopt, int,
  206. (char **optionp, char *const *tokens, char **valuep)
  207. _GL_ARG_NONNULL ((1, 2, 3)));
  208. # endif
  209. _GL_CXXALIAS_SYS (getsubopt, int,
  210. (char **optionp, char *const *tokens, char **valuep));
  211. _GL_CXXALIASWARN (getsubopt);
  212. #elif defined GNULIB_POSIXCHECK
  213. # undef getsubopt
  214. # if HAVE_RAW_DECL_GETSUBOPT
  215. _GL_WARN_ON_USE (getsubopt, "getsubopt is unportable - "
  216. "use gnulib module getsubopt for portability");
  217. # endif
  218. #endif
  219. #if @GNULIB_GRANTPT@
  220. /* Change the ownership and access permission of the slave side of the
  221. pseudo-terminal whose master side is specified by FD. */
  222. # if !@HAVE_GRANTPT@
  223. _GL_FUNCDECL_SYS (grantpt, int, (int fd));
  224. # endif
  225. _GL_CXXALIAS_SYS (grantpt, int, (int fd));
  226. _GL_CXXALIASWARN (grantpt);
  227. #elif defined GNULIB_POSIXCHECK
  228. # undef grantpt
  229. # if HAVE_RAW_DECL_GRANTPT
  230. _GL_WARN_ON_USE (grantpt, "grantpt is not portable - "
  231. "use gnulib module grantpt for portability");
  232. # endif
  233. #endif
  234. /* If _GL_USE_STDLIB_ALLOC is nonzero, the including module does not
  235. rely on GNU or POSIX semantics for malloc and realloc (for example,
  236. by never specifying a zero size), so it does not need malloc or
  237. realloc to be redefined. */
  238. #if @GNULIB_MALLOC_POSIX@
  239. # if @REPLACE_MALLOC@
  240. # if !((defined __cplusplus && defined GNULIB_NAMESPACE) \
  241. || _GL_USE_STDLIB_ALLOC)
  242. # undef malloc
  243. # define malloc rpl_malloc
  244. # endif
  245. _GL_FUNCDECL_RPL (malloc, void *, (size_t size));
  246. _GL_CXXALIAS_RPL (malloc, void *, (size_t size));
  247. # else
  248. _GL_CXXALIAS_SYS (malloc, void *, (size_t size));
  249. # endif
  250. _GL_CXXALIASWARN (malloc);
  251. #elif defined GNULIB_POSIXCHECK && !_GL_USE_STDLIB_ALLOC
  252. # undef malloc
  253. /* Assume malloc is always declared. */
  254. _GL_WARN_ON_USE (malloc, "malloc is not POSIX compliant everywhere - "
  255. "use gnulib module malloc-posix for portability");
  256. #endif
  257. /* Convert a multibyte character to a wide character. */
  258. #if @GNULIB_MBTOWC@
  259. # if @REPLACE_MBTOWC@
  260. # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
  261. # undef mbtowc
  262. # define mbtowc rpl_mbtowc
  263. # endif
  264. _GL_FUNCDECL_RPL (mbtowc, int, (wchar_t *pwc, const char *s, size_t n));
  265. _GL_CXXALIAS_RPL (mbtowc, int, (wchar_t *pwc, const char *s, size_t n));
  266. # else
  267. _GL_CXXALIAS_SYS (mbtowc, int, (wchar_t *pwc, const char *s, size_t n));
  268. # endif
  269. _GL_CXXALIASWARN (mbtowc);
  270. #endif
  271. #if @GNULIB_MKDTEMP@
  272. /* Create a unique temporary directory from TEMPLATE.
  273. The last six characters of TEMPLATE must be "XXXXXX";
  274. they are replaced with a string that makes the directory name unique.
  275. Returns TEMPLATE, or a null pointer if it cannot get a unique name.
  276. The directory is created mode 700. */
  277. # if !@HAVE_MKDTEMP@
  278. _GL_FUNCDECL_SYS (mkdtemp, char *, (char * /*template*/) _GL_ARG_NONNULL ((1)));
  279. # endif
  280. _GL_CXXALIAS_SYS (mkdtemp, char *, (char * /*template*/));
  281. _GL_CXXALIASWARN (mkdtemp);
  282. #elif defined GNULIB_POSIXCHECK
  283. # undef mkdtemp
  284. # if HAVE_RAW_DECL_MKDTEMP
  285. _GL_WARN_ON_USE (mkdtemp, "mkdtemp is unportable - "
  286. "use gnulib module mkdtemp for portability");
  287. # endif
  288. #endif
  289. #if @GNULIB_MKOSTEMP@
  290. /* Create a unique temporary file from TEMPLATE.
  291. The last six characters of TEMPLATE must be "XXXXXX";
  292. they are replaced with a string that makes the file name unique.
  293. The flags are a bitmask, possibly including O_CLOEXEC (defined in <fcntl.h>)
  294. and O_TEXT, O_BINARY (defined in "binary-io.h").
  295. The file is then created, with the specified flags, ensuring it didn't exist
  296. before.
  297. The file is created read-write (mask at least 0600 & ~umask), but it may be
  298. world-readable and world-writable (mask 0666 & ~umask), depending on the
  299. implementation.
  300. Returns the open file descriptor if successful, otherwise -1 and errno
  301. set. */
  302. # if !@HAVE_MKOSTEMP@
  303. _GL_FUNCDECL_SYS (mkostemp, int, (char * /*template*/, int /*flags*/)
  304. _GL_ARG_NONNULL ((1)));
  305. # endif
  306. _GL_CXXALIAS_SYS (mkostemp, int, (char * /*template*/, int /*flags*/));
  307. _GL_CXXALIASWARN (mkostemp);
  308. #elif defined GNULIB_POSIXCHECK
  309. # undef mkostemp
  310. # if HAVE_RAW_DECL_MKOSTEMP
  311. _GL_WARN_ON_USE (mkostemp, "mkostemp is unportable - "
  312. "use gnulib module mkostemp for portability");
  313. # endif
  314. #endif
  315. #if @GNULIB_MKOSTEMPS@
  316. /* Create a unique temporary file from TEMPLATE.
  317. The last six characters of TEMPLATE before a suffix of length
  318. SUFFIXLEN must be "XXXXXX";
  319. they are replaced with a string that makes the file name unique.
  320. The flags are a bitmask, possibly including O_CLOEXEC (defined in <fcntl.h>)
  321. and O_TEXT, O_BINARY (defined in "binary-io.h").
  322. The file is then created, with the specified flags, ensuring it didn't exist
  323. before.
  324. The file is created read-write (mask at least 0600 & ~umask), but it may be
  325. world-readable and world-writable (mask 0666 & ~umask), depending on the
  326. implementation.
  327. Returns the open file descriptor if successful, otherwise -1 and errno
  328. set. */
  329. # if !@HAVE_MKOSTEMPS@
  330. _GL_FUNCDECL_SYS (mkostemps, int,
  331. (char * /*template*/, int /*suffixlen*/, int /*flags*/)
  332. _GL_ARG_NONNULL ((1)));
  333. # endif
  334. _GL_CXXALIAS_SYS (mkostemps, int,
  335. (char * /*template*/, int /*suffixlen*/, int /*flags*/));
  336. _GL_CXXALIASWARN (mkostemps);
  337. #elif defined GNULIB_POSIXCHECK
  338. # undef mkostemps
  339. # if HAVE_RAW_DECL_MKOSTEMPS
  340. _GL_WARN_ON_USE (mkostemps, "mkostemps is unportable - "
  341. "use gnulib module mkostemps for portability");
  342. # endif
  343. #endif
  344. #if @GNULIB_MKSTEMP@
  345. /* Create a unique temporary file from TEMPLATE.
  346. The last six characters of TEMPLATE must be "XXXXXX";
  347. they are replaced with a string that makes the file name unique.
  348. The file is then created, ensuring it didn't exist before.
  349. The file is created read-write (mask at least 0600 & ~umask), but it may be
  350. world-readable and world-writable (mask 0666 & ~umask), depending on the
  351. implementation.
  352. Returns the open file descriptor if successful, otherwise -1 and errno
  353. set. */
  354. # if @REPLACE_MKSTEMP@
  355. # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
  356. # define mkstemp rpl_mkstemp
  357. # endif
  358. _GL_FUNCDECL_RPL (mkstemp, int, (char * /*template*/) _GL_ARG_NONNULL ((1)));
  359. _GL_CXXALIAS_RPL (mkstemp, int, (char * /*template*/));
  360. # else
  361. # if ! @HAVE_MKSTEMP@
  362. _GL_FUNCDECL_SYS (mkstemp, int, (char * /*template*/) _GL_ARG_NONNULL ((1)));
  363. # endif
  364. _GL_CXXALIAS_SYS (mkstemp, int, (char * /*template*/));
  365. # endif
  366. _GL_CXXALIASWARN (mkstemp);
  367. #elif defined GNULIB_POSIXCHECK
  368. # undef mkstemp
  369. # if HAVE_RAW_DECL_MKSTEMP
  370. _GL_WARN_ON_USE (mkstemp, "mkstemp is unportable - "
  371. "use gnulib module mkstemp for portability");
  372. # endif
  373. #endif
  374. #if @GNULIB_MKSTEMPS@
  375. /* Create a unique temporary file from TEMPLATE.
  376. The last six characters of TEMPLATE prior to a suffix of length
  377. SUFFIXLEN must be "XXXXXX";
  378. they are replaced with a string that makes the file name unique.
  379. The file is then created, ensuring it didn't exist before.
  380. The file is created read-write (mask at least 0600 & ~umask), but it may be
  381. world-readable and world-writable (mask 0666 & ~umask), depending on the
  382. implementation.
  383. Returns the open file descriptor if successful, otherwise -1 and errno
  384. set. */
  385. # if !@HAVE_MKSTEMPS@
  386. _GL_FUNCDECL_SYS (mkstemps, int, (char * /*template*/, int /*suffixlen*/)
  387. _GL_ARG_NONNULL ((1)));
  388. # endif
  389. _GL_CXXALIAS_SYS (mkstemps, int, (char * /*template*/, int /*suffixlen*/));
  390. _GL_CXXALIASWARN (mkstemps);
  391. #elif defined GNULIB_POSIXCHECK
  392. # undef mkstemps
  393. # if HAVE_RAW_DECL_MKSTEMPS
  394. _GL_WARN_ON_USE (mkstemps, "mkstemps is unportable - "
  395. "use gnulib module mkstemps for portability");
  396. # endif
  397. #endif
  398. #if @GNULIB_POSIX_OPENPT@
  399. /* Return an FD open to the master side of a pseudo-terminal. Flags should
  400. include O_RDWR, and may also include O_NOCTTY. */
  401. # if !@HAVE_POSIX_OPENPT@
  402. _GL_FUNCDECL_SYS (posix_openpt, int, (int flags));
  403. # endif
  404. _GL_CXXALIAS_SYS (posix_openpt, int, (int flags));
  405. _GL_CXXALIASWARN (posix_openpt);
  406. #elif defined GNULIB_POSIXCHECK
  407. # undef posix_openpt
  408. # if HAVE_RAW_DECL_POSIX_OPENPT
  409. _GL_WARN_ON_USE (posix_openpt, "posix_openpt is not portable - "
  410. "use gnulib module posix_openpt for portability");
  411. # endif
  412. #endif
  413. #if @GNULIB_PTSNAME@
  414. /* Return the pathname of the pseudo-terminal slave associated with
  415. the master FD is open on, or NULL on errors. */
  416. # if @REPLACE_PTSNAME@
  417. # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
  418. # undef ptsname
  419. # define ptsname rpl_ptsname
  420. # endif
  421. _GL_FUNCDECL_RPL (ptsname, char *, (int fd));
  422. _GL_CXXALIAS_RPL (ptsname, char *, (int fd));
  423. # else
  424. # if !@HAVE_PTSNAME@
  425. _GL_FUNCDECL_SYS (ptsname, char *, (int fd));
  426. # endif
  427. _GL_CXXALIAS_SYS (ptsname, char *, (int fd));
  428. # endif
  429. _GL_CXXALIASWARN (ptsname);
  430. #elif defined GNULIB_POSIXCHECK
  431. # undef ptsname
  432. # if HAVE_RAW_DECL_PTSNAME
  433. _GL_WARN_ON_USE (ptsname, "ptsname is not portable - "
  434. "use gnulib module ptsname for portability");
  435. # endif
  436. #endif
  437. #if @GNULIB_PTSNAME_R@
  438. /* Set the pathname of the pseudo-terminal slave associated with
  439. the master FD is open on and return 0, or set errno and return
  440. non-zero on errors. */
  441. # if @REPLACE_PTSNAME_R@
  442. # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
  443. # undef ptsname_r
  444. # define ptsname_r rpl_ptsname_r
  445. # endif
  446. _GL_FUNCDECL_RPL (ptsname_r, int, (int fd, char *buf, size_t len));
  447. _GL_CXXALIAS_RPL (ptsname_r, int, (int fd, char *buf, size_t len));
  448. # else
  449. # if !@HAVE_PTSNAME_R@
  450. _GL_FUNCDECL_SYS (ptsname_r, int, (int fd, char *buf, size_t len));
  451. # endif
  452. _GL_CXXALIAS_SYS (ptsname_r, int, (int fd, char *buf, size_t len));
  453. # endif
  454. _GL_CXXALIASWARN (ptsname_r);
  455. #elif defined GNULIB_POSIXCHECK
  456. # undef ptsname_r
  457. # if HAVE_RAW_DECL_PTSNAME_R
  458. _GL_WARN_ON_USE (ptsname_r, "ptsname_r is not portable - "
  459. "use gnulib module ptsname_r for portability");
  460. # endif
  461. #endif
  462. #if @GNULIB_PUTENV@
  463. # if @REPLACE_PUTENV@
  464. # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
  465. # undef putenv
  466. # define putenv rpl_putenv
  467. # endif
  468. _GL_FUNCDECL_RPL (putenv, int, (char *string) _GL_ARG_NONNULL ((1)));
  469. _GL_CXXALIAS_RPL (putenv, int, (char *string));
  470. # else
  471. _GL_CXXALIAS_SYS (putenv, int, (char *string));
  472. # endif
  473. _GL_CXXALIASWARN (putenv);
  474. #endif
  475. #if @GNULIB_QSORT_R@
  476. /* Sort an array of NMEMB elements, starting at address BASE, each element
  477. occupying SIZE bytes, in ascending order according to the comparison
  478. function COMPARE. */
  479. # if @REPLACE_QSORT_R@
  480. # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
  481. # undef qsort_r
  482. # define qsort_r rpl_qsort_r
  483. # endif
  484. _GL_FUNCDECL_RPL (qsort_r, void, (void *base, size_t nmemb, size_t size,
  485. int (*compare) (void const *, void const *,
  486. void *),
  487. void *arg) _GL_ARG_NONNULL ((1, 4)));
  488. _GL_CXXALIAS_RPL (qsort_r, void, (void *base, size_t nmemb, size_t size,
  489. int (*compare) (void const *, void const *,
  490. void *),
  491. void *arg));
  492. # else
  493. # if !@HAVE_QSORT_R@
  494. _GL_FUNCDECL_SYS (qsort_r, void, (void *base, size_t nmemb, size_t size,
  495. int (*compare) (void const *, void const *,
  496. void *),
  497. void *arg) _GL_ARG_NONNULL ((1, 4)));
  498. # endif
  499. _GL_CXXALIAS_SYS (qsort_r, void, (void *base, size_t nmemb, size_t size,
  500. int (*compare) (void const *, void const *,
  501. void *),
  502. void *arg));
  503. # endif
  504. _GL_CXXALIASWARN (qsort_r);
  505. #elif defined GNULIB_POSIXCHECK
  506. # undef qsort_r
  507. # if HAVE_RAW_DECL_QSORT_R
  508. _GL_WARN_ON_USE (qsort_r, "qsort_r is not portable - "
  509. "use gnulib module qsort_r for portability");
  510. # endif
  511. #endif
  512. #if @GNULIB_RANDOM_R@
  513. # if !@HAVE_RANDOM_R@
  514. # ifndef RAND_MAX
  515. # define RAND_MAX 2147483647
  516. # endif
  517. # endif
  518. #endif
  519. #if @GNULIB_RANDOM@
  520. # if !@HAVE_RANDOM@
  521. _GL_FUNCDECL_SYS (random, long, (void));
  522. # endif
  523. _GL_CXXALIAS_SYS (random, long, (void));
  524. _GL_CXXALIASWARN (random);
  525. #elif defined GNULIB_POSIXCHECK
  526. # undef random
  527. # if HAVE_RAW_DECL_RANDOM
  528. _GL_WARN_ON_USE (random, "random is unportable - "
  529. "use gnulib module random for portability");
  530. # endif
  531. #endif
  532. #if @GNULIB_RANDOM@
  533. # if !@HAVE_RANDOM@
  534. _GL_FUNCDECL_SYS (srandom, void, (unsigned int seed));
  535. # endif
  536. _GL_CXXALIAS_SYS (srandom, void, (unsigned int seed));
  537. _GL_CXXALIASWARN (srandom);
  538. #elif defined GNULIB_POSIXCHECK
  539. # undef srandom
  540. # if HAVE_RAW_DECL_SRANDOM
  541. _GL_WARN_ON_USE (srandom, "srandom is unportable - "
  542. "use gnulib module random for portability");
  543. # endif
  544. #endif
  545. #if @GNULIB_RANDOM@
  546. # if !@HAVE_RANDOM@
  547. _GL_FUNCDECL_SYS (initstate, char *,
  548. (unsigned int seed, char *buf, size_t buf_size)
  549. _GL_ARG_NONNULL ((2)));
  550. # endif
  551. _GL_CXXALIAS_SYS (initstate, char *,
  552. (unsigned int seed, char *buf, size_t buf_size));
  553. _GL_CXXALIASWARN (initstate);
  554. #elif defined GNULIB_POSIXCHECK
  555. # undef initstate
  556. # if HAVE_RAW_DECL_INITSTATE_R
  557. _GL_WARN_ON_USE (initstate, "initstate is unportable - "
  558. "use gnulib module random for portability");
  559. # endif
  560. #endif
  561. #if @GNULIB_RANDOM@
  562. # if !@HAVE_RANDOM@
  563. _GL_FUNCDECL_SYS (setstate, char *, (char *arg_state) _GL_ARG_NONNULL ((1)));
  564. # endif
  565. _GL_CXXALIAS_SYS (setstate, char *, (char *arg_state));
  566. _GL_CXXALIASWARN (setstate);
  567. #elif defined GNULIB_POSIXCHECK
  568. # undef setstate
  569. # if HAVE_RAW_DECL_SETSTATE_R
  570. _GL_WARN_ON_USE (setstate, "setstate is unportable - "
  571. "use gnulib module random for portability");
  572. # endif
  573. #endif
  574. #if @GNULIB_RANDOM_R@
  575. # if @REPLACE_RANDOM_R@
  576. # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
  577. # undef random_r
  578. # define random_r rpl_random_r
  579. # endif
  580. _GL_FUNCDECL_RPL (random_r, int, (struct random_data *buf, int32_t *result)
  581. _GL_ARG_NONNULL ((1, 2)));
  582. _GL_CXXALIAS_RPL (random_r, int, (struct random_data *buf, int32_t *result));
  583. # else
  584. # if !@HAVE_RANDOM_R@
  585. _GL_FUNCDECL_SYS (random_r, int, (struct random_data *buf, int32_t *result)
  586. _GL_ARG_NONNULL ((1, 2)));
  587. # endif
  588. _GL_CXXALIAS_SYS (random_r, int, (struct random_data *buf, int32_t *result));
  589. # endif
  590. _GL_CXXALIASWARN (random_r);
  591. #elif defined GNULIB_POSIXCHECK
  592. # undef random_r
  593. # if HAVE_RAW_DECL_RANDOM_R
  594. _GL_WARN_ON_USE (random_r, "random_r is unportable - "
  595. "use gnulib module random_r for portability");
  596. # endif
  597. #endif
  598. #if @GNULIB_RANDOM_R@
  599. # if @REPLACE_RANDOM_R@
  600. # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
  601. # undef srandom_r
  602. # define srandom_r rpl_srandom_r
  603. # endif
  604. _GL_FUNCDECL_RPL (srandom_r, int,
  605. (unsigned int seed, struct random_data *rand_state)
  606. _GL_ARG_NONNULL ((2)));
  607. _GL_CXXALIAS_RPL (srandom_r, int,
  608. (unsigned int seed, struct random_data *rand_state));
  609. # else
  610. # if !@HAVE_RANDOM_R@
  611. _GL_FUNCDECL_SYS (srandom_r, int,
  612. (unsigned int seed, struct random_data *rand_state)
  613. _GL_ARG_NONNULL ((2)));
  614. # endif
  615. _GL_CXXALIAS_SYS (srandom_r, int,
  616. (unsigned int seed, struct random_data *rand_state));
  617. # endif
  618. _GL_CXXALIASWARN (srandom_r);
  619. #elif defined GNULIB_POSIXCHECK
  620. # undef srandom_r
  621. # if HAVE_RAW_DECL_SRANDOM_R
  622. _GL_WARN_ON_USE (srandom_r, "srandom_r is unportable - "
  623. "use gnulib module random_r for portability");
  624. # endif
  625. #endif
  626. #if @GNULIB_RANDOM_R@
  627. # if @REPLACE_RANDOM_R@
  628. # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
  629. # undef initstate_r
  630. # define initstate_r rpl_initstate_r
  631. # endif
  632. _GL_FUNCDECL_RPL (initstate_r, int,
  633. (unsigned int seed, char *buf, size_t buf_size,
  634. struct random_data *rand_state)
  635. _GL_ARG_NONNULL ((2, 4)));
  636. _GL_CXXALIAS_RPL (initstate_r, int,
  637. (unsigned int seed, char *buf, size_t buf_size,
  638. struct random_data *rand_state));
  639. # else
  640. # if !@HAVE_RANDOM_R@
  641. _GL_FUNCDECL_SYS (initstate_r, int,
  642. (unsigned int seed, char *buf, size_t buf_size,
  643. struct random_data *rand_state)
  644. _GL_ARG_NONNULL ((2, 4)));
  645. # endif
  646. _GL_CXXALIAS_SYS (initstate_r, int,
  647. (unsigned int seed, char *buf, size_t buf_size,
  648. struct random_data *rand_state));
  649. # endif
  650. _GL_CXXALIASWARN (initstate_r);
  651. #elif defined GNULIB_POSIXCHECK
  652. # undef initstate_r
  653. # if HAVE_RAW_DECL_INITSTATE_R
  654. _GL_WARN_ON_USE (initstate_r, "initstate_r is unportable - "
  655. "use gnulib module random_r for portability");
  656. # endif
  657. #endif
  658. #if @GNULIB_RANDOM_R@
  659. # if @REPLACE_RANDOM_R@
  660. # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
  661. # undef setstate_r
  662. # define setstate_r rpl_setstate_r
  663. # endif
  664. _GL_FUNCDECL_RPL (setstate_r, int,
  665. (char *arg_state, struct random_data *rand_state)
  666. _GL_ARG_NONNULL ((1, 2)));
  667. _GL_CXXALIAS_RPL (setstate_r, int,
  668. (char *arg_state, struct random_data *rand_state));
  669. # else
  670. # if !@HAVE_RANDOM_R@
  671. _GL_FUNCDECL_SYS (setstate_r, int,
  672. (char *arg_state, struct random_data *rand_state)
  673. _GL_ARG_NONNULL ((1, 2)));
  674. # endif
  675. _GL_CXXALIAS_SYS (setstate_r, int,
  676. (char *arg_state, struct random_data *rand_state));
  677. # endif
  678. _GL_CXXALIASWARN (setstate_r);
  679. #elif defined GNULIB_POSIXCHECK
  680. # undef setstate_r
  681. # if HAVE_RAW_DECL_SETSTATE_R
  682. _GL_WARN_ON_USE (setstate_r, "setstate_r is unportable - "
  683. "use gnulib module random_r for portability");
  684. # endif
  685. #endif
  686. #if @GNULIB_REALLOC_POSIX@
  687. # if @REPLACE_REALLOC@
  688. # if !((defined __cplusplus && defined GNULIB_NAMESPACE) \
  689. || _GL_USE_STDLIB_ALLOC)
  690. # undef realloc
  691. # define realloc rpl_realloc
  692. # endif
  693. _GL_FUNCDECL_RPL (realloc, void *, (void *ptr, size_t size));
  694. _GL_CXXALIAS_RPL (realloc, void *, (void *ptr, size_t size));
  695. # else
  696. _GL_CXXALIAS_SYS (realloc, void *, (void *ptr, size_t size));
  697. # endif
  698. _GL_CXXALIASWARN (realloc);
  699. #elif defined GNULIB_POSIXCHECK && !_GL_USE_STDLIB_ALLOC
  700. # undef realloc
  701. /* Assume realloc is always declared. */
  702. _GL_WARN_ON_USE (realloc, "realloc is not POSIX compliant everywhere - "
  703. "use gnulib module realloc-posix for portability");
  704. #endif
  705. #if @GNULIB_REALPATH@
  706. # if @REPLACE_REALPATH@
  707. # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
  708. # define realpath rpl_realpath
  709. # endif
  710. _GL_FUNCDECL_RPL (realpath, char *, (const char *name, char *resolved)
  711. _GL_ARG_NONNULL ((1)));
  712. _GL_CXXALIAS_RPL (realpath, char *, (const char *name, char *resolved));
  713. # else
  714. # if !@HAVE_REALPATH@
  715. _GL_FUNCDECL_SYS (realpath, char *, (const char *name, char *resolved)
  716. _GL_ARG_NONNULL ((1)));
  717. # endif
  718. _GL_CXXALIAS_SYS (realpath, char *, (const char *name, char *resolved));
  719. # endif
  720. _GL_CXXALIASWARN (realpath);
  721. #elif defined GNULIB_POSIXCHECK
  722. # undef realpath
  723. # if HAVE_RAW_DECL_REALPATH
  724. _GL_WARN_ON_USE (realpath, "realpath is unportable - use gnulib module "
  725. "canonicalize or canonicalize-lgpl for portability");
  726. # endif
  727. #endif
  728. #if @GNULIB_RPMATCH@
  729. /* Test a user response to a question.
  730. Return 1 if it is affirmative, 0 if it is negative, or -1 if not clear. */
  731. # if !@HAVE_RPMATCH@
  732. _GL_FUNCDECL_SYS (rpmatch, int, (const char *response) _GL_ARG_NONNULL ((1)));
  733. # endif
  734. _GL_CXXALIAS_SYS (rpmatch, int, (const char *response));
  735. _GL_CXXALIASWARN (rpmatch);
  736. #elif defined GNULIB_POSIXCHECK
  737. # undef rpmatch
  738. # if HAVE_RAW_DECL_RPMATCH
  739. _GL_WARN_ON_USE (rpmatch, "rpmatch is unportable - "
  740. "use gnulib module rpmatch for portability");
  741. # endif
  742. #endif
  743. #if @GNULIB_SECURE_GETENV@
  744. /* Look up NAME in the environment, returning 0 in insecure situations. */
  745. # if !@HAVE_SECURE_GETENV@
  746. _GL_FUNCDECL_SYS (secure_getenv, char *,
  747. (char const *name) _GL_ARG_NONNULL ((1)));
  748. # endif
  749. _GL_CXXALIAS_SYS (secure_getenv, char *, (char const *name));
  750. _GL_CXXALIASWARN (secure_getenv);
  751. #elif defined GNULIB_POSIXCHECK
  752. # undef secure_getenv
  753. # if HAVE_RAW_DECL_SECURE_GETENV
  754. _GL_WARN_ON_USE (secure_getenv, "secure_getenv is unportable - "
  755. "use gnulib module secure_getenv for portability");
  756. # endif
  757. #endif
  758. #if @GNULIB_SETENV@
  759. /* Set NAME to VALUE in the environment.
  760. If REPLACE is nonzero, overwrite an existing value. */
  761. # if @REPLACE_SETENV@
  762. # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
  763. # undef setenv
  764. # define setenv rpl_setenv
  765. # endif
  766. _GL_FUNCDECL_RPL (setenv, int,
  767. (const char *name, const char *value, int replace)
  768. _GL_ARG_NONNULL ((1)));
  769. _GL_CXXALIAS_RPL (setenv, int,
  770. (const char *name, const char *value, int replace));
  771. # else
  772. # if !@HAVE_DECL_SETENV@
  773. _GL_FUNCDECL_SYS (setenv, int,
  774. (const char *name, const char *value, int replace)
  775. _GL_ARG_NONNULL ((1)));
  776. # endif
  777. _GL_CXXALIAS_SYS (setenv, int,
  778. (const char *name, const char *value, int replace));
  779. # endif
  780. # if !(@REPLACE_SETENV@ && !@HAVE_DECL_SETENV@)
  781. _GL_CXXALIASWARN (setenv);
  782. # endif
  783. #elif defined GNULIB_POSIXCHECK
  784. # undef setenv
  785. # if HAVE_RAW_DECL_SETENV
  786. _GL_WARN_ON_USE (setenv, "setenv is unportable - "
  787. "use gnulib module setenv for portability");
  788. # endif
  789. #endif
  790. #if @GNULIB_STRTOD@
  791. /* Parse a double from STRING, updating ENDP if appropriate. */
  792. # if @REPLACE_STRTOD@
  793. # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
  794. # define strtod rpl_strtod
  795. # endif
  796. _GL_FUNCDECL_RPL (strtod, double, (const char *str, char **endp)
  797. _GL_ARG_NONNULL ((1)));
  798. _GL_CXXALIAS_RPL (strtod, double, (const char *str, char **endp));
  799. # else
  800. # if !@HAVE_STRTOD@
  801. _GL_FUNCDECL_SYS (strtod, double, (const char *str, char **endp)
  802. _GL_ARG_NONNULL ((1)));
  803. # endif
  804. _GL_CXXALIAS_SYS (strtod, double, (const char *str, char **endp));
  805. # endif
  806. _GL_CXXALIASWARN (strtod);
  807. #elif defined GNULIB_POSIXCHECK
  808. # undef strtod
  809. # if HAVE_RAW_DECL_STRTOD
  810. _GL_WARN_ON_USE (strtod, "strtod is unportable - "
  811. "use gnulib module strtod for portability");
  812. # endif
  813. #endif
  814. #if @GNULIB_STRTOLL@
  815. /* Parse a signed integer whose textual representation starts at STRING.
  816. The integer is expected to be in base BASE (2 <= BASE <= 36); if BASE == 0,
  817. it may be decimal or octal (with prefix "0") or hexadecimal (with prefix
  818. "0x").
  819. If ENDPTR is not NULL, the address of the first byte after the integer is
  820. stored in *ENDPTR.
  821. Upon overflow, the return value is LLONG_MAX or LLONG_MIN, and errno is set
  822. to ERANGE. */
  823. # if !@HAVE_STRTOLL@
  824. _GL_FUNCDECL_SYS (strtoll, long long,
  825. (const char *string, char **endptr, int base)
  826. _GL_ARG_NONNULL ((1)));
  827. # endif
  828. _GL_CXXALIAS_SYS (strtoll, long long,
  829. (const char *string, char **endptr, int base));
  830. _GL_CXXALIASWARN (strtoll);
  831. #elif defined GNULIB_POSIXCHECK
  832. # undef strtoll
  833. # if HAVE_RAW_DECL_STRTOLL
  834. _GL_WARN_ON_USE (strtoll, "strtoll is unportable - "
  835. "use gnulib module strtoll for portability");
  836. # endif
  837. #endif
  838. #if @GNULIB_STRTOULL@
  839. /* Parse an unsigned integer whose textual representation starts at STRING.
  840. The integer is expected to be in base BASE (2 <= BASE <= 36); if BASE == 0,
  841. it may be decimal or octal (with prefix "0") or hexadecimal (with prefix
  842. "0x").
  843. If ENDPTR is not NULL, the address of the first byte after the integer is
  844. stored in *ENDPTR.
  845. Upon overflow, the return value is ULLONG_MAX, and errno is set to
  846. ERANGE. */
  847. # if !@HAVE_STRTOULL@
  848. _GL_FUNCDECL_SYS (strtoull, unsigned long long,
  849. (const char *string, char **endptr, int base)
  850. _GL_ARG_NONNULL ((1)));
  851. # endif
  852. _GL_CXXALIAS_SYS (strtoull, unsigned long long,
  853. (const char *string, char **endptr, int base));
  854. _GL_CXXALIASWARN (strtoull);
  855. #elif defined GNULIB_POSIXCHECK
  856. # undef strtoull
  857. # if HAVE_RAW_DECL_STRTOULL
  858. _GL_WARN_ON_USE (strtoull, "strtoull is unportable - "
  859. "use gnulib module strtoull for portability");
  860. # endif
  861. #endif
  862. #if @GNULIB_UNLOCKPT@
  863. /* Unlock the slave side of the pseudo-terminal whose master side is specified
  864. by FD, so that it can be opened. */
  865. # if !@HAVE_UNLOCKPT@
  866. _GL_FUNCDECL_SYS (unlockpt, int, (int fd));
  867. # endif
  868. _GL_CXXALIAS_SYS (unlockpt, int, (int fd));
  869. _GL_CXXALIASWARN (unlockpt);
  870. #elif defined GNULIB_POSIXCHECK
  871. # undef unlockpt
  872. # if HAVE_RAW_DECL_UNLOCKPT
  873. _GL_WARN_ON_USE (unlockpt, "unlockpt is not portable - "
  874. "use gnulib module unlockpt for portability");
  875. # endif
  876. #endif
  877. #if @GNULIB_UNSETENV@
  878. /* Remove the variable NAME from the environment. */
  879. # if @REPLACE_UNSETENV@
  880. # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
  881. # undef unsetenv
  882. # define unsetenv rpl_unsetenv
  883. # endif
  884. _GL_FUNCDECL_RPL (unsetenv, int, (const char *name) _GL_ARG_NONNULL ((1)));
  885. _GL_CXXALIAS_RPL (unsetenv, int, (const char *name));
  886. # else
  887. # if !@HAVE_DECL_UNSETENV@
  888. _GL_FUNCDECL_SYS (unsetenv, int, (const char *name) _GL_ARG_NONNULL ((1)));
  889. # endif
  890. _GL_CXXALIAS_SYS (unsetenv, int, (const char *name));
  891. # endif
  892. # if !(@REPLACE_UNSETENV@ && !@HAVE_DECL_UNSETENV@)
  893. _GL_CXXALIASWARN (unsetenv);
  894. # endif
  895. #elif defined GNULIB_POSIXCHECK
  896. # undef unsetenv
  897. # if HAVE_RAW_DECL_UNSETENV
  898. _GL_WARN_ON_USE (unsetenv, "unsetenv is unportable - "
  899. "use gnulib module unsetenv for portability");
  900. # endif
  901. #endif
  902. /* Convert a wide character to a multibyte character. */
  903. #if @GNULIB_WCTOMB@
  904. # if @REPLACE_WCTOMB@
  905. # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
  906. # undef wctomb
  907. # define wctomb rpl_wctomb
  908. # endif
  909. _GL_FUNCDECL_RPL (wctomb, int, (char *s, wchar_t wc));
  910. _GL_CXXALIAS_RPL (wctomb, int, (char *s, wchar_t wc));
  911. # else
  912. _GL_CXXALIAS_SYS (wctomb, int, (char *s, wchar_t wc));
  913. # endif
  914. _GL_CXXALIASWARN (wctomb);
  915. #endif
  916. #endif /* _@GUARD_PREFIX@_STDLIB_H */
  917. #endif /* _@GUARD_PREFIX@_STDLIB_H */
  918. #endif