summaryrefslogtreecommitdiff
path: root/perlsdio.h
diff options
context:
space:
mode:
authorPerl 5 Porters <perl5-porters@africa.nicoh.com>1996-10-03 16:31:46 -0400
committerAndy Dougherty <doughera@lafcol.lafayette.edu>1996-10-03 16:31:46 -0400
commit1ac5d68dd01b70b178f94cd2fc2f57c48fe8d1a5 (patch)
treeac27cc9da9bb5e7c76382659e73707bda0296bea /perlsdio.h
parent111c4dfaa7a127a5261341226409788d80ed26fe (diff)
downloadperl-1ac5d68dd01b70b178f94cd2fc2f57c48fe8d1a5.tar.gz
perl 5.003_06: perlsdio.h
Date: Fri, 13 Sep 1996 17:24:01 -0400 From: John Stoffel <jfs@jfs.fluent.com> Subject: Re: 5.003_05 is available. Undef Irix getc_unlocked and putc_unlocked #defines. Date: Thu, 03 Oct 1996 16:31:46 -0400 (EDT) From: Charles Bailey <bailey@HMIVAX.HUMGEN.UPENN.EDU> Subject: VMS patches to 5.003_05
Diffstat (limited to 'perlsdio.h')
-rw-r--r--perlsdio.h14
1 files changed, 13 insertions, 1 deletions
diff --git a/perlsdio.h b/perlsdio.h
index ff32cdd8e2..c3714410d6 100644
--- a/perlsdio.h
+++ b/perlsdio.h
@@ -24,7 +24,17 @@
#define PerlIO_close(f) fclose(f)
#define PerlIO_puts(f,s) fputs(s,f)
#define PerlIO_putc(f,c) fputc(c,f)
-#define PerlIO_ungetc(f,c) ungetc(c,f)
+#if defined(VMS) && defined(__DECC)
+ /* Unusual definition of ungetc() here to accomodate fast_sv_gets()'
+ * belief that it can mix getc/ungetc with reads from stdio buffer */
+ int decc$ungetc(int __c, FILE *__stream);
+# 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
#define PerlIO_getc(f) getc(f)
#define PerlIO_eof(f) feof(f)
#define PerlIO_getname(f,b) fgetname(f,b)
@@ -142,6 +152,8 @@
#undef setvbuf
#undef fscanf
#undef fgets
+#undef getc_unlocked
+#undef putc_unlocked
#define fprintf _CANNOT _fprintf_
#define stdin _CANNOT _stdin_
#define stdout _CANNOT _stdout_