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.h37
1 files changed, 24 insertions, 13 deletions
diff --git a/lib/common/BoxPlatform.h b/lib/common/BoxPlatform.h
index 2f0096aa..c625a7c7 100644
--- a/lib/common/BoxPlatform.h
+++ b/lib/common/BoxPlatform.h
@@ -29,9 +29,15 @@
#endif
#ifdef WIN32
- // need msvcrt version 6.1 or higher for _gmtime64()
- // must define this before importing <sys/types.h>
- #define __MSVCRT_VERSION__ 0x0601
+ #ifdef __MSVCRT_VERSION__
+ #if __MSVCRT_VERSION__ < 0x0601
+ #error Must include Box.h before sys/types.h
+ #endif
+ #else
+ // need msvcrt version 6.1 or higher for _gmtime64()
+ // must define this before importing <sys/types.h>
+ #define __MSVCRT_VERSION__ 0x0601
+ #endif
#endif
#ifdef HAVE_SYS_TYPES_H
@@ -66,10 +72,14 @@
#endif
// Find out if credentials on UNIX sockets can be obtained
-#ifndef HAVE_GETPEEREID
- #if !HAVE_DECL_SO_PEERCRED
- #define PLATFORM_CANNOT_FIND_PEER_UID_OF_UNIX_SOCKET
- #endif
+#ifdef HAVE_GETPEEREID
+ //
+#elif HAVE_DECL_SO_PEERCRED
+ //
+#elif defined HAVE_UCRED_H && HAVE_GETPEERUCRED
+ //
+#else
+ #define PLATFORM_CANNOT_FIND_PEER_UID_OF_UNIX_SOCKET
#endif
#ifdef HAVE_DEFINE_PRAGMA
@@ -150,7 +160,7 @@
#endif
// for Unix compatibility with Windows :-)
-#if !HAVE_DECL_O_BINARY
+#ifndef O_BINARY
#define O_BINARY 0
#endif
@@ -162,14 +172,15 @@
#ifdef WIN32
#define WIN32_LEAN_AND_MEAN
- #include "emu.h"
#endif
-// Solaris has no dirfd(x) macro or function, and we need one.
-// We cannot define macros with arguments directly using AC_DEFINE,
-// so do it here instead of in configure.ac.
+#include "emu.h"
+
+// Solaris has no dirfd(x) macro or function, and we need one for
+// intercept tests. We cannot define macros with arguments directly
+// using AC_DEFINE, so do it here instead of in configure.ac.
-#if ! HAVE_DECL_DIRFD
+#if ! defined PLATFORM_CLIB_FNS_INTERCEPTION_IMPOSSIBLE && ! HAVE_DECL_DIRFD
#ifdef HAVE_DIR_D_FD
#define dirfd(x) (x)->d_fd
#elif defined HAVE_DIR_DD_FD