This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
infnan: define NV_QNAN and NV_SNAN if feasible
[perl5.git] / perlsdio.h
index c1f823e..7dcd394 100644 (file)
@@ -1,7 +1,7 @@
 /*    perlsdio.h
  *
  *    Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001,
- *    2002, 2003, 2006, 2007, by Larry Wall and others
+ *    2002, 2003, 2006, 2007, 2008 by Larry Wall and others
  *
  *    You may distribute under the terms of either the GNU General Public
  *    License or the Artistic License, as specified in the README file.
 #define PerlIO_fdopen                  PerlSIO_fdopen
 #define PerlIO_reopen                  PerlSIO_freopen
 #define PerlIO_close(f)                        PerlSIO_fclose(f)
-#define PerlIO_puts(f,s)               PerlSIO_fputs(f,s)
-#define PerlIO_putc(f,c)               PerlSIO_fputc(f,c)
-#if defined(VMS)
-#  if defined(__DECC)
-     /* Unusual definition of ungetc() here to accomodate fast_sv_gets()'
+#define PerlIO_puts(f,s)               PerlSIO_fputs(s,f)
+#define PerlIO_putc(f,c)               PerlSIO_fputc(c,f)
+#if defined(__VMS)
+     /* Unusual definition of ungetc() here to accommodate fast_sv_gets()'
       * belief that it can mix getc/ungetc with reads from stdio buffer */
+START_EXTERN_C
      int decc$ungetc(int __c, FILE *__stream);
+END_EXTERN_C
 #    define PerlIO_ungetc(f,c) ((c) == EOF ? EOF : \
             ((*(f) && !((*(f))->_flag & _IONBF) && \
             ((*(f))->_ptr > (*(f))->_base)) ? \
             ((*(f))->_cnt++, *(--(*(f))->_ptr) = (c)) : decc$ungetc(c,f)))
-#  else
-#    define PerlIO_ungetc(f,c)         ungetc(c,f)
-#  endif
-   /* Work around bug in DECCRTL/AXP (DECC v5.x) and some versions of old
-    * VAXCRTL which causes read from a pipe after EOF has been returned
-    * once to hang.
-    */
-#  define PerlIO_getc(f) \
-               (feof(f) ? EOF : getc(f))
-#  define PerlIO_read(f,buf,count) \
-               (feof(f) ? 0 : (SSize_t)fread(buf,1,count,f))
-#  define PerlIO_tell(f)               ftell(f)
 #else
-#  define PerlIO_getc(f)               PerlSIO_fgetc(f)
-#  define PerlIO_ungetc(f,c)           PerlSIO_ungetc(c,f)
-#  define PerlIO_read(f,buf,count)     (SSize_t)PerlSIO_fread(buf,1,count,f)
-#  define PerlIO_tell(f)               PerlSIO_ftell(f)
+#    define PerlIO_ungetc(f,c)         ungetc(c,f)
 #endif
+#define PerlIO_getc(f)         PerlSIO_fgetc(f)
+#define PerlIO_ungetc(f,c)             PerlSIO_ungetc(c,f)
+#define PerlIO_read(f,buf,count)       (SSize_t)PerlSIO_fread(buf,1,count,f)
+#define PerlIO_tell(f)         PerlSIO_ftell(f)
 #define PerlIO_eof(f)                  PerlSIO_feof(f)
 #define PerlIO_getname(f,b)            fgetname(f,b)
 #define PerlIO_error(f)                        PerlSIO_ferror(f)
 #define PerlIO_fileno(f)               PerlSIO_fileno(f)
 #define PerlIO_clearerr(f)             PerlSIO_clearerr(f)
 #define PerlIO_flush(f)                        PerlSIO_fflush(f)
-#if defined(VMS) && !defined(__DECC)
-/* Old VAXC RTL doesn't reset EOF on seek; Perl folk seem to expect this */
-#define PerlIO_seek(f,o,w)     (((f) && (*f) && ((*f)->_flag &= ~_IOEOF)),fseek(f,o,w))
-#else
-#  define PerlIO_seek(f,o,w)           PerlSIO_fseek(f,o,w)
-#endif
+#define PerlIO_seek(f,o,w)             PerlSIO_fseek(f,o,w)
 
 #define PerlIO_rewind(f)               PerlSIO_rewind(f)
 #define PerlIO_tmpfile()               PerlSIO_tmpfile()
  * Local variables:
  * c-indentation-style: bsd
  * c-basic-offset: 4
- * indent-tabs-mode: t
+ * indent-tabs-mode: nil
  * End:
  *
- * ex: set ts=8 sts=4 sw=4 noet:
+ * ex: set ts=8 sts=4 sw=4 et:
  */