Index: include/stdio.h =================================================================== RCS file: /home/ncvs/src/include/stdio.h,v retrieving revision 1.27 diff -u -r1.27 stdio.h --- include/stdio.h 2001/02/12 02:50:30 1.27 +++ include/stdio.h 2001/02/12 23:49:44 @@ -131,10 +131,9 @@ } FILE; __BEGIN_DECLS -extern FILE __sF[]; -extern FILE *__stdin; -extern FILE *__stdout; -extern FILE *__stderr; +extern FILE __stdin; +extern FILE __stdout; +extern FILE __stderr; __END_DECLS #define __SLBF 0x0001 /* line buffered */ @@ -197,9 +196,9 @@ #define SEEK_END 2 /* set file offset to EOF plus offset */ #endif -#define stdin (__stdin) -#define stdout (__stdout) -#define stderr (__stderr) +#define stdin (&__stdin) +#define stdout (&__stdout) +#define stderr (&__stderr) /* * Functions defined in ANSI C standard. Index: lib/libc/stdio/findfp.c =================================================================== RCS file: /home/ncvs/src/lib/libc/stdio/findfp.c,v retrieving revision 1.11 diff -u -r1.11 findfp.c --- lib/libc/stdio/findfp.c 2001/02/12 02:50:30 1.11 +++ lib/libc/stdio/findfp.c 2001/02/12 23:49:44 @@ -59,25 +59,22 @@ #define NDYNAMIC 10 /* add ten more whenever necessary */ -#define std(flags, file) \ - {0,0,0,flags,file,{0},0,__sF+file,__sclose,__sread,__sseek,__swrite} -/* p r w flags file _bf z cookie close read seek write */ +#define std(handle, flags, file) \ +FILE handle = {0,0,0,flags,file,{0},0,&handle,__sclose,__sread,__sseek,__swrite} +/* p r w flags file _bf z cookie close read seek write */ /* the usual - (stdin + stdout + stderr) */ static FILE usual[FOPEN_MAX - 3]; static struct glue uglue = { NULL, FOPEN_MAX - 3, usual }; -FILE __sF[3] = { - std(__SRD, STDIN_FILENO), /* stdin */ - std(__SWR, STDOUT_FILENO), /* stdout */ - std(__SWR|__SNBF, STDERR_FILENO) /* stderr */ -}; -struct glue __sglue = { &uglue, 3, __sF }; -static struct glue *lastglue = &uglue; +std(__stdin, __SRD, STDIN_FILENO); +std(__stdout, __SWR, STDOUT_FILENO); +std(__stderr, __SWR|__SNBF, STDERR_FILENO); -FILE *__stdin = &__sF[0]; -FILE *__stdout = &__sF[1]; -FILE *__stderr = &__sF[2]; +static struct glue sglue2 = { &uglue, 1, &__stderr }; +static struct glue sglue1 = { &sglue2, 1, &__stdout }; +struct glue __sglue = { &sglue1, 1, &__stdin }; +static struct glue *lastglue = &uglue; static struct glue * moreglue __P((int));