diff options
Diffstat (limited to 'pp_sys.c')
-rw-r--r-- | pp_sys.c | 15 |
1 files changed, 13 insertions, 2 deletions
@@ -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 |