summaryrefslogtreecommitdiff
path: root/lib/common/BoxPlatform.h
diff options
context:
space:
mode:
Diffstat (limited to 'lib/common/BoxPlatform.h')
-rw-r--r--lib/common/BoxPlatform.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/common/BoxPlatform.h b/lib/common/BoxPlatform.h
index 617aa031..198d0498 100644
--- a/lib/common/BoxPlatform.h
+++ b/lib/common/BoxPlatform.h
@@ -159,7 +159,13 @@
#define INFTIM -1
#endif
-// for Unix compatibility with Windows :-)
+// Define O_BINARY for Unix compatibility with Windows :-)
+// MSVC 2010 defines in in fcntl.h, which is probably not included by this
+// point, so include it now so that we can detect if we need O_BINARY
+#ifdef _MSC_VER
+# include <fcntl.h>
+#endif
+
#ifndef O_BINARY
#define O_BINARY 0
#endif