made stdin, stdout, and stderr into compile time constants
This commit is contained in:
parent
fb8fc4e07c
commit
ce561e5f3a
1 changed files with 4 additions and 4 deletions
|
@ -20,7 +20,7 @@ extern struct _io_buf {
|
||||||
int _flags;
|
int _flags;
|
||||||
unsigned char *_buf;
|
unsigned char *_buf;
|
||||||
unsigned char *_ptr;
|
unsigned char *_ptr;
|
||||||
} *_io_table[_NFILES];
|
} *_io_table[_NFILES], _stdin, _stdout, _stderr;
|
||||||
|
|
||||||
|
|
||||||
#endif /* FILE */
|
#endif /* FILE */
|
||||||
|
@ -28,9 +28,9 @@ extern struct _io_buf {
|
||||||
#define FILE struct _io_buf
|
#define FILE struct _io_buf
|
||||||
|
|
||||||
|
|
||||||
#define stdin (_io_table[0])
|
#define stdin (&_stdin)
|
||||||
#define stdout (_io_table[1])
|
#define stdout (&_stdout)
|
||||||
#define stderr (_io_table[2])
|
#define stderr (&_stderr)
|
||||||
|
|
||||||
#define getchar() getc(stdin)
|
#define getchar() getc(stdin)
|
||||||
#define putchar(c) putc(c,stdout)
|
#define putchar(c) putc(c,stdout)
|
||||||
|
|
Loading…
Add table
Reference in a new issue