1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18 #if __GNUC__ >= 3
19 @PRAGMA_SYSTEM_HEADER@
20 #endif
21 @PRAGMA_COLUMNS@
22
23 #if defined __need_FILE || defined __need___FILE || defined _GL_ALREADY_INCLUDING_STDIO_H
24
25
26
27
28
29
30
31
32 #@INCLUDE_NEXT@ @NEXT_STDIO_H@
33
34 #else
35
36
37 #ifndef _@GUARD_PREFIX@_STDIO_H
38
39 #define _GL_ALREADY_INCLUDING_STDIO_H
40
41
42 #@INCLUDE_NEXT@ @NEXT_STDIO_H@
43
44 #undef _GL_ALREADY_INCLUDING_STDIO_H
45
46 #ifndef _@GUARD_PREFIX@_STDIO_H
47 #define _@GUARD_PREFIX@_STDIO_H
48
49
50 #include <stdarg.h>
51
52 #include <stddef.h>
53
54
55
56
57 #include <sys/types.h>
58
59
60
61 #if (@GNULIB_RENAMEAT@ || defined GNULIB_POSIXCHECK) && (defined __sun || defined __NetBSD__) \
62 && ! defined __GLIBC__
63 # include <unistd.h>
64 #endif
65
66
67
68 #if (@GNULIB_RENAMEAT@ || defined GNULIB_POSIXCHECK) && defined __ANDROID__ \
69 && ! defined __GLIBC__
70 # include <sys/stat.h>
71 #endif
72
73
74
75
76 #if (@GNULIB_PERROR@ || defined GNULIB_POSIXCHECK) \
77 && (defined _WIN32 && ! defined __CYGWIN__) \
78 && ! defined __GLIBC__
79 # include <stdlib.h>
80 #endif
81
82
83
84
85
86
87 #if (@GNULIB_REMOVE@ || @GNULIB_RENAME@ || defined GNULIB_POSIXCHECK) \
88 && (defined _WIN32 && ! defined __CYGWIN__) \
89 && ! defined __GLIBC__
90 # include <io.h>
91 #endif
92
93
94
95
96
97 #ifndef _GL_ATTRIBUTE_DEALLOC
98 # if __GNUC__ >= 11
99 # define _GL_ATTRIBUTE_DEALLOC(f, i) __attribute__ ((__malloc__ (f, i)))
100 # else
101 # define _GL_ATTRIBUTE_DEALLOC(f, i)
102 # endif
103 #endif
104
105
106
107
108
109
110
111 #ifndef _GL_ATTRIBUTE_FORMAT
112 # if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 7) || defined __clang__
113 # define _GL_ATTRIBUTE_FORMAT(spec) __attribute__ ((__format__ spec))
114 # else
115 # define _GL_ATTRIBUTE_FORMAT(spec)
116 # endif
117 #endif
118
119
120
121
122
123
124 #if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4)
125 # define _GL_ATTRIBUTE_SPEC_PRINTF_STANDARD __gnu_printf__
126 #else
127 # define _GL_ATTRIBUTE_SPEC_PRINTF_STANDARD __printf__
128 #endif
129
130
131
132
133
134
135
136
137 #if GNULIB_PRINTF_ATTRIBUTE_FLAVOR_GNU
138 # define _GL_ATTRIBUTE_SPEC_PRINTF_SYSTEM _GL_ATTRIBUTE_SPEC_PRINTF_STANDARD
139 #else
140 # define _GL_ATTRIBUTE_SPEC_PRINTF_SYSTEM __printf__
141 #endif
142
143
144
145
146
147 #define _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD(formatstring_parameter, first_argument) \
148 _GL_ATTRIBUTE_FORMAT ((_GL_ATTRIBUTE_SPEC_PRINTF_STANDARD, formatstring_parameter, first_argument))
149
150
151
152
153
154 #define _GL_ATTRIBUTE_FORMAT_PRINTF_SYSTEM(formatstring_parameter, first_argument) \
155 _GL_ATTRIBUTE_FORMAT ((_GL_ATTRIBUTE_SPEC_PRINTF_SYSTEM, formatstring_parameter, first_argument))
156
157
158
159
160
161 #if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4)
162 # define _GL_ATTRIBUTE_FORMAT_SCANF(formatstring_parameter, first_argument) \
163 _GL_ATTRIBUTE_FORMAT ((__gnu_scanf__, formatstring_parameter, first_argument))
164 #else
165 # define _GL_ATTRIBUTE_FORMAT_SCANF(formatstring_parameter, first_argument) \
166 _GL_ATTRIBUTE_FORMAT ((__scanf__, formatstring_parameter, first_argument))
167 #endif
168
169
170
171
172
173 #define _GL_ATTRIBUTE_FORMAT_SCANF_SYSTEM(formatstring_parameter, first_argument) \
174 _GL_ATTRIBUTE_FORMAT ((__scanf__, formatstring_parameter, first_argument))
175
176
177
178
179
180
181
182
183 #define _GL_STDIO_STRINGIZE(token) #token
184 #define _GL_STDIO_MACROEXPAND_AND_STRINGIZE(token) _GL_STDIO_STRINGIZE(token)
185
186
187
188
189
190
191 #if (defined _GL_EXTERN_INLINE_IN_USE && defined __APPLE__ \
192 && defined __GNUC__ && defined __STDC__)
193 # undef putc_unlocked
194 #endif
195
196 #if @GNULIB_DPRINTF@
197 # if @REPLACE_DPRINTF@
198 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
199 # define dprintf rpl_dprintf
200 # endif
201 _GL_FUNCDECL_RPL (dprintf, int, (int fd, const char *restrict format, ...)
202 _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 3)
203 _GL_ARG_NONNULL ((2)));
204 _GL_CXXALIAS_RPL (dprintf, int, (int fd, const char *restrict format, ...));
205 # else
206 # if !@HAVE_DPRINTF@
207 _GL_FUNCDECL_SYS (dprintf, int, (int fd, const char *restrict format, ...)
208 _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 3)
209 _GL_ARG_NONNULL ((2)));
210 # endif
211 _GL_CXXALIAS_SYS (dprintf, int, (int fd, const char *restrict format, ...));
212 # endif
213 _GL_CXXALIASWARN (dprintf);
214 #elif defined GNULIB_POSIXCHECK
215 # undef dprintf
216 # if HAVE_RAW_DECL_DPRINTF
217 _GL_WARN_ON_USE (dprintf, "dprintf is unportable - "
218 "use gnulib module dprintf for portability");
219 # endif
220 #endif
221
222 #if @GNULIB_FCLOSE@
223
224 # if @REPLACE_FCLOSE@
225 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
226 # define fclose rpl_fclose
227 # endif
228 _GL_FUNCDECL_RPL (fclose, int, (FILE *stream) _GL_ARG_NONNULL ((1)));
229 _GL_CXXALIAS_RPL (fclose, int, (FILE *stream));
230 # else
231 _GL_CXXALIAS_SYS (fclose, int, (FILE *stream));
232 # endif
233 # if __GLIBC__ >= 2
234 _GL_CXXALIASWARN (fclose);
235 # endif
236 #elif defined GNULIB_POSIXCHECK
237 # undef fclose
238
239 _GL_WARN_ON_USE (fclose, "fclose is not always POSIX compliant - "
240 "use gnulib module fclose for portable POSIX compliance");
241 #endif
242
243 #if @GNULIB_MDA_FCLOSEALL@
244
245
246
247
248 # if defined _WIN32 && !defined __CYGWIN__
249 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
250 # undef fcloseall
251 # define fcloseall _fcloseall
252 # endif
253 _GL_CXXALIAS_MDA (fcloseall, int, (void));
254 # else
255 # if @HAVE_DECL_FCLOSEALL@
256 # if defined __FreeBSD__ || defined __DragonFly__
257 _GL_CXXALIAS_SYS (fcloseall, void, (void));
258 # else
259 _GL_CXXALIAS_SYS (fcloseall, int, (void));
260 # endif
261 # endif
262 # endif
263 # if (defined _WIN32 && !defined __CYGWIN__) || @HAVE_DECL_FCLOSEALL@
264 _GL_CXXALIASWARN (fcloseall);
265 # endif
266 #endif
267
268 #if @GNULIB_FDOPEN@
269 # if @REPLACE_FDOPEN@
270 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
271 # undef fdopen
272 # define fdopen rpl_fdopen
273 # endif
274 _GL_FUNCDECL_RPL (fdopen, FILE *,
275 (int fd, const char *mode)
276 _GL_ARG_NONNULL ((2)) _GL_ATTRIBUTE_DEALLOC (fclose, 1));
277 _GL_CXXALIAS_RPL (fdopen, FILE *, (int fd, const char *mode));
278 # elif defined _WIN32 && !defined __CYGWIN__
279 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
280 # undef fdopen
281 # define fdopen _fdopen
282 # endif
283 _GL_CXXALIAS_MDA (fdopen, FILE *, (int fd, const char *mode));
284 # else
285 # if __GNUC__ >= 11
286
287 _GL_FUNCDECL_SYS (fdopen, FILE *,
288 (int fd, const char *mode)
289 _GL_ARG_NONNULL ((2)) _GL_ATTRIBUTE_DEALLOC (fclose, 1));
290 # endif
291 _GL_CXXALIAS_SYS (fdopen, FILE *, (int fd, const char *mode));
292 # endif
293 _GL_CXXALIASWARN (fdopen);
294 #else
295 # if @GNULIB_FCLOSE@ && __GNUC__ >= 11 && !defined fdopen
296
297 _GL_FUNCDECL_SYS (fdopen, FILE *,
298 (int fd, const char *mode)
299 _GL_ARG_NONNULL ((2)) _GL_ATTRIBUTE_DEALLOC (fclose, 1));
300 # endif
301 # if defined GNULIB_POSIXCHECK
302 # undef fdopen
303
304 _GL_WARN_ON_USE (fdopen, "fdopen on native Windows platforms is not POSIX compliant - "
305 "use gnulib module fdopen for portability");
306 # elif @GNULIB_MDA_FDOPEN@
307
308
309
310 # if defined _WIN32 && !defined __CYGWIN__
311 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
312 # undef fdopen
313 # define fdopen _fdopen
314 # endif
315 _GL_CXXALIAS_MDA (fdopen, FILE *, (int fd, const char *mode));
316 # else
317 _GL_CXXALIAS_SYS (fdopen, FILE *, (int fd, const char *mode));
318 # endif
319 _GL_CXXALIASWARN (fdopen);
320 # endif
321 #endif
322
323 #if @GNULIB_FFLUSH@
324
325
326
327
328
329
330 # if @REPLACE_FFLUSH@
331 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
332 # define fflush rpl_fflush
333 # endif
334 _GL_FUNCDECL_RPL (fflush, int, (FILE *gl_stream));
335 _GL_CXXALIAS_RPL (fflush, int, (FILE *gl_stream));
336 # else
337 _GL_CXXALIAS_SYS (fflush, int, (FILE *gl_stream));
338 # endif
339 # if __GLIBC__ >= 2
340 _GL_CXXALIASWARN (fflush);
341 # endif
342 #elif defined GNULIB_POSIXCHECK
343 # undef fflush
344
345 _GL_WARN_ON_USE (fflush, "fflush is not always POSIX compliant - "
346 "use gnulib module fflush for portable POSIX compliance");
347 #endif
348
349 #if @GNULIB_FGETC@
350 # if @REPLACE_STDIO_READ_FUNCS@ && @GNULIB_STDIO_H_NONBLOCKING@
351 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
352 # undef fgetc
353 # define fgetc rpl_fgetc
354 # endif
355 _GL_FUNCDECL_RPL (fgetc, int, (FILE *stream) _GL_ARG_NONNULL ((1)));
356 _GL_CXXALIAS_RPL (fgetc, int, (FILE *stream));
357 # else
358 _GL_CXXALIAS_SYS (fgetc, int, (FILE *stream));
359 # endif
360 # if __GLIBC__ >= 2
361 _GL_CXXALIASWARN (fgetc);
362 # endif
363 #endif
364
365 #if @GNULIB_FGETS@
366 # if @REPLACE_STDIO_READ_FUNCS@ && @GNULIB_STDIO_H_NONBLOCKING@
367 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
368 # undef fgets
369 # define fgets rpl_fgets
370 # endif
371 _GL_FUNCDECL_RPL (fgets, char *,
372 (char *restrict s, int n, FILE *restrict stream)
373 _GL_ARG_NONNULL ((1, 3)));
374 _GL_CXXALIAS_RPL (fgets, char *,
375 (char *restrict s, int n, FILE *restrict stream));
376 # else
377 _GL_CXXALIAS_SYS (fgets, char *,
378 (char *restrict s, int n, FILE *restrict stream));
379 # endif
380 # if __GLIBC__ >= 2
381 _GL_CXXALIASWARN (fgets);
382 # endif
383 #endif
384
385 #if @GNULIB_MDA_FILENO@
386
387
388
389 # if defined _WIN32 && !defined __CYGWIN__
390 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
391 # undef fileno
392 # define fileno _fileno
393 # endif
394 _GL_CXXALIAS_MDA (fileno, int, (FILE *restrict stream));
395 # else
396 _GL_CXXALIAS_SYS (fileno, int, (FILE *restrict stream));
397 # endif
398 _GL_CXXALIASWARN (fileno);
399 #endif
400
401 #if @GNULIB_FOPEN@
402 # if (@GNULIB_FOPEN@ && @REPLACE_FOPEN@) \
403 || (@GNULIB_FOPEN_GNU@ && @REPLACE_FOPEN_FOR_FOPEN_GNU@)
404 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
405 # undef fopen
406 # define fopen rpl_fopen
407 # endif
408 _GL_FUNCDECL_RPL (fopen, FILE *,
409 (const char *restrict filename, const char *restrict mode)
410 _GL_ARG_NONNULL ((1, 2)) _GL_ATTRIBUTE_DEALLOC (fclose, 1));
411 _GL_CXXALIAS_RPL (fopen, FILE *,
412 (const char *restrict filename, const char *restrict mode));
413 # else
414 # if __GNUC__ >= 11
415
416 _GL_FUNCDECL_SYS (fopen, FILE *,
417 (const char *restrict filename, const char *restrict mode)
418 _GL_ARG_NONNULL ((1, 2)) _GL_ATTRIBUTE_DEALLOC (fclose, 1));
419 # endif
420 _GL_CXXALIAS_SYS (fopen, FILE *,
421 (const char *restrict filename, const char *restrict mode));
422 # endif
423 # if __GLIBC__ >= 2
424 _GL_CXXALIASWARN (fopen);
425 # endif
426 #else
427 # if @GNULIB_FCLOSE@ && __GNUC__ >= 11 && !defined fopen
428
429 _GL_FUNCDECL_SYS (fopen, FILE *,
430 (const char *restrict filename, const char *restrict mode)
431 _GL_ARG_NONNULL ((1, 2)) _GL_ATTRIBUTE_DEALLOC (fclose, 1));
432 # endif
433 # if defined GNULIB_POSIXCHECK
434 # undef fopen
435
436 _GL_WARN_ON_USE (fopen, "fopen on native Windows platforms is not POSIX compliant - "
437 "use gnulib module fopen for portability");
438 # endif
439 #endif
440
441 #if @GNULIB_FPRINTF_POSIX@ || @GNULIB_FPRINTF@
442 # if (@GNULIB_FPRINTF_POSIX@ && @REPLACE_FPRINTF@) \
443 || (@GNULIB_FPRINTF@ && @REPLACE_STDIO_WRITE_FUNCS@ && (@GNULIB_STDIO_H_NONBLOCKING@ || @GNULIB_STDIO_H_SIGPIPE@))
444 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
445 # define fprintf rpl_fprintf
446 # endif
447 # define GNULIB_overrides_fprintf 1
448 # if @GNULIB_FPRINTF_POSIX@ || @GNULIB_VFPRINTF_POSIX@
449 _GL_FUNCDECL_RPL (fprintf, int,
450 (FILE *restrict fp, const char *restrict format, ...)
451 _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 3)
452 _GL_ARG_NONNULL ((1, 2)));
453 # else
454 _GL_FUNCDECL_RPL (fprintf, int,
455 (FILE *restrict fp, const char *restrict format, ...)
456 _GL_ATTRIBUTE_FORMAT_PRINTF_SYSTEM (2, 3)
457 _GL_ARG_NONNULL ((1, 2)));
458 # endif
459 _GL_CXXALIAS_RPL (fprintf, int,
460 (FILE *restrict fp, const char *restrict format, ...));
461 # else
462 _GL_CXXALIAS_SYS (fprintf, int,
463 (FILE *restrict fp, const char *restrict format, ...));
464 # endif
465 # if __GLIBC__ >= 2
466 _GL_CXXALIASWARN (fprintf);
467 # endif
468 #endif
469 #if !@GNULIB_FPRINTF_POSIX@ && defined GNULIB_POSIXCHECK
470 # if !GNULIB_overrides_fprintf
471 # undef fprintf
472 # endif
473
474 _GL_WARN_ON_USE (fprintf, "fprintf is not always POSIX compliant - "
475 "use gnulib module fprintf-posix for portable "
476 "POSIX compliance");
477 #endif
478
479 #if @GNULIB_FPURGE@
480
481
482
483
484
485
486 # if @REPLACE_FPURGE@
487 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
488 # define fpurge rpl_fpurge
489 # endif
490 _GL_FUNCDECL_RPL (fpurge, int, (FILE *gl_stream) _GL_ARG_NONNULL ((1)));
491 _GL_CXXALIAS_RPL (fpurge, int, (FILE *gl_stream));
492 # else
493 # if !@HAVE_DECL_FPURGE@
494 _GL_FUNCDECL_SYS (fpurge, int, (FILE *gl_stream) _GL_ARG_NONNULL ((1)));
495 # endif
496 _GL_CXXALIAS_SYS (fpurge, int, (FILE *gl_stream));
497 # endif
498 _GL_CXXALIASWARN (fpurge);
499 #elif defined GNULIB_POSIXCHECK
500 # undef fpurge
501 # if HAVE_RAW_DECL_FPURGE
502 _GL_WARN_ON_USE (fpurge, "fpurge is not always present - "
503 "use gnulib module fpurge for portability");
504 # endif
505 #endif
506
507 #if @GNULIB_FPUTC@
508 # if @REPLACE_STDIO_WRITE_FUNCS@ && (@GNULIB_STDIO_H_NONBLOCKING@ || @GNULIB_STDIO_H_SIGPIPE@)
509 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
510 # undef fputc
511 # define fputc rpl_fputc
512 # endif
513 _GL_FUNCDECL_RPL (fputc, int, (int c, FILE *stream) _GL_ARG_NONNULL ((2)));
514 _GL_CXXALIAS_RPL (fputc, int, (int c, FILE *stream));
515 # else
516 _GL_CXXALIAS_SYS (fputc, int, (int c, FILE *stream));
517 # endif
518 # if __GLIBC__ >= 2
519 _GL_CXXALIASWARN (fputc);
520 # endif
521 #endif
522
523 #if @GNULIB_FPUTS@
524 # if @REPLACE_STDIO_WRITE_FUNCS@ && (@GNULIB_STDIO_H_NONBLOCKING@ || @GNULIB_STDIO_H_SIGPIPE@)
525 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
526 # undef fputs
527 # define fputs rpl_fputs
528 # endif
529 _GL_FUNCDECL_RPL (fputs, int,
530 (const char *restrict string, FILE *restrict stream)
531 _GL_ARG_NONNULL ((1, 2)));
532 _GL_CXXALIAS_RPL (fputs, int,
533 (const char *restrict string, FILE *restrict stream));
534 # else
535 _GL_CXXALIAS_SYS (fputs, int,
536 (const char *restrict string, FILE *restrict stream));
537 # endif
538 # if __GLIBC__ >= 2
539 _GL_CXXALIASWARN (fputs);
540 # endif
541 #endif
542
543 #if @GNULIB_FREAD@
544 # if @REPLACE_STDIO_READ_FUNCS@ && @GNULIB_STDIO_H_NONBLOCKING@
545 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
546 # undef fread
547 # define fread rpl_fread
548 # endif
549 _GL_FUNCDECL_RPL (fread, size_t,
550 (void *restrict ptr, size_t s, size_t n,
551 FILE *restrict stream)
552 _GL_ARG_NONNULL ((4)));
553 _GL_CXXALIAS_RPL (fread, size_t,
554 (void *restrict ptr, size_t s, size_t n,
555 FILE *restrict stream));
556 # else
557 _GL_CXXALIAS_SYS (fread, size_t,
558 (void *restrict ptr, size_t s, size_t n,
559 FILE *restrict stream));
560 # endif
561 # if __GLIBC__ >= 2
562 _GL_CXXALIASWARN (fread);
563 # endif
564 #endif
565
566 #if @GNULIB_FREOPEN@
567 # if @REPLACE_FREOPEN@
568 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
569 # undef freopen
570 # define freopen rpl_freopen
571 # endif
572 _GL_FUNCDECL_RPL (freopen, FILE *,
573 (const char *restrict filename, const char *restrict mode,
574 FILE *restrict stream)
575 _GL_ARG_NONNULL ((2, 3)));
576 _GL_CXXALIAS_RPL (freopen, FILE *,
577 (const char *restrict filename, const char *restrict mode,
578 FILE *restrict stream));
579 # else
580 _GL_CXXALIAS_SYS (freopen, FILE *,
581 (const char *restrict filename, const char *restrict mode,
582 FILE *restrict stream));
583 # endif
584 # if __GLIBC__ >= 2
585 _GL_CXXALIASWARN (freopen);
586 # endif
587 #elif defined GNULIB_POSIXCHECK
588 # undef freopen
589
590 _GL_WARN_ON_USE (freopen,
591 "freopen on native Windows platforms is not POSIX compliant - "
592 "use gnulib module freopen for portability");
593 #endif
594
595 #if @GNULIB_FSCANF@
596 # if @REPLACE_STDIO_READ_FUNCS@ && @GNULIB_STDIO_H_NONBLOCKING@
597 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
598 # undef fscanf
599 # define fscanf rpl_fscanf
600 # endif
601 _GL_FUNCDECL_RPL (fscanf, int,
602 (FILE *restrict stream, const char *restrict format, ...)
603 _GL_ATTRIBUTE_FORMAT_SCANF_SYSTEM (2, 3)
604 _GL_ARG_NONNULL ((1, 2)));
605 _GL_CXXALIAS_RPL (fscanf, int,
606 (FILE *restrict stream, const char *restrict format, ...));
607 # else
608 _GL_CXXALIAS_SYS (fscanf, int,
609 (FILE *restrict stream, const char *restrict format, ...));
610 # endif
611 # if __GLIBC__ >= 2
612 _GL_CXXALIASWARN (fscanf);
613 # endif
614 #endif
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648 #if @GNULIB_FSEEK@
649 # if defined GNULIB_POSIXCHECK && !defined _GL_NO_LARGE_FILES
650 # define _GL_FSEEK_WARN
651 # undef fseek
652 # endif
653 # if @REPLACE_FSEEK@
654 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
655 # undef fseek
656 # define fseek rpl_fseek
657 # endif
658 _GL_FUNCDECL_RPL (fseek, int, (FILE *fp, long offset, int whence)
659 _GL_ARG_NONNULL ((1)));
660 _GL_CXXALIAS_RPL (fseek, int, (FILE *fp, long offset, int whence));
661 # else
662 _GL_CXXALIAS_SYS (fseek, int, (FILE *fp, long offset, int whence));
663 # endif
664 # if __GLIBC__ >= 2
665 _GL_CXXALIASWARN (fseek);
666 # endif
667 #endif
668
669 #if @GNULIB_FSEEKO@
670 # if !@GNULIB_FSEEK@ && !defined _GL_NO_LARGE_FILES
671 # define _GL_FSEEK_WARN
672 # undef fseek
673 # endif
674 # if @REPLACE_FSEEKO@
675
676
677 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
678 # undef fseeko
679 # define fseeko rpl_fseeko
680 # endif
681 _GL_FUNCDECL_RPL (fseeko, int, (FILE *fp, off_t offset, int whence)
682 _GL_ARG_NONNULL ((1)));
683 _GL_CXXALIAS_RPL (fseeko, int, (FILE *fp, off_t offset, int whence));
684 # else
685 # if ! @HAVE_DECL_FSEEKO@
686 _GL_FUNCDECL_SYS (fseeko, int, (FILE *fp, off_t offset, int whence)
687 _GL_ARG_NONNULL ((1)));
688 # endif
689 _GL_CXXALIAS_SYS (fseeko, int, (FILE *fp, off_t offset, int whence));
690 # endif
691 _GL_CXXALIASWARN (fseeko);
692 #elif defined GNULIB_POSIXCHECK
693 # define _GL_FSEEK_WARN
694 # undef fseek
695 # undef fseeko
696 # if HAVE_RAW_DECL_FSEEKO
697 _GL_WARN_ON_USE (fseeko, "fseeko is unportable - "
698 "use gnulib module fseeko for portability");
699 # endif
700 #endif
701
702 #ifdef _GL_FSEEK_WARN
703 # undef _GL_FSEEK_WARN
704
705
706 _GL_WARN_ON_USE (fseek, "fseek cannot handle files larger than 4 GB "
707 "on 32-bit platforms - "
708 "use fseeko function for handling of large files");
709 #endif
710
711
712
713
714 #if @GNULIB_FTELL@
715 # if defined GNULIB_POSIXCHECK && !defined _GL_NO_LARGE_FILES
716 # define _GL_FTELL_WARN
717 # undef ftell
718 # endif
719 # if @REPLACE_FTELL@
720 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
721 # undef ftell
722 # define ftell rpl_ftell
723 # endif
724 _GL_FUNCDECL_RPL (ftell, long, (FILE *fp) _GL_ARG_NONNULL ((1)));
725 _GL_CXXALIAS_RPL (ftell, long, (FILE *fp));
726 # else
727 _GL_CXXALIAS_SYS (ftell, long, (FILE *fp));
728 # endif
729 # if __GLIBC__ >= 2
730 _GL_CXXALIASWARN (ftell);
731 # endif
732 #endif
733
734 #if @GNULIB_FTELLO@
735 # if !@GNULIB_FTELL@ && !defined _GL_NO_LARGE_FILES
736 # define _GL_FTELL_WARN
737 # undef ftell
738 # endif
739 # if @REPLACE_FTELLO@
740 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
741 # undef ftello
742 # define ftello rpl_ftello
743 # endif
744 _GL_FUNCDECL_RPL (ftello, off_t, (FILE *fp) _GL_ARG_NONNULL ((1)));
745 _GL_CXXALIAS_RPL (ftello, off_t, (FILE *fp));
746 # else
747 # if ! @HAVE_DECL_FTELLO@
748 _GL_FUNCDECL_SYS (ftello, off_t, (FILE *fp) _GL_ARG_NONNULL ((1)));
749 # endif
750 _GL_CXXALIAS_SYS (ftello, off_t, (FILE *fp));
751 # endif
752 _GL_CXXALIASWARN (ftello);
753 #elif defined GNULIB_POSIXCHECK
754 # define _GL_FTELL_WARN
755 # undef ftell
756 # undef ftello
757 # if HAVE_RAW_DECL_FTELLO
758 _GL_WARN_ON_USE (ftello, "ftello is unportable - "
759 "use gnulib module ftello for portability");
760 # endif
761 #endif
762
763 #ifdef _GL_FTELL_WARN
764 # undef _GL_FTELL_WARN
765
766
767 _GL_WARN_ON_USE (ftell, "ftell cannot handle files larger than 4 GB "
768 "on 32-bit platforms - "
769 "use ftello function for handling of large files");
770 #endif
771
772
773 #if @GNULIB_FWRITE@
774 # if @REPLACE_STDIO_WRITE_FUNCS@ && (@GNULIB_STDIO_H_NONBLOCKING@ || @GNULIB_STDIO_H_SIGPIPE@)
775 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
776 # undef fwrite
777 # define fwrite rpl_fwrite
778 # endif
779 _GL_FUNCDECL_RPL (fwrite, size_t,
780 (const void *restrict ptr, size_t s, size_t n,
781 FILE *restrict stream)
782 _GL_ARG_NONNULL ((1, 4)));
783 _GL_CXXALIAS_RPL (fwrite, size_t,
784 (const void *restrict ptr, size_t s, size_t n,
785 FILE *restrict stream));
786 # else
787 _GL_CXXALIAS_SYS (fwrite, size_t,
788 (const void *restrict ptr, size_t s, size_t n,
789 FILE *restrict stream));
790
791
792
793
794
795
796 # if (0 < __USE_FORTIFY_LEVEL \
797 && __GLIBC__ == 2 && 4 <= __GLIBC_MINOR__ && __GLIBC_MINOR__ <= 15 \
798 && 3 < __GNUC__ + (4 <= __GNUC_MINOR__) \
799 && !defined __cplusplus)
800 # undef fwrite
801 # undef fwrite_unlocked
802 extern size_t __REDIRECT (rpl_fwrite,
803 (const void *__restrict, size_t, size_t,
804 FILE *__restrict),
805 fwrite);
806 extern size_t __REDIRECT (rpl_fwrite_unlocked,
807 (const void *__restrict, size_t, size_t,
808 FILE *__restrict),
809 fwrite_unlocked);
810 # define fwrite rpl_fwrite
811 # define fwrite_unlocked rpl_fwrite_unlocked
812 # endif
813 # endif
814 # if __GLIBC__ >= 2
815 _GL_CXXALIASWARN (fwrite);
816 # endif
817 #endif
818
819 #if @GNULIB_GETC@
820 # if @REPLACE_STDIO_READ_FUNCS@ && @GNULIB_STDIO_H_NONBLOCKING@
821 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
822 # undef getc
823 # define getc rpl_fgetc
824 # endif
825 _GL_FUNCDECL_RPL (fgetc, int, (FILE *stream) _GL_ARG_NONNULL ((1)));
826 _GL_CXXALIAS_RPL_1 (getc, rpl_fgetc, int, (FILE *stream));
827 # else
828 _GL_CXXALIAS_SYS (getc, int, (FILE *stream));
829 # endif
830 # if __GLIBC__ >= 2
831 _GL_CXXALIASWARN (getc);
832 # endif
833 #endif
834
835 #if @GNULIB_GETCHAR@
836 # if @REPLACE_STDIO_READ_FUNCS@ && @GNULIB_STDIO_H_NONBLOCKING@
837 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
838 # undef getchar
839 # define getchar rpl_getchar
840 # endif
841 _GL_FUNCDECL_RPL (getchar, int, (void));
842 _GL_CXXALIAS_RPL (getchar, int, (void));
843 # else
844 _GL_CXXALIAS_SYS (getchar, int, (void));
845 # endif
846 # if __GLIBC__ >= 2
847 _GL_CXXALIASWARN (getchar);
848 # endif
849 #endif
850
851 #if @GNULIB_GETDELIM@
852
853
854
855
856
857
858 # if @REPLACE_GETDELIM@
859 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
860 # undef getdelim
861 # define getdelim rpl_getdelim
862 # endif
863 _GL_FUNCDECL_RPL (getdelim, ssize_t,
864 (char **restrict lineptr, size_t *restrict linesize,
865 int delimiter,
866 FILE *restrict stream)
867 _GL_ARG_NONNULL ((1, 2, 4)));
868 _GL_CXXALIAS_RPL (getdelim, ssize_t,
869 (char **restrict lineptr, size_t *restrict linesize,
870 int delimiter,
871 FILE *restrict stream));
872 # else
873 # if !@HAVE_DECL_GETDELIM@
874 _GL_FUNCDECL_SYS (getdelim, ssize_t,
875 (char **restrict lineptr, size_t *restrict linesize,
876 int delimiter,
877 FILE *restrict stream)
878 _GL_ARG_NONNULL ((1, 2, 4)));
879 # endif
880 _GL_CXXALIAS_SYS (getdelim, ssize_t,
881 (char **restrict lineptr, size_t *restrict linesize,
882 int delimiter,
883 FILE *restrict stream));
884 # endif
885 _GL_CXXALIASWARN (getdelim);
886 #elif defined GNULIB_POSIXCHECK
887 # undef getdelim
888 # if HAVE_RAW_DECL_GETDELIM
889 _GL_WARN_ON_USE (getdelim, "getdelim is unportable - "
890 "use gnulib module getdelim for portability");
891 # endif
892 #endif
893
894 #if @GNULIB_GETLINE@
895
896
897
898
899
900
901 # if @REPLACE_GETLINE@
902 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
903 # undef getline
904 # define getline rpl_getline
905 # endif
906 _GL_FUNCDECL_RPL (getline, ssize_t,
907 (char **restrict lineptr, size_t *restrict linesize,
908 FILE *restrict stream)
909 _GL_ARG_NONNULL ((1, 2, 3)));
910 _GL_CXXALIAS_RPL (getline, ssize_t,
911 (char **restrict lineptr, size_t *restrict linesize,
912 FILE *restrict stream));
913 # else
914 # if !@HAVE_DECL_GETLINE@
915 _GL_FUNCDECL_SYS (getline, ssize_t,
916 (char **restrict lineptr, size_t *restrict linesize,
917 FILE *restrict stream)
918 _GL_ARG_NONNULL ((1, 2, 3)));
919 # endif
920 _GL_CXXALIAS_SYS (getline, ssize_t,
921 (char **restrict lineptr, size_t *restrict linesize,
922 FILE *restrict stream));
923 # endif
924 # if @HAVE_DECL_GETLINE@
925 _GL_CXXALIASWARN (getline);
926 # endif
927 #elif defined GNULIB_POSIXCHECK
928 # undef getline
929 # if HAVE_RAW_DECL_GETLINE
930 _GL_WARN_ON_USE (getline, "getline is unportable - "
931 "use gnulib module getline for portability");
932 # endif
933 #endif
934
935
936
937
938 #undef gets
939 #if HAVE_RAW_DECL_GETS && !defined __cplusplus
940 _GL_WARN_ON_USE (gets, "gets is a security hole - use fgets instead");
941 #endif
942
943 #if @GNULIB_MDA_GETW@
944
945
946
947 # if defined _WIN32 && !defined __CYGWIN__
948 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
949 # undef getw
950 # define getw _getw
951 # endif
952 _GL_CXXALIAS_MDA (getw, int, (FILE *restrict stream));
953 # else
954 _GL_CXXALIAS_SYS (getw, int, (FILE *restrict stream));
955 # endif
956 _GL_CXXALIASWARN (getw);
957 #endif
958
959 #if @GNULIB_OBSTACK_PRINTF@ || @GNULIB_OBSTACK_PRINTF_POSIX@
960 struct obstack;
961
962
963
964
965
966 # if @REPLACE_OBSTACK_PRINTF@
967 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
968 # define obstack_printf rpl_obstack_printf
969 # endif
970 _GL_FUNCDECL_RPL (obstack_printf, int,
971 (struct obstack *obs, const char *format, ...)
972 _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 3)
973 _GL_ARG_NONNULL ((1, 2)));
974 _GL_CXXALIAS_RPL (obstack_printf, int,
975 (struct obstack *obs, const char *format, ...));
976 # else
977 # if !@HAVE_DECL_OBSTACK_PRINTF@
978 _GL_FUNCDECL_SYS (obstack_printf, int,
979 (struct obstack *obs, const char *format, ...)
980 _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 3)
981 _GL_ARG_NONNULL ((1, 2)));
982 # endif
983 _GL_CXXALIAS_SYS (obstack_printf, int,
984 (struct obstack *obs, const char *format, ...));
985 # endif
986 _GL_CXXALIASWARN (obstack_printf);
987 # if @REPLACE_OBSTACK_PRINTF@
988 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
989 # define obstack_vprintf rpl_obstack_vprintf
990 # endif
991 _GL_FUNCDECL_RPL (obstack_vprintf, int,
992 (struct obstack *obs, const char *format, va_list args)
993 _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 0)
994 _GL_ARG_NONNULL ((1, 2)));
995 _GL_CXXALIAS_RPL (obstack_vprintf, int,
996 (struct obstack *obs, const char *format, va_list args));
997 # else
998 # if !@HAVE_DECL_OBSTACK_PRINTF@
999 _GL_FUNCDECL_SYS (obstack_vprintf, int,
1000 (struct obstack *obs, const char *format, va_list args)
1001 _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 0)
1002 _GL_ARG_NONNULL ((1, 2)));
1003 # endif
1004 _GL_CXXALIAS_SYS (obstack_vprintf, int,
1005 (struct obstack *obs, const char *format, va_list args));
1006 # endif
1007 _GL_CXXALIASWARN (obstack_vprintf);
1008 #endif
1009
1010 #if @GNULIB_PCLOSE@
1011 # if !@HAVE_PCLOSE@
1012 _GL_FUNCDECL_SYS (pclose, int, (FILE *stream) _GL_ARG_NONNULL ((1)));
1013 # endif
1014 _GL_CXXALIAS_SYS (pclose, int, (FILE *stream));
1015 _GL_CXXALIASWARN (pclose);
1016 #elif defined GNULIB_POSIXCHECK
1017 # undef pclose
1018 # if HAVE_RAW_DECL_PCLOSE
1019 _GL_WARN_ON_USE (pclose, "pclose is unportable - "
1020 "use gnulib module pclose for more portability");
1021 # endif
1022 #endif
1023
1024 #if @GNULIB_PERROR@
1025
1026
1027
1028 # if @REPLACE_PERROR@
1029 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1030 # define perror rpl_perror
1031 # endif
1032 _GL_FUNCDECL_RPL (perror, void, (const char *string));
1033 _GL_CXXALIAS_RPL (perror, void, (const char *string));
1034 # else
1035 _GL_CXXALIAS_SYS (perror, void, (const char *string));
1036 # endif
1037 # if __GLIBC__ >= 2
1038 _GL_CXXALIASWARN (perror);
1039 # endif
1040 #elif defined GNULIB_POSIXCHECK
1041 # undef perror
1042
1043 _GL_WARN_ON_USE (perror, "perror is not always POSIX compliant - "
1044 "use gnulib module perror for portability");
1045 #endif
1046
1047 #if @GNULIB_POPEN@
1048 # if @REPLACE_POPEN@
1049 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1050 # undef popen
1051 # define popen rpl_popen
1052 # endif
1053 _GL_FUNCDECL_RPL (popen, FILE *,
1054 (const char *cmd, const char *mode)
1055 _GL_ARG_NONNULL ((1, 2)) _GL_ATTRIBUTE_DEALLOC (pclose, 1));
1056 _GL_CXXALIAS_RPL (popen, FILE *, (const char *cmd, const char *mode));
1057 # else
1058 # if !@HAVE_POPEN@ || __GNUC__ >= 11
1059 _GL_FUNCDECL_SYS (popen, FILE *,
1060 (const char *cmd, const char *mode)
1061 _GL_ARG_NONNULL ((1, 2)) _GL_ATTRIBUTE_DEALLOC (pclose, 1));
1062 # endif
1063 _GL_CXXALIAS_SYS (popen, FILE *, (const char *cmd, const char *mode));
1064 # endif
1065 _GL_CXXALIASWARN (popen);
1066 #else
1067 # if @GNULIB_PCLOSE@ && __GNUC__ >= 11 && !defined popen
1068
1069 _GL_FUNCDECL_SYS (popen, FILE *,
1070 (const char *cmd, const char *mode)
1071 _GL_ARG_NONNULL ((1, 2)) _GL_ATTRIBUTE_DEALLOC (pclose, 1));
1072 # endif
1073 # if defined GNULIB_POSIXCHECK
1074 # undef popen
1075 # if HAVE_RAW_DECL_POPEN
1076 _GL_WARN_ON_USE (popen, "popen is buggy on some platforms - "
1077 "use gnulib module popen or pipe for more portability");
1078 # endif
1079 # endif
1080 #endif
1081
1082 #if @GNULIB_PRINTF_POSIX@ || @GNULIB_PRINTF@
1083 # if (@GNULIB_PRINTF_POSIX@ && @REPLACE_PRINTF@) \
1084 || (@GNULIB_PRINTF@ && @REPLACE_STDIO_WRITE_FUNCS@ && (@GNULIB_STDIO_H_NONBLOCKING@ || @GNULIB_STDIO_H_SIGPIPE@))
1085 # if defined __GNUC__ || defined __clang__
1086 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1087
1088 # define printf __printf__
1089 # endif
1090 # if @GNULIB_PRINTF_POSIX@ || @GNULIB_VFPRINTF_POSIX@
1091 _GL_FUNCDECL_RPL_1 (__printf__, int,
1092 (const char *restrict format, ...)
1093 __asm__ (@ASM_SYMBOL_PREFIX@
1094 _GL_STDIO_MACROEXPAND_AND_STRINGIZE(rpl_printf))
1095 _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (1, 2)
1096 _GL_ARG_NONNULL ((1)));
1097 # else
1098 _GL_FUNCDECL_RPL_1 (__printf__, int,
1099 (const char *restrict format, ...)
1100 __asm__ (@ASM_SYMBOL_PREFIX@
1101 _GL_STDIO_MACROEXPAND_AND_STRINGIZE(rpl_printf))
1102 _GL_ATTRIBUTE_FORMAT_PRINTF_SYSTEM (1, 2)
1103 _GL_ARG_NONNULL ((1)));
1104 # endif
1105 _GL_CXXALIAS_RPL_1 (printf, __printf__, int, (const char *format, ...));
1106 # else
1107 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1108 # define printf rpl_printf
1109 # endif
1110 _GL_FUNCDECL_RPL (printf, int,
1111 (const char *restrict format, ...)
1112 _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (1, 2)
1113 _GL_ARG_NONNULL ((1)));
1114 _GL_CXXALIAS_RPL (printf, int, (const char *restrict format, ...));
1115 # endif
1116 # define GNULIB_overrides_printf 1
1117 # else
1118 _GL_CXXALIAS_SYS (printf, int, (const char *restrict format, ...));
1119 # endif
1120 # if __GLIBC__ >= 2
1121 _GL_CXXALIASWARN (printf);
1122 # endif
1123 #endif
1124 #if !@GNULIB_PRINTF_POSIX@ && defined GNULIB_POSIXCHECK
1125 # if !GNULIB_overrides_printf
1126 # undef printf
1127 # endif
1128
1129 _GL_WARN_ON_USE (printf, "printf is not always POSIX compliant - "
1130 "use gnulib module printf-posix for portable "
1131 "POSIX compliance");
1132 #endif
1133
1134 #if @GNULIB_PUTC@
1135 # if @REPLACE_STDIO_WRITE_FUNCS@ && (@GNULIB_STDIO_H_NONBLOCKING@ || @GNULIB_STDIO_H_SIGPIPE@)
1136 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1137 # undef putc
1138 # define putc rpl_fputc
1139 # endif
1140 _GL_FUNCDECL_RPL (fputc, int, (int c, FILE *stream) _GL_ARG_NONNULL ((2)));
1141 _GL_CXXALIAS_RPL_1 (putc, rpl_fputc, int, (int c, FILE *stream));
1142 # else
1143 _GL_CXXALIAS_SYS (putc, int, (int c, FILE *stream));
1144 # endif
1145 # if __GLIBC__ >= 2
1146 _GL_CXXALIASWARN (putc);
1147 # endif
1148 #endif
1149
1150 #if @GNULIB_PUTCHAR@
1151 # if @REPLACE_STDIO_WRITE_FUNCS@ && (@GNULIB_STDIO_H_NONBLOCKING@ || @GNULIB_STDIO_H_SIGPIPE@)
1152 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1153 # undef putchar
1154 # define putchar rpl_putchar
1155 # endif
1156 _GL_FUNCDECL_RPL (putchar, int, (int c));
1157 _GL_CXXALIAS_RPL (putchar, int, (int c));
1158 # else
1159 _GL_CXXALIAS_SYS (putchar, int, (int c));
1160 # endif
1161 # if __GLIBC__ >= 2
1162 _GL_CXXALIASWARN (putchar);
1163 # endif
1164 #endif
1165
1166 #if @GNULIB_PUTS@
1167 # if @REPLACE_STDIO_WRITE_FUNCS@ && (@GNULIB_STDIO_H_NONBLOCKING@ || @GNULIB_STDIO_H_SIGPIPE@)
1168 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1169 # undef puts
1170 # define puts rpl_puts
1171 # endif
1172 _GL_FUNCDECL_RPL (puts, int, (const char *string) _GL_ARG_NONNULL ((1)));
1173 _GL_CXXALIAS_RPL (puts, int, (const char *string));
1174 # else
1175 _GL_CXXALIAS_SYS (puts, int, (const char *string));
1176 # endif
1177 # if __GLIBC__ >= 2
1178 _GL_CXXALIASWARN (puts);
1179 # endif
1180 #endif
1181
1182 #if @GNULIB_MDA_PUTW@
1183
1184
1185
1186 # if defined _WIN32 && !defined __CYGWIN__
1187 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1188 # undef putw
1189 # define putw _putw
1190 # endif
1191 _GL_CXXALIAS_MDA (putw, int, (int w, FILE *restrict stream));
1192 # else
1193 _GL_CXXALIAS_SYS (putw, int, (int w, FILE *restrict stream));
1194 # endif
1195 _GL_CXXALIASWARN (putw);
1196 #endif
1197
1198 #if @GNULIB_REMOVE@
1199 # if @REPLACE_REMOVE@
1200 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1201 # undef remove
1202 # define remove rpl_remove
1203 # endif
1204 _GL_FUNCDECL_RPL (remove, int, (const char *name) _GL_ARG_NONNULL ((1)));
1205 _GL_CXXALIAS_RPL (remove, int, (const char *name));
1206 # else
1207 _GL_CXXALIAS_SYS (remove, int, (const char *name));
1208 # endif
1209 # if __GLIBC__ >= 2
1210 _GL_CXXALIASWARN (remove);
1211 # endif
1212 #elif defined GNULIB_POSIXCHECK
1213 # undef remove
1214
1215 _GL_WARN_ON_USE (remove, "remove cannot handle directories on some platforms - "
1216 "use gnulib module remove for more portability");
1217 #endif
1218
1219 #if @GNULIB_RENAME@
1220 # if @REPLACE_RENAME@
1221 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1222 # undef rename
1223 # define rename rpl_rename
1224 # endif
1225 _GL_FUNCDECL_RPL (rename, int,
1226 (const char *old_filename, const char *new_filename)
1227 _GL_ARG_NONNULL ((1, 2)));
1228 _GL_CXXALIAS_RPL (rename, int,
1229 (const char *old_filename, const char *new_filename));
1230 # else
1231 _GL_CXXALIAS_SYS (rename, int,
1232 (const char *old_filename, const char *new_filename));
1233 # endif
1234 # if __GLIBC__ >= 2
1235 _GL_CXXALIASWARN (rename);
1236 # endif
1237 #elif defined GNULIB_POSIXCHECK
1238 # undef rename
1239
1240 _GL_WARN_ON_USE (rename, "rename is buggy on some platforms - "
1241 "use gnulib module rename for more portability");
1242 #endif
1243
1244 #if @GNULIB_RENAMEAT@
1245 # if @REPLACE_RENAMEAT@
1246 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1247 # undef renameat
1248 # define renameat rpl_renameat
1249 # endif
1250 _GL_FUNCDECL_RPL (renameat, int,
1251 (int fd1, char const *file1, int fd2, char const *file2)
1252 _GL_ARG_NONNULL ((2, 4)));
1253 _GL_CXXALIAS_RPL (renameat, int,
1254 (int fd1, char const *file1, int fd2, char const *file2));
1255 # else
1256 # if !@HAVE_RENAMEAT@
1257 _GL_FUNCDECL_SYS (renameat, int,
1258 (int fd1, char const *file1, int fd2, char const *file2)
1259 _GL_ARG_NONNULL ((2, 4)));
1260 # endif
1261 _GL_CXXALIAS_SYS (renameat, int,
1262 (int fd1, char const *file1, int fd2, char const *file2));
1263 # endif
1264 _GL_CXXALIASWARN (renameat);
1265 #elif defined GNULIB_POSIXCHECK
1266 # undef renameat
1267 # if HAVE_RAW_DECL_RENAMEAT
1268 _GL_WARN_ON_USE (renameat, "renameat is not portable - "
1269 "use gnulib module renameat for portability");
1270 # endif
1271 #endif
1272
1273 #if @GNULIB_SCANF@
1274 # if @REPLACE_STDIO_READ_FUNCS@ && @GNULIB_STDIO_H_NONBLOCKING@
1275 # if defined __GNUC__ || defined __clang__
1276 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1277 # undef scanf
1278
1279 # define scanf __scanf__
1280 # endif
1281 _GL_FUNCDECL_RPL_1 (__scanf__, int,
1282 (const char *restrict format, ...)
1283 __asm__ (@ASM_SYMBOL_PREFIX@
1284 _GL_STDIO_MACROEXPAND_AND_STRINGIZE(rpl_scanf))
1285 _GL_ATTRIBUTE_FORMAT_SCANF_SYSTEM (1, 2)
1286 _GL_ARG_NONNULL ((1)));
1287 _GL_CXXALIAS_RPL_1 (scanf, __scanf__, int, (const char *restrict format, ...));
1288 # else
1289 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1290 # undef scanf
1291 # define scanf rpl_scanf
1292 # endif
1293 _GL_FUNCDECL_RPL (scanf, int, (const char *restrict format, ...)
1294 _GL_ATTRIBUTE_FORMAT_SCANF_SYSTEM (1, 2)
1295 _GL_ARG_NONNULL ((1)));
1296 _GL_CXXALIAS_RPL (scanf, int, (const char *restrict format, ...));
1297 # endif
1298 # else
1299 _GL_CXXALIAS_SYS (scanf, int, (const char *restrict format, ...));
1300 # endif
1301 # if __GLIBC__ >= 2
1302 _GL_CXXALIASWARN (scanf);
1303 # endif
1304 #endif
1305
1306 #if @GNULIB_SNPRINTF@
1307 # if @REPLACE_SNPRINTF@
1308 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1309 # define snprintf rpl_snprintf
1310 # endif
1311 # define GNULIB_overrides_snprintf 1
1312 _GL_FUNCDECL_RPL (snprintf, int,
1313 (char *restrict str, size_t size,
1314 const char *restrict format, ...)
1315 _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (3, 4)
1316 _GL_ARG_NONNULL ((3)));
1317 _GL_CXXALIAS_RPL (snprintf, int,
1318 (char *restrict str, size_t size,
1319 const char *restrict format, ...));
1320 # else
1321 # if !@HAVE_DECL_SNPRINTF@
1322 _GL_FUNCDECL_SYS (snprintf, int,
1323 (char *restrict str, size_t size,
1324 const char *restrict format, ...)
1325 _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (3, 4)
1326 _GL_ARG_NONNULL ((3)));
1327 # endif
1328 _GL_CXXALIAS_SYS (snprintf, int,
1329 (char *restrict str, size_t size,
1330 const char *restrict format, ...));
1331 # endif
1332 # if __GLIBC__ >= 2
1333 _GL_CXXALIASWARN (snprintf);
1334 # endif
1335 #elif defined GNULIB_POSIXCHECK
1336 # undef snprintf
1337 # if HAVE_RAW_DECL_SNPRINTF
1338 _GL_WARN_ON_USE (snprintf, "snprintf is unportable - "
1339 "use gnulib module snprintf for portability");
1340 # endif
1341 #endif
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352 #if @GNULIB_SPRINTF_POSIX@
1353 # if @REPLACE_SPRINTF@
1354 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1355 # define sprintf rpl_sprintf
1356 # endif
1357 # define GNULIB_overrides_sprintf 1
1358 _GL_FUNCDECL_RPL (sprintf, int,
1359 (char *restrict str, const char *restrict format, ...)
1360 _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 3)
1361 _GL_ARG_NONNULL ((1, 2)));
1362 _GL_CXXALIAS_RPL (sprintf, int,
1363 (char *restrict str, const char *restrict format, ...));
1364 # else
1365 _GL_CXXALIAS_SYS (sprintf, int,
1366 (char *restrict str, const char *restrict format, ...));
1367 # endif
1368 # if __GLIBC__ >= 2
1369 _GL_CXXALIASWARN (sprintf);
1370 # endif
1371 #elif defined GNULIB_POSIXCHECK
1372 # undef sprintf
1373
1374 _GL_WARN_ON_USE (sprintf, "sprintf is not always POSIX compliant - "
1375 "use gnulib module sprintf-posix for portable "
1376 "POSIX compliance");
1377 #endif
1378
1379 #if @GNULIB_MDA_TEMPNAM@
1380
1381
1382
1383 # if defined _WIN32 && !defined __CYGWIN__
1384 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1385 # undef tempnam
1386 # define tempnam _tempnam
1387 # endif
1388 _GL_CXXALIAS_MDA (tempnam, char *, (const char *dir, const char *prefix));
1389 # else
1390 _GL_CXXALIAS_SYS (tempnam, char *, (const char *dir, const char *prefix));
1391 # endif
1392 _GL_CXXALIASWARN (tempnam);
1393 #endif
1394
1395 #if @GNULIB_TMPFILE@
1396 # if @REPLACE_TMPFILE@
1397 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1398 # define tmpfile rpl_tmpfile
1399 # endif
1400 _GL_FUNCDECL_RPL (tmpfile, FILE *, (void)
1401 _GL_ATTRIBUTE_DEALLOC (fclose, 1));
1402 _GL_CXXALIAS_RPL (tmpfile, FILE *, (void));
1403 # else
1404 # if __GNUC__ >= 11
1405
1406 _GL_FUNCDECL_SYS (tmpfile, FILE *, (void)
1407 _GL_ATTRIBUTE_DEALLOC (fclose, 1));
1408 # endif
1409 _GL_CXXALIAS_SYS (tmpfile, FILE *, (void));
1410 # endif
1411 # if __GLIBC__ >= 2
1412 _GL_CXXALIASWARN (tmpfile);
1413 # endif
1414 #else
1415 # if @GNULIB_FCLOSE@ && __GNUC__ >= 11 && !defined tmpfile
1416
1417 _GL_FUNCDECL_SYS (tmpfile, FILE *, (void)
1418 _GL_ATTRIBUTE_DEALLOC (fclose, 1));
1419 # endif
1420 # if defined GNULIB_POSIXCHECK
1421 # undef tmpfile
1422 # if HAVE_RAW_DECL_TMPFILE
1423 _GL_WARN_ON_USE (tmpfile, "tmpfile is not usable on mingw - "
1424 "use gnulib module tmpfile for portability");
1425 # endif
1426 # endif
1427 #endif
1428
1429 #if @GNULIB_VASPRINTF@
1430
1431
1432
1433
1434 # if @REPLACE_VASPRINTF@
1435 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1436 # define asprintf rpl_asprintf
1437 # endif
1438 # define GNULIB_overrides_asprintf
1439 _GL_FUNCDECL_RPL (asprintf, int,
1440 (char **result, const char *format, ...)
1441 _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 3)
1442 _GL_ARG_NONNULL ((1, 2)));
1443 _GL_CXXALIAS_RPL (asprintf, int,
1444 (char **result, const char *format, ...));
1445 # else
1446 # if !@HAVE_VASPRINTF@
1447 _GL_FUNCDECL_SYS (asprintf, int,
1448 (char **result, const char *format, ...)
1449 _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 3)
1450 _GL_ARG_NONNULL ((1, 2)));
1451 # endif
1452 _GL_CXXALIAS_SYS (asprintf, int,
1453 (char **result, const char *format, ...));
1454 # endif
1455 _GL_CXXALIASWARN (asprintf);
1456 # if @REPLACE_VASPRINTF@
1457 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1458 # define vasprintf rpl_vasprintf
1459 # endif
1460 # define GNULIB_overrides_vasprintf 1
1461 _GL_FUNCDECL_RPL (vasprintf, int,
1462 (char **result, const char *format, va_list args)
1463 _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 0)
1464 _GL_ARG_NONNULL ((1, 2)));
1465 _GL_CXXALIAS_RPL (vasprintf, int,
1466 (char **result, const char *format, va_list args));
1467 # else
1468 # if !@HAVE_VASPRINTF@
1469 _GL_FUNCDECL_SYS (vasprintf, int,
1470 (char **result, const char *format, va_list args)
1471 _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 0)
1472 _GL_ARG_NONNULL ((1, 2)));
1473 # endif
1474 _GL_CXXALIAS_SYS (vasprintf, int,
1475 (char **result, const char *format, va_list args));
1476 # endif
1477 _GL_CXXALIASWARN (vasprintf);
1478 #endif
1479
1480 #if @GNULIB_VDPRINTF@
1481 # if @REPLACE_VDPRINTF@
1482 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1483 # define vdprintf rpl_vdprintf
1484 # endif
1485 _GL_FUNCDECL_RPL (vdprintf, int,
1486 (int fd, const char *restrict format, va_list args)
1487 _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 0)
1488 _GL_ARG_NONNULL ((2)));
1489 _GL_CXXALIAS_RPL (vdprintf, int,
1490 (int fd, const char *restrict format, va_list args));
1491 # else
1492 # if !@HAVE_VDPRINTF@
1493 _GL_FUNCDECL_SYS (vdprintf, int,
1494 (int fd, const char *restrict format, va_list args)
1495 _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 0)
1496 _GL_ARG_NONNULL ((2)));
1497 # endif
1498
1499
1500 _GL_CXXALIAS_SYS_CAST (vdprintf, int,
1501 (int fd, const char *restrict format, va_list args));
1502 # endif
1503 # if __GLIBC__ >= 2
1504 _GL_CXXALIASWARN (vdprintf);
1505 # endif
1506 #elif defined GNULIB_POSIXCHECK
1507 # undef vdprintf
1508 # if HAVE_RAW_DECL_VDPRINTF
1509 _GL_WARN_ON_USE (vdprintf, "vdprintf is unportable - "
1510 "use gnulib module vdprintf for portability");
1511 # endif
1512 #endif
1513
1514 #if @GNULIB_VFPRINTF_POSIX@ || @GNULIB_VFPRINTF@
1515 # if (@GNULIB_VFPRINTF_POSIX@ && @REPLACE_VFPRINTF@) \
1516 || (@GNULIB_VFPRINTF@ && @REPLACE_STDIO_WRITE_FUNCS@ && (@GNULIB_STDIO_H_NONBLOCKING@ || @GNULIB_STDIO_H_SIGPIPE@))
1517 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1518 # define vfprintf rpl_vfprintf
1519 # endif
1520 # define GNULIB_overrides_vfprintf 1
1521 # if @GNULIB_VFPRINTF_POSIX@
1522 _GL_FUNCDECL_RPL (vfprintf, int,
1523 (FILE *restrict fp,
1524 const char *restrict format, va_list args)
1525 _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 0)
1526 _GL_ARG_NONNULL ((1, 2)));
1527 # else
1528 _GL_FUNCDECL_RPL (vfprintf, int,
1529 (FILE *restrict fp,
1530 const char *restrict format, va_list args)
1531 _GL_ATTRIBUTE_FORMAT_PRINTF_SYSTEM (2, 0)
1532 _GL_ARG_NONNULL ((1, 2)));
1533 # endif
1534 _GL_CXXALIAS_RPL (vfprintf, int,
1535 (FILE *restrict fp,
1536 const char *restrict format, va_list args));
1537 # else
1538
1539
1540
1541 _GL_CXXALIAS_SYS_CAST (vfprintf, int,
1542 (FILE *restrict fp,
1543 const char *restrict format, va_list args));
1544 # endif
1545 # if __GLIBC__ >= 2
1546 _GL_CXXALIASWARN (vfprintf);
1547 # endif
1548 #endif
1549 #if !@GNULIB_VFPRINTF_POSIX@ && defined GNULIB_POSIXCHECK
1550 # if !GNULIB_overrides_vfprintf
1551 # undef vfprintf
1552 # endif
1553
1554 _GL_WARN_ON_USE (vfprintf, "vfprintf is not always POSIX compliant - "
1555 "use gnulib module vfprintf-posix for portable "
1556 "POSIX compliance");
1557 #endif
1558
1559 #if @GNULIB_VFSCANF@
1560 # if @REPLACE_STDIO_READ_FUNCS@ && @GNULIB_STDIO_H_NONBLOCKING@
1561 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1562 # undef vfscanf
1563 # define vfscanf rpl_vfscanf
1564 # endif
1565 _GL_FUNCDECL_RPL (vfscanf, int,
1566 (FILE *restrict stream,
1567 const char *restrict format, va_list args)
1568 _GL_ATTRIBUTE_FORMAT_SCANF_SYSTEM (2, 0)
1569 _GL_ARG_NONNULL ((1, 2)));
1570 _GL_CXXALIAS_RPL (vfscanf, int,
1571 (FILE *restrict stream,
1572 const char *restrict format, va_list args));
1573 # else
1574 _GL_CXXALIAS_SYS (vfscanf, int,
1575 (FILE *restrict stream,
1576 const char *restrict format, va_list args));
1577 # endif
1578 # if __GLIBC__ >= 2
1579 _GL_CXXALIASWARN (vfscanf);
1580 # endif
1581 #endif
1582
1583 #if @GNULIB_VPRINTF_POSIX@ || @GNULIB_VPRINTF@
1584 # if (@GNULIB_VPRINTF_POSIX@ && @REPLACE_VPRINTF@) \
1585 || (@GNULIB_VPRINTF@ && @REPLACE_STDIO_WRITE_FUNCS@ && (@GNULIB_STDIO_H_NONBLOCKING@ || @GNULIB_STDIO_H_SIGPIPE@))
1586 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1587 # define vprintf rpl_vprintf
1588 # endif
1589 # define GNULIB_overrides_vprintf 1
1590 # if @GNULIB_VPRINTF_POSIX@ || @GNULIB_VFPRINTF_POSIX@
1591 _GL_FUNCDECL_RPL (vprintf, int, (const char *restrict format, va_list args)
1592 _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (1, 0)
1593 _GL_ARG_NONNULL ((1)));
1594 # else
1595 _GL_FUNCDECL_RPL (vprintf, int, (const char *restrict format, va_list args)
1596 _GL_ATTRIBUTE_FORMAT_PRINTF_SYSTEM (1, 0)
1597 _GL_ARG_NONNULL ((1)));
1598 # endif
1599 _GL_CXXALIAS_RPL (vprintf, int, (const char *restrict format, va_list args));
1600 # else
1601
1602
1603
1604 _GL_CXXALIAS_SYS_CAST (vprintf, int,
1605 (const char *restrict format, va_list args));
1606 # endif
1607 # if __GLIBC__ >= 2
1608 _GL_CXXALIASWARN (vprintf);
1609 # endif
1610 #endif
1611 #if !@GNULIB_VPRINTF_POSIX@ && defined GNULIB_POSIXCHECK
1612 # if !GNULIB_overrides_vprintf
1613 # undef vprintf
1614 # endif
1615
1616 _GL_WARN_ON_USE (vprintf, "vprintf is not always POSIX compliant - "
1617 "use gnulib module vprintf-posix for portable "
1618 "POSIX compliance");
1619 #endif
1620
1621 #if @GNULIB_VSCANF@
1622 # if @REPLACE_STDIO_READ_FUNCS@ && @GNULIB_STDIO_H_NONBLOCKING@
1623 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1624 # undef vscanf
1625 # define vscanf rpl_vscanf
1626 # endif
1627 _GL_FUNCDECL_RPL (vscanf, int, (const char *restrict format, va_list args)
1628 _GL_ATTRIBUTE_FORMAT_SCANF_SYSTEM (1, 0)
1629 _GL_ARG_NONNULL ((1)));
1630 _GL_CXXALIAS_RPL (vscanf, int, (const char *restrict format, va_list args));
1631 # else
1632 _GL_CXXALIAS_SYS (vscanf, int, (const char *restrict format, va_list args));
1633 # endif
1634 # if __GLIBC__ >= 2
1635 _GL_CXXALIASWARN (vscanf);
1636 # endif
1637 #endif
1638
1639 #if @GNULIB_VSNPRINTF@
1640 # if @REPLACE_VSNPRINTF@
1641 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1642 # define vsnprintf rpl_vsnprintf
1643 # endif
1644 # define GNULIB_overrides_vsnprintf 1
1645 _GL_FUNCDECL_RPL (vsnprintf, int,
1646 (char *restrict str, size_t size,
1647 const char *restrict format, va_list args)
1648 _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (3, 0)
1649 _GL_ARG_NONNULL ((3)));
1650 _GL_CXXALIAS_RPL (vsnprintf, int,
1651 (char *restrict str, size_t size,
1652 const char *restrict format, va_list args));
1653 # else
1654 # if !@HAVE_DECL_VSNPRINTF@
1655 _GL_FUNCDECL_SYS (vsnprintf, int,
1656 (char *restrict str, size_t size,
1657 const char *restrict format, va_list args)
1658 _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (3, 0)
1659 _GL_ARG_NONNULL ((3)));
1660 # endif
1661 _GL_CXXALIAS_SYS (vsnprintf, int,
1662 (char *restrict str, size_t size,
1663 const char *restrict format, va_list args));
1664 # endif
1665 # if __GLIBC__ >= 2
1666 _GL_CXXALIASWARN (vsnprintf);
1667 # endif
1668 #elif defined GNULIB_POSIXCHECK
1669 # undef vsnprintf
1670 # if HAVE_RAW_DECL_VSNPRINTF
1671 _GL_WARN_ON_USE (vsnprintf, "vsnprintf is unportable - "
1672 "use gnulib module vsnprintf for portability");
1673 # endif
1674 #endif
1675
1676 #if @GNULIB_VSPRINTF_POSIX@
1677 # if @REPLACE_VSPRINTF@
1678 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1679 # define vsprintf rpl_vsprintf
1680 # endif
1681 # define GNULIB_overrides_vsprintf 1
1682 _GL_FUNCDECL_RPL (vsprintf, int,
1683 (char *restrict str,
1684 const char *restrict format, va_list args)
1685 _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 0)
1686 _GL_ARG_NONNULL ((1, 2)));
1687 _GL_CXXALIAS_RPL (vsprintf, int,
1688 (char *restrict str,
1689 const char *restrict format, va_list args));
1690 # else
1691
1692
1693
1694 _GL_CXXALIAS_SYS_CAST (vsprintf, int,
1695 (char *restrict str,
1696 const char *restrict format, va_list args));
1697 # endif
1698 # if __GLIBC__ >= 2
1699 _GL_CXXALIASWARN (vsprintf);
1700 # endif
1701 #elif defined GNULIB_POSIXCHECK
1702 # undef vsprintf
1703
1704 _GL_WARN_ON_USE (vsprintf, "vsprintf is not always POSIX compliant - "
1705 "use gnulib module vsprintf-posix for portable "
1706 "POSIX compliance");
1707 #endif
1708
1709 #endif
1710 #endif
1711 #endif