* 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 : fread(buf,1,count,f))
+# 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))
#else
# define PerlIO_ungetc(f,c) ungetc(c,f)
# define PerlIO_getc(f) getc(f)
-# define PerlIO_read(f,buf,count) fread(buf,1,count,f)
+# define PerlIO_read(f,buf,count) (SSize_t)fread(buf,1,count,f)
#endif
#define PerlIO_eof(f) feof(f)
#define PerlIO_getname(f,b) fgetname(f,b)
#define PerlIO_clearerr(f) clearerr(f)
#define PerlIO_flush(f) Fflush(f)
#define PerlIO_tell(f) ftell(f)
-#define PerlIO_seek(f,o,w) fseek(f,o,w)
+#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) fseek(f,o,w)
+#endif
#ifdef HAS_FGETPOS
#define PerlIO_getpos(f,p) fgetpos(f,p)
#endif
#define PerlIO_has_cntptr(f) 0
#define PerlIO_canset_cnt(f) 0
#define PerlIO_get_cnt(f) (abort(),0)
-#define PerlIO_get_ptr(f) (abort(),0)
+#define PerlIO_get_ptr(f) (abort(),(void *)0)
#define PerlIO_set_cnt(f,c) abort()
#define PerlIO_set_ptrcnt(f,p,c) abort()
#define PerlIO_get_bufsiz(f) FILE_bufsiz(f)
#else
#define PerlIO_has_base(f) 0
-#define PerlIO_get_base(f) (abort(),0)
+#define PerlIO_get_base(f) (abort(),(void *)0)
#define PerlIO_get_bufsiz(f) (abort(),0)
#endif
#else /* PERLIO_IS_STDIO */
#undef fopen
#undef vfprintf
#undef fgetc
+#undef getc_unlocked
#undef fputc
+#undef putc_unlocked
#undef fputs
#undef ungetc
#undef fread