stdio.in.h 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542
  1. /* A GNU-like <stdio.h>.
  2. Copyright (C) 2004, 2007-2009 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 General Public License as published by
  5. the Free Software Foundation; either version 3, or (at your option)
  6. 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 General Public License for more details.
  11. You should have received a copy of the GNU General Public License
  12. along with this program; if not, write to the Free Software Foundation,
  13. Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
  14. #if __GNUC__ >= 3
  15. @PRAGMA_SYSTEM_HEADER@
  16. #endif
  17. #if defined __need_FILE || defined __need___FILE
  18. /* Special invocation convention inside glibc header files. */
  19. #@INCLUDE_NEXT@ @NEXT_STDIO_H@
  20. #else
  21. /* Normal invocation convention. */
  22. #ifndef _GL_STDIO_H
  23. /* The include_next requires a split double-inclusion guard. */
  24. #@INCLUDE_NEXT@ @NEXT_STDIO_H@
  25. #ifndef _GL_STDIO_H
  26. #define _GL_STDIO_H
  27. #include <stdarg.h>
  28. #include <stddef.h>
  29. #if (@GNULIB_FSEEKO@ && @REPLACE_FSEEKO@) \
  30. || (@GNULIB_FTELLO@ && @REPLACE_FTELLO@) \
  31. || (@GNULIB_GETDELIM@ && !@HAVE_DECL_GETDELIM@) \
  32. || (@GNULIB_GETLINE@ && (!@HAVE_DECL_GETLINE@ || @REPLACE_GETLINE@))
  33. /* Get off_t and ssize_t. */
  34. # include <sys/types.h>
  35. #endif
  36. #ifndef __attribute__
  37. /* This feature is available in gcc versions 2.5 and later. */
  38. # if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5)
  39. # define __attribute__(Spec) /* empty */
  40. # endif
  41. /* The __-protected variants of `format' and `printf' attributes
  42. are accepted by gcc versions 2.6.4 (effectively 2.7) and later. */
  43. # if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 7)
  44. # define __format__ format
  45. # define __printf__ printf
  46. # endif
  47. #endif
  48. /* The definition of GL_LINK_WARNING is copied here. */
  49. #ifdef __cplusplus
  50. extern "C" {
  51. #endif
  52. #if @GNULIB_FPRINTF_POSIX@
  53. # if @REPLACE_FPRINTF@
  54. # define fprintf rpl_fprintf
  55. extern int fprintf (FILE *fp, const char *format, ...)
  56. __attribute__ ((__format__ (__printf__, 2, 3)));
  57. # endif
  58. #elif @GNULIB_FPRINTF@ && @REPLACE_STDIO_WRITE_FUNCS@ && @GNULIB_STDIO_H_SIGPIPE@
  59. # define fprintf rpl_fprintf
  60. extern int fprintf (FILE *fp, const char *format, ...)
  61. __attribute__ ((__format__ (__printf__, 2, 3)));
  62. #elif defined GNULIB_POSIXCHECK
  63. # undef fprintf
  64. # define fprintf \
  65. (GL_LINK_WARNING ("fprintf is not always POSIX compliant - " \
  66. "use gnulib module fprintf-posix for portable " \
  67. "POSIX compliance"), \
  68. fprintf)
  69. #endif
  70. #if @GNULIB_VFPRINTF_POSIX@
  71. # if @REPLACE_VFPRINTF@
  72. # define vfprintf rpl_vfprintf
  73. extern int vfprintf (FILE *fp, const char *format, va_list args)
  74. __attribute__ ((__format__ (__printf__, 2, 0)));
  75. # endif
  76. #elif @GNULIB_VFPRINTF@ && @REPLACE_STDIO_WRITE_FUNCS@ && @GNULIB_STDIO_H_SIGPIPE@
  77. # define vfprintf rpl_vfprintf
  78. extern int vfprintf (FILE *fp, const char *format, va_list args)
  79. __attribute__ ((__format__ (__printf__, 2, 0)));
  80. #elif defined GNULIB_POSIXCHECK
  81. # undef vfprintf
  82. # define vfprintf(s,f,a) \
  83. (GL_LINK_WARNING ("vfprintf is not always POSIX compliant - " \
  84. "use gnulib module vfprintf-posix for portable " \
  85. "POSIX compliance"), \
  86. vfprintf (s, f, a))
  87. #endif
  88. #if @GNULIB_PRINTF_POSIX@
  89. # if @REPLACE_PRINTF@
  90. /* Don't break __attribute__((format(printf,M,N))). */
  91. # define printf __printf__
  92. extern int printf (const char *format, ...)
  93. __attribute__ ((__format__ (__printf__, 1, 2)));
  94. # endif
  95. #elif @GNULIB_PRINTF@ && @REPLACE_STDIO_WRITE_FUNCS@ && @GNULIB_STDIO_H_SIGPIPE@
  96. /* Don't break __attribute__((format(printf,M,N))). */
  97. # define printf __printf__
  98. extern int printf (const char *format, ...)
  99. __attribute__ ((__format__ (__printf__, 1, 2)));
  100. #elif defined GNULIB_POSIXCHECK
  101. # undef printf
  102. # define printf \
  103. (GL_LINK_WARNING ("printf is not always POSIX compliant - " \
  104. "use gnulib module printf-posix for portable " \
  105. "POSIX compliance"), \
  106. printf)
  107. /* Don't break __attribute__((format(printf,M,N))). */
  108. # define format(kind,m,n) format (__##kind##__, m, n)
  109. # define __format__(kind,m,n) __format__ (__##kind##__, m, n)
  110. # define ____printf____ __printf__
  111. # define ____scanf____ __scanf__
  112. # define ____strftime____ __strftime__
  113. # define ____strfmon____ __strfmon__
  114. #endif
  115. #if @GNULIB_VPRINTF_POSIX@
  116. # if @REPLACE_VPRINTF@
  117. # define vprintf rpl_vprintf
  118. extern int vprintf (const char *format, va_list args)
  119. __attribute__ ((__format__ (__printf__, 1, 0)));
  120. # endif
  121. #elif @GNULIB_VPRINTF@ && @REPLACE_STDIO_WRITE_FUNCS@ && @GNULIB_STDIO_H_SIGPIPE@
  122. # define vprintf rpl_vprintf
  123. extern int vprintf (const char *format, va_list args)
  124. __attribute__ ((__format__ (__printf__, 1, 0)));
  125. #elif defined GNULIB_POSIXCHECK
  126. # undef vprintf
  127. # define vprintf(f,a) \
  128. (GL_LINK_WARNING ("vprintf is not always POSIX compliant - " \
  129. "use gnulib module vprintf-posix for portable " \
  130. "POSIX compliance"), \
  131. vprintf (f, a))
  132. #endif
  133. #if @GNULIB_SNPRINTF@
  134. # if @REPLACE_SNPRINTF@
  135. # define snprintf rpl_snprintf
  136. # endif
  137. # if @REPLACE_SNPRINTF@ || !@HAVE_DECL_SNPRINTF@
  138. extern int snprintf (char *str, size_t size, const char *format, ...)
  139. __attribute__ ((__format__ (__printf__, 3, 4)));
  140. # endif
  141. #elif defined GNULIB_POSIXCHECK
  142. # undef snprintf
  143. # define snprintf \
  144. (GL_LINK_WARNING ("snprintf is unportable - " \
  145. "use gnulib module snprintf for portability"), \
  146. snprintf)
  147. #endif
  148. #if @GNULIB_VSNPRINTF@
  149. # if @REPLACE_VSNPRINTF@
  150. # define vsnprintf rpl_vsnprintf
  151. # endif
  152. # if @REPLACE_VSNPRINTF@ || !@HAVE_DECL_VSNPRINTF@
  153. extern int vsnprintf (char *str, size_t size, const char *format, va_list args)
  154. __attribute__ ((__format__ (__printf__, 3, 0)));
  155. # endif
  156. #elif defined GNULIB_POSIXCHECK
  157. # undef vsnprintf
  158. # define vsnprintf(b,s,f,a) \
  159. (GL_LINK_WARNING ("vsnprintf is unportable - " \
  160. "use gnulib module vsnprintf for portability"), \
  161. vsnprintf (b, s, f, a))
  162. #endif
  163. #if @GNULIB_SPRINTF_POSIX@
  164. # if @REPLACE_SPRINTF@
  165. # define sprintf rpl_sprintf
  166. extern int sprintf (char *str, const char *format, ...)
  167. __attribute__ ((__format__ (__printf__, 2, 3)));
  168. # endif
  169. #elif defined GNULIB_POSIXCHECK
  170. # undef sprintf
  171. # define sprintf \
  172. (GL_LINK_WARNING ("sprintf is not always POSIX compliant - " \
  173. "use gnulib module sprintf-posix for portable " \
  174. "POSIX compliance"), \
  175. sprintf)
  176. #endif
  177. #if @GNULIB_VSPRINTF_POSIX@
  178. # if @REPLACE_VSPRINTF@
  179. # define vsprintf rpl_vsprintf
  180. extern int vsprintf (char *str, const char *format, va_list args)
  181. __attribute__ ((__format__ (__printf__, 2, 0)));
  182. # endif
  183. #elif defined GNULIB_POSIXCHECK
  184. # undef vsprintf
  185. # define vsprintf(b,f,a) \
  186. (GL_LINK_WARNING ("vsprintf is not always POSIX compliant - " \
  187. "use gnulib module vsprintf-posix for portable " \
  188. "POSIX compliance"), \
  189. vsprintf (b, f, a))
  190. #endif
  191. #if @GNULIB_DPRINTF@
  192. # if @REPLACE_DPRINTF@
  193. # define dprintf rpl_dprintf
  194. # endif
  195. # if @REPLACE_DPRINTF@ || !@HAVE_DPRINTF@
  196. extern int dprintf (int fd, const char *format, ...)
  197. __attribute__ ((__format__ (__printf__, 2, 3)));
  198. # endif
  199. #elif defined GNULIB_POSIXCHECK
  200. # undef dprintf
  201. # define dprintf(d,f,a) \
  202. (GL_LINK_WARNING ("dprintf is unportable - " \
  203. "use gnulib module dprintf for portability"), \
  204. dprintf (d, f, a))
  205. #endif
  206. #if @GNULIB_VDPRINTF@
  207. # if @REPLACE_VDPRINTF@
  208. # define vdprintf rpl_vdprintf
  209. # endif
  210. # if @REPLACE_VDPRINTF@ || !@HAVE_VDPRINTF@
  211. extern int vdprintf (int fd, const char *format, va_list args)
  212. __attribute__ ((__format__ (__printf__, 2, 0)));
  213. # endif
  214. #elif defined GNULIB_POSIXCHECK
  215. # undef vdprintf
  216. # define vdprintf(d,f,a) \
  217. (GL_LINK_WARNING ("vdprintf is unportable - " \
  218. "use gnulib module vdprintf for portability"), \
  219. vdprintf (d, f, a))
  220. #endif
  221. #if @GNULIB_VASPRINTF@
  222. # if @REPLACE_VASPRINTF@
  223. # define asprintf rpl_asprintf
  224. # define vasprintf rpl_vasprintf
  225. # endif
  226. # if @REPLACE_VASPRINTF@ || !@HAVE_VASPRINTF@
  227. /* Write formatted output to a string dynamically allocated with malloc().
  228. If the memory allocation succeeds, store the address of the string in
  229. *RESULT and return the number of resulting bytes, excluding the trailing
  230. NUL. Upon memory allocation error, or some other error, return -1. */
  231. extern int asprintf (char **result, const char *format, ...)
  232. __attribute__ ((__format__ (__printf__, 2, 3)));
  233. extern int vasprintf (char **result, const char *format, va_list args)
  234. __attribute__ ((__format__ (__printf__, 2, 0)));
  235. # endif
  236. #endif
  237. #if @GNULIB_OBSTACK_PRINTF@
  238. # if @REPLACE_OBSTACK_PRINTF@
  239. # define obstack_printf rpl_osbtack_printf
  240. # define obstack_vprintf rpl_obstack_vprintf
  241. # endif
  242. # if @REPLACE_OBSTACK_PRINTF@ || !@HAVE_DECL_OBSTACK_PRINTF@
  243. struct obstack;
  244. /* Grow an obstack with formatted output. Return the number of
  245. bytes added to OBS. No trailing nul byte is added, and the
  246. object should be closed with obstack_finish before use. Upon
  247. memory allocation error, call obstack_alloc_failed_handler. Upon
  248. other error, return -1. */
  249. extern int obstack_printf (struct obstack *obs, const char *format, ...)
  250. __attribute__ ((__format__ (__printf__, 2, 3)));
  251. extern int obstack_vprintf (struct obstack *obs, const char *format,
  252. va_list args)
  253. __attribute__ ((__format__ (__printf__, 2, 0)));
  254. # endif
  255. #endif
  256. #if @GNULIB_FOPEN@
  257. # if @REPLACE_FOPEN@
  258. # undef fopen
  259. # define fopen rpl_fopen
  260. extern FILE * fopen (const char *filename, const char *mode);
  261. # endif
  262. #elif defined GNULIB_POSIXCHECK
  263. # undef fopen
  264. # define fopen(f,m) \
  265. (GL_LINK_WARNING ("fopen on Win32 platforms is not POSIX compatible - " \
  266. "use gnulib module fopen for portability"), \
  267. fopen (f, m))
  268. #endif
  269. #if @GNULIB_FREOPEN@
  270. # if @REPLACE_FREOPEN@
  271. # undef freopen
  272. # define freopen rpl_freopen
  273. extern FILE * freopen (const char *filename, const char *mode, FILE *stream);
  274. # endif
  275. #elif defined GNULIB_POSIXCHECK
  276. # undef freopen
  277. # define freopen(f,m,s) \
  278. (GL_LINK_WARNING ("freopen on Win32 platforms is not POSIX compatible - " \
  279. "use gnulib module freopen for portability"), \
  280. freopen (f, m, s))
  281. #endif
  282. #if @GNULIB_FSEEKO@
  283. # if @REPLACE_FSEEKO@
  284. /* Provide fseek, fseeko functions that are aware of a preceding
  285. fflush(), and which detect pipes. */
  286. # define fseeko rpl_fseeko
  287. extern int fseeko (FILE *fp, off_t offset, int whence);
  288. # define fseek(fp, offset, whence) fseeko (fp, (off_t)(offset), whence)
  289. # endif
  290. #elif defined GNULIB_POSIXCHECK
  291. # undef fseeko
  292. # define fseeko(f,o,w) \
  293. (GL_LINK_WARNING ("fseeko is unportable - " \
  294. "use gnulib module fseeko for portability"), \
  295. fseeko (f, o, w))
  296. #endif
  297. #if @GNULIB_FSEEK@ && @REPLACE_FSEEK@
  298. extern int rpl_fseek (FILE *fp, long offset, int whence);
  299. # undef fseek
  300. # if defined GNULIB_POSIXCHECK
  301. # define fseek(f,o,w) \
  302. (GL_LINK_WARNING ("fseek cannot handle files larger than 4 GB " \
  303. "on 32-bit platforms - " \
  304. "use fseeko function for handling of large files"), \
  305. rpl_fseek (f, o, w))
  306. # else
  307. # define fseek rpl_fseek
  308. # endif
  309. #elif defined GNULIB_POSIXCHECK
  310. # ifndef fseek
  311. # define fseek(f,o,w) \
  312. (GL_LINK_WARNING ("fseek cannot handle files larger than 4 GB " \
  313. "on 32-bit platforms - " \
  314. "use fseeko function for handling of large files"), \
  315. fseek (f, o, w))
  316. # endif
  317. #endif
  318. #if @GNULIB_FTELLO@
  319. # if @REPLACE_FTELLO@
  320. # define ftello rpl_ftello
  321. extern off_t ftello (FILE *fp);
  322. # define ftell(fp) ftello (fp)
  323. # endif
  324. #elif defined GNULIB_POSIXCHECK
  325. # undef ftello
  326. # define ftello(f) \
  327. (GL_LINK_WARNING ("ftello is unportable - " \
  328. "use gnulib module ftello for portability"), \
  329. ftello (f))
  330. #endif
  331. #if @GNULIB_FTELL@ && @REPLACE_FTELL@
  332. extern long rpl_ftell (FILE *fp);
  333. # undef ftell
  334. # if GNULIB_POSIXCHECK
  335. # define ftell(f) \
  336. (GL_LINK_WARNING ("ftell cannot handle files larger than 4 GB " \
  337. "on 32-bit platforms - " \
  338. "use ftello function for handling of large files"), \
  339. rpl_ftell (f))
  340. # else
  341. # define ftell rpl_ftell
  342. # endif
  343. #elif defined GNULIB_POSIXCHECK
  344. # ifndef ftell
  345. # define ftell(f) \
  346. (GL_LINK_WARNING ("ftell cannot handle files larger than 4 GB " \
  347. "on 32-bit platforms - " \
  348. "use ftello function for handling of large files"), \
  349. ftell (f))
  350. # endif
  351. #endif
  352. #if @GNULIB_FFLUSH@
  353. # if @REPLACE_FFLUSH@
  354. # define fflush rpl_fflush
  355. /* Flush all pending data on STREAM according to POSIX rules. Both
  356. output and seekable input streams are supported.
  357. Note! LOSS OF DATA can occur if fflush is applied on an input stream
  358. that is _not_seekable_ or on an update stream that is _not_seekable_
  359. and in which the most recent operation was input. Seekability can
  360. be tested with lseek(fileno(fp),0,SEEK_CUR). */
  361. extern int fflush (FILE *gl_stream);
  362. # endif
  363. #elif defined GNULIB_POSIXCHECK
  364. # undef fflush
  365. # define fflush(f) \
  366. (GL_LINK_WARNING ("fflush is not always POSIX compliant - " \
  367. "use gnulib module fflush for portable " \
  368. "POSIX compliance"), \
  369. fflush (f))
  370. #endif
  371. #if @GNULIB_FPURGE@
  372. # if @REPLACE_FPURGE@
  373. # define fpurge rpl_fpurge
  374. # endif
  375. # if @REPLACE_FPURGE@ || !@HAVE_DECL_FPURGE@
  376. /* Discard all pending buffered I/O data on STREAM.
  377. STREAM must not be wide-character oriented.
  378. Return 0 if successful. Upon error, return -1 and set errno. */
  379. extern int fpurge (FILE *gl_stream);
  380. # endif
  381. #elif defined GNULIB_POSIXCHECK
  382. # undef fpurge
  383. # define fpurge(f) \
  384. (GL_LINK_WARNING ("fpurge is not always present - " \
  385. "use gnulib module fpurge for portability"), \
  386. fpurge (f))
  387. #endif
  388. #if @GNULIB_FCLOSE@
  389. # if @REPLACE_FCLOSE@
  390. # define fclose rpl_fclose
  391. /* Close STREAM and its underlying file descriptor. */
  392. extern int fclose (FILE *stream);
  393. # endif
  394. #elif defined GNULIB_POSIXCHECK
  395. # undef fclose
  396. # define fclose(f) \
  397. (GL_LINK_WARNING ("fclose is not always POSIX compliant - " \
  398. "use gnulib module fclose for portable " \
  399. "POSIX compliance"), \
  400. fclose (f))
  401. #endif
  402. #if @GNULIB_FPUTC@ && @REPLACE_STDIO_WRITE_FUNCS@ && @GNULIB_STDIO_H_SIGPIPE@
  403. # undef fputc
  404. # define fputc rpl_fputc
  405. extern int fputc (int c, FILE *stream);
  406. #endif
  407. #if @GNULIB_PUTC@ && @REPLACE_STDIO_WRITE_FUNCS@ && @GNULIB_STDIO_H_SIGPIPE@
  408. # undef putc
  409. # define putc rpl_fputc
  410. extern int putc (int c, FILE *stream);
  411. #endif
  412. #if @GNULIB_PUTCHAR@ && @REPLACE_STDIO_WRITE_FUNCS@ && @GNULIB_STDIO_H_SIGPIPE@
  413. # undef putchar
  414. # define putchar rpl_putchar
  415. extern int putchar (int c);
  416. #endif
  417. #if @GNULIB_FPUTS@ && @REPLACE_STDIO_WRITE_FUNCS@ && @GNULIB_STDIO_H_SIGPIPE@
  418. # undef fputs
  419. # define fputs rpl_fputs
  420. extern int fputs (const char *string, FILE *stream);
  421. #endif
  422. #if @GNULIB_PUTS@ && @REPLACE_STDIO_WRITE_FUNCS@ && @GNULIB_STDIO_H_SIGPIPE@
  423. # undef puts
  424. # define puts rpl_puts
  425. extern int puts (const char *string);
  426. #endif
  427. #if @GNULIB_FWRITE@ && @REPLACE_STDIO_WRITE_FUNCS@ && @GNULIB_STDIO_H_SIGPIPE@
  428. # undef fwrite
  429. # define fwrite rpl_fwrite
  430. extern size_t fwrite (const void *ptr, size_t s, size_t n, FILE *stream);
  431. #endif
  432. #if @GNULIB_GETDELIM@
  433. # if !@HAVE_DECL_GETDELIM@
  434. /* Read input, up to (and including) the next occurrence of DELIMITER, from
  435. STREAM, store it in *LINEPTR (and NUL-terminate it).
  436. *LINEPTR is a pointer returned from malloc (or NULL), pointing to *LINESIZE
  437. bytes of space. It is realloc'd as necessary.
  438. Return the number of bytes read and stored at *LINEPTR (not including the
  439. NUL terminator), or -1 on error or EOF. */
  440. extern ssize_t getdelim (char **lineptr, size_t *linesize, int delimiter,
  441. FILE *stream);
  442. # endif
  443. #elif defined GNULIB_POSIXCHECK
  444. # undef getdelim
  445. # define getdelim(l, s, d, f) \
  446. (GL_LINK_WARNING ("getdelim is unportable - " \
  447. "use gnulib module getdelim for portability"), \
  448. getdelim (l, s, d, f))
  449. #endif
  450. #if @GNULIB_GETLINE@
  451. # if @REPLACE_GETLINE@
  452. # undef getline
  453. # define getline rpl_getline
  454. # endif
  455. # if !@HAVE_DECL_GETLINE@ || @REPLACE_GETLINE@
  456. /* Read a line, up to (and including) the next newline, from STREAM, store it
  457. in *LINEPTR (and NUL-terminate it).
  458. *LINEPTR is a pointer returned from malloc (or NULL), pointing to *LINESIZE
  459. bytes of space. It is realloc'd as necessary.
  460. Return the number of bytes read and stored at *LINEPTR (not including the
  461. NUL terminator), or -1 on error or EOF. */
  462. extern ssize_t getline (char **lineptr, size_t *linesize, FILE *stream);
  463. # endif
  464. #elif defined GNULIB_POSIXCHECK
  465. # undef getline
  466. # define getline(l, s, f) \
  467. (GL_LINK_WARNING ("getline is unportable - " \
  468. "use gnulib module getline for portability"), \
  469. getline (l, s, f))
  470. #endif
  471. #if @GNULIB_PERROR@
  472. # if @REPLACE_PERROR@
  473. # define perror rpl_perror
  474. /* Print a message to standard error, describing the value of ERRNO,
  475. (if STRING is not NULL and not empty) prefixed with STRING and ": ",
  476. and terminated with a newline. */
  477. extern void perror (const char *string);
  478. # endif
  479. #elif defined GNULIB_POSIXCHECK
  480. # undef perror
  481. # define perror(s) \
  482. (GL_LINK_WARNING ("perror is not always POSIX compliant - " \
  483. "use gnulib module perror for portability"), \
  484. perror (s))
  485. #endif
  486. #ifdef __cplusplus
  487. }
  488. #endif
  489. #endif /* _GL_STDIO_H */
  490. #endif /* _GL_STDIO_H */
  491. #endif