From c411622ed1115558a052ffa629b6bd710abfef5c Mon Sep 17 00:00:00 2001 From: Perl 5 Porters Date: Thu, 29 Aug 1996 10:27:29 +0000 Subject: perl 5.003_04: perlio.c Removes an incorrect prototype for setlinebuf from perlio.c because it conflicts with the correct declaration in MachTen's stdio.h (and possibly other stdio's as well). Secondly, the code in perlio.c is not handling the (!PERLIO_IS_STDIO & HAS_F[GS]ETPOS) case. The patch fixes this omission (in a rather lumpen manner). I don't think this should affect platforms which try to hack a different path through the #ifdef forest, but this assertion would benefit from testing... Dominic Dunlop --- perlio.c | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) (limited to 'perlio.c') diff --git a/perlio.c b/perlio.c index b1bf8602e9..9c74dd047b 100644 --- a/perlio.c +++ b/perlio.c @@ -103,10 +103,6 @@ PerlIO_stdout() return (PerlIO *) stdout; } -#ifdef HAS_SETLINEBUF -extern void setlinebuf _((FILE *iop)); -#endif - #undef PerlIO_fast_gets int PerlIO_fast_gets(f) @@ -528,6 +524,17 @@ const Fpos_t *pos; { return PerlIO_seek(f,*pos,0); } +#else +#ifndef PERLIO_IS_STDIO +#undef PerlIO_setpos +int +PerlIO_setpos(f,pos) +PerlIO *f; +const Fpos_t *pos; +{ + return fsetpos(f, pos); +} +#endif #endif #ifndef HAS_FGETPOS @@ -540,6 +547,17 @@ Fpos_t *pos; *pos = PerlIO_tell(f); return 0; } +#else +#ifndef PERLIO_IS_STDIO +#undef PerlIO_getpos +int +PerlIO_getpos(f,pos) +PerlIO *f; +Fpos_t *pos; +{ + return fgetpos(f, pos); +} +#endif #endif #if (defined(PERLIO_IS_STDIO) || !defined(USE_SFIO)) && !defined(HAS_VPRINTF) -- cgit v1.2.1