Skip to content

Commit 2c09056

Browse files
committed
tinystdio: Add some missing defines in stdio.h
The defines are being checked for in the libc++ tests.
1 parent af4f815 commit 2c09056

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

newlib/libc/tinystdio/stdio.h

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,12 @@ extern FILE *const stdin;
147147
extern FILE *const stdout;
148148
extern FILE *const stderr;
149149

150+
/* The stdin, stdout, and stderr symbols are described as macros in the C
151+
* standard. */
152+
#define stdin stdin
153+
#define stdout stdout
154+
#define stderr stderr
155+
150156
#define EOF (-1)
151157

152158
#define _IOFBF 0 /* setvbuf should set fully buffered */
@@ -282,6 +288,17 @@ int ferror(FILE *__stream);
282288
#define BUFSIZ 512
283289
#endif
284290

291+
/*
292+
* We don't have any way of knowing any underlying POSIX limits,
293+
* so just use a reasonably small values here
294+
*/
295+
#ifndef FOPEN_MAX
296+
#define FOPEN_MAX 32
297+
#endif
298+
#ifndef FILENAME_MAX
299+
#define FILENAME_MAX 1024
300+
#endif
301+
285302
__extension__ typedef _fpos_t fpos_t;
286303
int fgetpos(FILE *stream, fpos_t *pos);
287304
FILE *fopen(const char *path, const char *mode) __malloc_like_with_free(fclose, 1);

0 commit comments

Comments
 (0)