Index: include/stdio.h =================================================================== RCS file: /home/ncvs/src/include/stdio.h,v retrieving revision 1.34 diff -u -r1.34 stdio.h --- include/stdio.h 2001/04/22 01:56:08 1.34 +++ include/stdio.h 2001/08/11 01:05:39 @@ -132,6 +132,9 @@ __BEGIN_DECLS extern FILE __sF[]; +extern FILE *__stdinp; +extern FILE *__stdoutp; +extern FILE *__stderrp; __END_DECLS #define __SLBF 0x0001 /* line buffered */ @@ -194,9 +197,16 @@ #define SEEK_END 2 /* set file offset to EOF plus offset */ #endif +/* To be removed by 5.0-RELEASE */ +#if defined(__i386__) || defined(__alpha__) #define stdin (&__sF[0]) #define stdout (&__sF[1]) #define stderr (&__sF[2]) +#else +#define stdin __stdinp +#define stdout __stdoutp +#define stderr __stderrp +#endif /* * Functions defined in ANSI C standard. Index: lib/libc/Makefile =================================================================== RCS file: /home/ncvs/src/lib/libc/Makefile,v retrieving revision 1.30 diff -u -r1.30 Makefile --- lib/libc/Makefile 2001/02/16 06:11:21 1.30 +++ lib/libc/Makefile 2001/08/11 01:05:39 @@ -9,7 +9,8 @@ LIB=c SHLIB_MAJOR= 5 SHLIB_MINOR= 0 CFLAGS+=-DLIBC_RCS -DSYSLIBC_RCS -I${.CURDIR}/include +CFLAGS+=-DLIBC_MAJOR=${SHLIB_MAJOR} AINC= -I${.CURDIR}/${MACHINE_ARCH} CLEANFILES+=tags INSTALL_PIC_ARCHIVE= yes Index: lib/libc/stdio/findfp.c =================================================================== RCS file: /home/ncvs/src/lib/libc/stdio/findfp.c,v retrieving revision 1.17 diff -u -r1.17 findfp.c --- lib/libc/stdio/findfp.c 2001/07/29 15:08:14 1.17 +++ lib/libc/stdio/findfp.c 2001/08/11 01:05:39 @@ -71,6 +71,9 @@ static struct __sFILEX __sFX[3]; +#if LIBC_MAJOR >= 6 +static +#endif FILE __sF[3] = { std(__SRD, STDIN_FILENO), std(__SWR, STDOUT_FILENO), @@ -84,18 +87,9 @@ * symbols and expects libc to provide them. We only have need to support * i386 and alpha because they are the only "old" systems we have deployed. */ -#if defined(__i386__) -#define FILE_SIZE 88 -#elif defined(__alpha__) -#define FILE_SIZE 152 -#endif -#ifndef FILE_SIZE -#error "You must define FILE_SIZE for this platform" -#endif -#define X(loc, sym) __strong_reference(loc, sym) -X(__sF + FILE_SIZE * 0, __stdin); -X(__sF + FILE_SIZE * 1, __stdout); -X(__sF + FILE_SIZE * 2, __stderr); +FILE *__stdinp = &__sF[0]; +FILE *__stdoutp = &__sF[1]; +FILE *__stderrp = &__sF[2]; struct glue __sglue = { &uglue, 3, __sF }; static struct glue *lastglue = &uglue; @@ -233,14 +227,11 @@ /* * __sinit() is called whenever stdio's internal variables must be set up. */ -#define SIZEMSG "WARNING: FILE_SIZE != sizeof(FILE)\n" void __sinit() { int i; - if (FILE_SIZE != sizeof(FILE)) - write(2, SIZEMSG, sizeof(SIZEMSG) - 1); THREAD_LOCK(); if (__sdidinit == 0) { /* Set _extra for the usual suspects. */