summaryrefslogtreecommitdiff
path: root/pp_sys.c
diff options
context:
space:
mode:
Diffstat (limited to 'pp_sys.c')
-rw-r--r--pp_sys.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/pp_sys.c b/pp_sys.c
index 5e1f427727..6e25a54d53 100644
--- a/pp_sys.c
+++ b/pp_sys.c
@@ -71,7 +71,7 @@ extern int h_errno;
#endif
#ifdef I_UTIME
-# ifdef WIN32
+# ifdef _MSC_VER
# include <sys/utime.h>
# else
# include <utime.h>
@@ -469,8 +469,19 @@ PP(pp_binmode)
else
RETPUSHUNDEF;
#else
- if (setmode(PerlIO_fileno(fp), OP_BINARY) != -1)
+ if (setmode(PerlIO_fileno(fp), OP_BINARY) != -1) {
+#if defined(WIN32) && defined(__BORLANDC__)
+ /* The translation mode of the stream is maintained independent
+ * of the translation mode of the fd in the Borland RTL (heavy
+ * digging through their runtime sources reveal). User has to
+ * set the mode explicitly for the stream (though they don't
+ * document this anywhere). GSAR 97-5-24
+ */
+ PerlIO_seek(fp,0L,0);
+ fp->flags |= _F_BIN;
+#endif
RETPUSHYES;
+ }
else
RETPUSHUNDEF;
#endif