aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/tool_binmode.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/tool_binmode.c b/src/tool_binmode.c
index 4afe9a413..51bbb45d2 100644
--- a/src/tool_binmode.c
+++ b/src/tool_binmode.c
@@ -37,10 +37,12 @@
void set_binmode(FILE *stream)
{
-#ifdef __HIGHC__
+#ifdef O_BINARY
+# ifdef __HIGHC__
_setmode(stream, O_BINARY);
-#else
+# else
setmode(fileno(stream), O_BINARY);
+# endif
#endif
}