summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/common/BoxPlatform.h5
-rw-r--r--lib/raidfile/RaidFileRead.cpp4
-rw-r--r--lib/raidfile/RaidFileWrite.cpp4
-rw-r--r--lib/win32/emu.h2
4 files changed, 8 insertions, 7 deletions
diff --git a/lib/common/BoxPlatform.h b/lib/common/BoxPlatform.h
index 53a967e8..06f34d5c 100644
--- a/lib/common/BoxPlatform.h
+++ b/lib/common/BoxPlatform.h
@@ -40,9 +40,12 @@
#endif
#endif
+#include "emu.h"
+
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
+
#ifdef HAVE_INTTYPES_H
#include <inttypes.h>
#else
@@ -182,8 +185,6 @@
#define WIN32_LEAN_AND_MEAN
#endif
-#include "emu.h"
-
#ifdef WIN32
#define INVALID_FILE INVALID_HANDLE_VALUE
typedef HANDLE tOSFileHandle;
diff --git a/lib/raidfile/RaidFileRead.cpp b/lib/raidfile/RaidFileRead.cpp
index a78ec4a2..1396b4cd 100644
--- a/lib/raidfile/RaidFileRead.cpp
+++ b/lib/raidfile/RaidFileRead.cpp
@@ -44,8 +44,8 @@
#define READ_NUMBER_DISCS_REQUIRED 3
#define READV_MAX_BLOCKS 64
-// We want to use POSIX fstat() for now, not the emulated one
-#undef fstat
+// We want to use POSIX fstat() for now, not the emulated one, because it's
+// difficult to rewrite all this code to use HANDLEs instead of ints.
// --------------------------------------------------------------------------
//
diff --git a/lib/raidfile/RaidFileWrite.cpp b/lib/raidfile/RaidFileWrite.cpp
index ddc99fc7..f06a2472 100644
--- a/lib/raidfile/RaidFileWrite.cpp
+++ b/lib/raidfile/RaidFileWrite.cpp
@@ -42,8 +42,8 @@
// Must have this number of discs in the set
#define TRANSFORM_NUMBER_DISCS_REQUIRED 3
-// we want to use POSIX fstat() for now, not the emulated one
-#undef fstat
+// We want to use POSIX fstat() for now, not the emulated one, because it's
+// difficult to rewrite all this code to use HANDLEs instead of ints.
// --------------------------------------------------------------------------
//
diff --git a/lib/win32/emu.h b/lib/win32/emu.h
index cd4e2f4e..acc91b15 100644
--- a/lib/win32/emu.h
+++ b/lib/win32/emu.h
@@ -279,7 +279,7 @@ void syslog (int loglevel, const char *fmt, ...);
#define strtoll _strtoi64
#endif
-inline unsigned int sleep(unsigned int secs)
+extern "C" inline unsigned int sleep(unsigned int secs)
{
Sleep(secs*1000);
return(ERROR_SUCCESS);