summaryrefslogtreecommitdiff
path: root/lib/common
diff options
context:
space:
mode:
authorChris Wilson <chris+github@qwirx.com>2011-03-26 23:24:13 +0000
committerChris Wilson <chris+github@qwirx.com>2011-03-26 23:24:13 +0000
commit4a62f40e8be40bc0dd23a10f1c6ea00f4cf818f3 (patch)
treef55329bb33b26e1f4f8593eab572ea1693a23510 /lib/common
parentcd00e66867bb9aa9cd473dce22e808a95b0a59e8 (diff)
Avoid conflicting declarations of O_BINARY on MSVC compiles.
Diffstat (limited to 'lib/common')
-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