summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/common/BoxConfig-MSVC.h3
-rw-r--r--lib/win32/emu.h5
2 files changed, 7 insertions, 1 deletions
diff --git a/lib/common/BoxConfig-MSVC.h b/lib/common/BoxConfig-MSVC.h
index bb3ffb30..e8f90e60 100644
--- a/lib/common/BoxConfig-MSVC.h
+++ b/lib/common/BoxConfig-MSVC.h
@@ -76,6 +76,9 @@
/* Define to 1 if you have the <execinfo.h> header file. */
/* #undef HAVE_EXECINFO_H */
+/* Define to 1 if you have the <fcntl.h> header file. */
+#define HAVE_FCNTL_H 1
+
/* Define to 1 if you have the `flock' function. */
/* #undef HAVE_FLOCK */
diff --git a/lib/win32/emu.h b/lib/win32/emu.h
index 81370a1b..9582b138 100644
--- a/lib/win32/emu.h
+++ b/lib/win32/emu.h
@@ -15,6 +15,9 @@
#if ! defined EMU_INCLUDE && defined WIN32
#define EMU_INCLUDE
+// Need feature detection macros below
+#include "../common/BoxConfig.h"
+
// Shut up stupid new warnings. Thanks MinGW! Ever heard of "compatibility"?
#ifdef __MINGW32__
# define __MINGW_FEATURES__ 0
@@ -450,7 +453,7 @@ int console_read(char* pBuffer, size_t BufferSize);
// note: chsize() doesn't work over 2GB:
// [https://stat.ethz.ch/pipermail/r-devel/2005-May/033339.html]
#ifndef HAVE_FTRUNCATE
- int ftruncate(int, off_t);
+ extern "C" int ftruncate(int, off_t);
inline int ftruncate(int __fd, off_t __length)
{
return _chsize(__fd, __length);