diff options
author | Perl 5 Porters <perl5-porters@africa.nicoh.com> | 1996-08-25 00:21:17 +0000 |
---|---|---|
committer | Andy Dougherty <doughera@lafcol.lafayette.edu> | 1996-08-25 00:21:17 +0000 |
commit | 33dcbb9a4b5517789b5e779cf126923149d7ff89 (patch) | |
tree | 69afc6499e9c769fb6ebd085bf86ce971f759257 | |
parent | 3fc1aec64f7c92b9646c7e2f534b41043f54f5ed (diff) | |
download | perl-33dcbb9a4b5517789b5e779cf126923149d7ff89.tar.gz |
Fixes to support non-std stdio.
-rw-r--r-- | perlio.c | 9 | ||||
-rw-r--r-- | perlsdio.h | 60 |
2 files changed, 65 insertions, 4 deletions
@@ -35,6 +35,13 @@ PerlIO_init() */ } +#undef PerlIO_tmpfile +PerlIO * +PerlIO_tmpfile() +{ + return tmpfile(); +} + #else /* PERLIO_IS_STDIO */ #ifdef USE_SFIO @@ -158,12 +165,14 @@ PerlIO *f; char *ptr; int cnt; { +#ifdef FILE_bufsiz char *e = (char *)(FILE_base(f) + FILE_bufsiz(f)); int ec = e - ptr; if (ptr > e) warn("Setting ptr %p > base %p\n",ptr, FILE_base(f)+FILE_bufsiz(f)); if (cnt != ec) warn("Setting cnt to %d, ptr implies %d\n",cnt,ec); +#endif #if defined(USE_STDIO_PTR) && defined(STDIO_PTR_LVALUE) FILE_ptr(f) = (STDCHAR *) ptr; #else diff --git a/perlsdio.h b/perlsdio.h index 038148f1f4..082d96d561 100644 --- a/perlsdio.h +++ b/perlsdio.h @@ -80,8 +80,8 @@ #else /* USE_STDIO_PTR */ #define PerlIO_has_cntptr(f) 0 -#define PerlIO_get_cnt(f) abort() -#define PerlIO_get_ptr(f) abort() +#define PerlIO_get_cnt(f) (abort(),0) +#define PerlIO_get_ptr(f) (abort(),0) #define PerlIO_set_cnt(f,c) abort() #define PerlIO_set_ptrcnt(f,p,c) abort() @@ -98,8 +98,8 @@ #define PerlIO_get_bufsiz(f) FILE_bufsiz(f) #else #define PerlIO_has_base(f) 0 -#define PerlIO_get_base(f) abort() -#define PerlIO_get_bufsiz(f) abort() +#define PerlIO_get_base(f) (abort(),0) +#define PerlIO_get_bufsiz(f) (abort(),0) #endif #else /* PERLIO_IS_STDIO */ #ifdef PERL_CORE @@ -113,6 +113,32 @@ * Strong denial of stdio - make all stdio calls (we can think of) errors */ #include "nostdio.h" +#undef fprintf +#undef tmpfile +#undef fclose +#undef fopen +#undef vfprintf +#undef fgetc +#undef fputc +#undef fputs +#undef ungetc +#undef fread +#undef fwrite +#undef fgetpos +#undef fseek +#undef fsetpos +#undef ftell +#undef rewind +#undef fdopen +#undef popen +#undef pclose +#undef getw +#undef putw +#undef freopen +#undef setbuf +#undef setvbuf +#undef fscanf +#undef fgets #define fprintf _CANNOT _fprintf_ #define stdin _CANNOT _stdin_ #define stdout _CANNOT _stdout_ @@ -173,6 +199,32 @@ #include "nostdio.h" #undef FILE #define FILE PerlIO +#undef fprintf +#undef tmpfile +#undef fclose +#undef fopen +#undef vfprintf +#undef fgetc +#undef fputc +#undef fputs +#undef ungetc +#undef fread +#undef fwrite +#undef fgetpos +#undef fseek +#undef fsetpos +#undef ftell +#undef rewind +#undef fdopen +#undef popen +#undef pclose +#undef getw +#undef putw +#undef freopen +#undef setbuf +#undef setvbuf +#undef fscanf +#undef fgets #define fprintf PerlIO_printf #define stdin PerlIO_stdin() #define stdout PerlIO_stdout() |