Make stdin/stdout/stderr into macros.

They are supposed to be macros, according to the C standards. This ordinarily doesn't matter, but it can be detected by #ifdef, as in the following program:

#include <stdio.h>
#ifdef stdin
int main(void) {
        puts("stdin is a macro");
}
#endif
This commit is contained in:
Stephen Heumann 2022-10-15 17:10:59 -05:00
parent 072f8be6bc
commit 5be888a2bd

View File

@ -85,6 +85,9 @@ typedef struct __file {
extern FILE *stderr; /* standard I/O files */ extern FILE *stderr; /* standard I/O files */
extern FILE *stdin; extern FILE *stdin;
extern FILE *stdout; extern FILE *stdout;
#define stderr stderr
#define stdin stdin
#define stdout stdout
#define L_tmpnam 26 /* size of a temp name */ #define L_tmpnam 26 /* size of a temp name */
#define TMP_MAX 10000 /* # of unique temp names */ #define TMP_MAX 10000 /* # of unique temp names */