From 83b075c35b61a28ca7e2629bb5d6e26f9e0354fe Mon Sep 17 00:00:00 2001 From: Nick Ing-Simmons Date: Tue, 21 Nov 2000 20:36:22 +0000 Subject: Win32 builds and runs (mostly) with USE_PERLIO. PERLIO=perlio passes all tests. PERLIO=stdio (sadly the default) hangs in t.pragma/warnings.t #319 p4raw-id: //depot/perlio@7796 --- perlio.c | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'perlio.c') diff --git a/perlio.c b/perlio.c index c55b6810aa..865e60e6a5 100644 --- a/perlio.c +++ b/perlio.c @@ -943,6 +943,11 @@ PerlIOUnix_oflags(const char *mode) oflags |= O_WRONLY; break; } + if (*mode == 'b') + { + oflags |= O_BINARY; + mode++; + } if (*mode || oflags == -1) { errno = EINVAL; @@ -2399,8 +2404,18 @@ PerlIO_stdoutf(const char *fmt,...) PerlIO * PerlIO_tmpfile(void) { - dTHX; /* I have no idea how portable mkstemp() is ... */ +#if defined(WIN32) || !defined(HAVE_MKSTEMP) + PerlIO *f = NULL; + FILE *stdio = tmpfile(); + if (stdio) + { + PerlIOStdio *s = PerlIOSelf(PerlIO_push(f = PerlIO_allocate(),&PerlIO_stdio,"w+"),PerlIOStdio); + s->stdio = stdio; + } + return f; +#else + dTHX; SV *sv = newSVpv("/tmp/PerlIO_XXXXXX",0); int fd = mkstemp(SvPVX(sv)); PerlIO *f = NULL; @@ -2415,6 +2430,7 @@ PerlIO_tmpfile(void) SvREFCNT_dec(sv); } return f; +#endif } #undef HAS_FSETPOS -- cgit v1.2.1