This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Rename use64bits to use64bitint;
[perl5.git] / perlio.c
index 565498e..6945a75 100644 (file)
--- 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,7 +386,7 @@ PerlIO_vprintf(PerlIO *f, const char *fmt, va_list ap)
 Off_t
 PerlIO_tell(PerlIO *f)
 {
-#ifdef HAS_FTELLO
+#if defined(USE_64_BIT_STDIO) && defined(HAS_FTELLO) && !defined(USE_FTELL64)
  return ftello(f);
 #else
  return ftell(f);
@@ -396,7 +397,7 @@ PerlIO_tell(PerlIO *f)
 int
 PerlIO_seek(PerlIO *f, Off_t offset, int whence)
 {
-#ifdef HAS_FSEEKO
+#if defined(USE_64_BIT_STDIO) && defined(HAS_FSEEKO) && !defined(USE_FSEEK64)
  return fseeko(f,offset,whence);
 #else
  return fseek(f,offset,whence);
@@ -494,7 +495,11 @@ PerlIO_setpos(PerlIO *f, const Fpos_t *pos)
 int
 PerlIO_setpos(PerlIO *f, const Fpos_t *pos)
 {
+#if defined(USE_64_BIT_STDIO) && defined(USE_FSETPOS64)
+ return fsetpos64(f, pos);
+#else
  return fsetpos(f, pos);
+#endif
 }
 #endif
 #endif
@@ -513,7 +518,11 @@ PerlIO_getpos(PerlIO *f, Fpos_t *pos)
 int
 PerlIO_getpos(PerlIO *f, Fpos_t *pos)
 {
+#if defined(USE_64_BIT_STDIO) && defined(USE_FSETPOS64)
+ return fgetpos64(f, pos);
+#else
  return fgetpos(f, pos);
+#endif
 }
 #endif
 #endif
@@ -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;