summaryrefslogtreecommitdiff
path: root/iperlsys.h
diff options
context:
space:
mode:
authorCraig A. Berry <craigberry@mac.com>2001-05-26 04:34:11 -0500
committerJarkko Hietaniemi <jhi@iki.fi>2001-05-26 13:39:52 +0000
commita15cef0c498d0b84ecf118ac9b0a6f383dfcf79d (patch)
tree8206f040d6dd469b392556385778120790796728 /iperlsys.h
parent22c4a518db8a7c3e34c557402a6edb407a8f26b4 (diff)
downloadperl-a15cef0c498d0b84ecf118ac9b0a6f383dfcf79d.tar.gz
PerlIO for VMS
Message-Id: <a05100e0ab734816701a5@[172.16.52.1]> p4raw-id: //depot/perl@10218
Diffstat (limited to 'iperlsys.h')
-rw-r--r--iperlsys.h12
1 files changed, 11 insertions, 1 deletions
diff --git a/iperlsys.h b/iperlsys.h
index 6c093dd53f..237fab26d6 100644
--- a/iperlsys.h
+++ b/iperlsys.h
@@ -303,7 +303,17 @@ struct IPerlStdIOInfo
#define PerlSIO_fputs(f,s) fputs(s,f)
#define PerlSIO_fflush(f) Fflush(f)
#define PerlSIO_fgets(s, n, fp) fgets(s,n,fp)
-#define PerlSIO_ungetc(c,f) 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 PerlSIO_ungetc(c,f) ((c) == EOF ? EOF : \
+ ((*(f) && !((*(f))->_flag & _IONBF) && \
+ ((*(f))->_ptr > (*(f))->_base)) ? \
+ ((*(f))->_cnt++, *(--(*(f))->_ptr) = (c)) : decc$ungetc(c,f)))
+#else
+# define PerlSIO_ungetc(c,f) ungetc(c,f)
+#endif
#define PerlSIO_fileno(f) fileno(f)
#define PerlSIO_fdopen(f, s) fdopen(f,s)
#define PerlSIO_freopen(p, m, f) freopen(p,m,f)