X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=perlio.c;h=6945a75069a719dde5cc877fef2a17476d68d2f0;hb=9bc5fa8de0e98ff1317c3fdc7e35f6e13be0ac35;hp=5f9ed6b536cdee109a62dd489b108a6b732d85e9;hpb=d9b3e12dc6d5d94bcf6692f9359e377c8a7dcdd6;p=p5sagit%2Fp5-mst-13.2.git diff --git a/perlio.c b/perlio.c index 5f9ed6b..6945a75 100644 --- a/perlio.c +++ b/perlio.c @@ -1,13 +1,12 @@ /* perlio.c * - * Copyright (c) 1996-1999, Nick Ing-Simmons + * Copyright (c) 1996-2000, Nick Ing-Simmons * * You may distribute under the terms of either the GNU General Public * License or the Artistic License, as specified in the README file. * */ -#if !defined(PERL_IMPLICIT_SYS) #define VOIDUSED 1 #include "config.h" @@ -26,6 +25,8 @@ #define PERL_IN_PERLIO_C #include "perl.h" +#if !defined(PERL_IMPLICIT_SYS) + #ifdef PERLIO_IS_STDIO void @@ -385,14 +386,22 @@ PerlIO_vprintf(PerlIO *f, const char *fmt, va_list ap) Off_t PerlIO_tell(PerlIO *f) { +#if defined(USE_64_BIT_STDIO) && defined(HAS_FTELLO) && !defined(USE_FTELL64) + return ftello(f); +#else return ftell(f); +#endif } #undef PerlIO_seek int PerlIO_seek(PerlIO *f, Off_t offset, int whence) { +#if defined(USE_64_BIT_STDIO) && defined(HAS_FSEEKO) && !defined(USE_FSEEK64) + return fseeko(f,offset,whence); +#else return fseek(f,offset,whence); +#endif } #undef PerlIO_rewind @@ -486,7 +495,7 @@ PerlIO_setpos(PerlIO *f, const Fpos_t *pos) int PerlIO_setpos(PerlIO *f, const Fpos_t *pos) { -#if defined(USE_64_BIT_STDIO) && defined(HAS_FSETPOS64) +#if defined(USE_64_BIT_STDIO) && defined(USE_FSETPOS64) return fsetpos64(f, pos); #else return fsetpos(f, pos); @@ -509,7 +518,7 @@ PerlIO_getpos(PerlIO *f, Fpos_t *pos) int PerlIO_getpos(PerlIO *f, Fpos_t *pos) { -#if defined(USE_64_BIT_STDIO) && defined(HAS_FSETPOS64) +#if defined(USE_64_BIT_STDIO) && defined(USE_FSETPOS64) return fgetpos64(f, pos); #else return fgetpos(f, pos); @@ -545,11 +554,9 @@ PerlIO_vsprintf(char *s, int n, const char *fmt, va_list ap) { if (strlen(s) >= (STRLEN)n) { - PerlIO_puts(PerlIO_stderr(),"panic: sprintf overflow - memory corrupted!\n"); - { - dTHX; - my_exit(1); - } + dTHX; + PerlIO_puts(Perl_error_log,"panic: sprintf overflow - memory corrupted!\n"); + my_exit(1); } } return val;