summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/win32/emu.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/win32/emu.h b/lib/win32/emu.h
index 1b071f7e..d5ac7e1e 100644
--- a/lib/win32/emu.h
+++ b/lib/win32/emu.h
@@ -435,6 +435,16 @@ std::string GetErrorMessage(DWORD errorCode);
// relatively recent C runtime lib
int console_read(char* pBuffer, size_t BufferSize);
+// Defined thus by MinGW, but missing from MSVC
+// [http://curl.haxx.se/mail/lib-2004-11/0260.html]
+#ifndef HAVE_FTRUNCATE
+ int ftruncate(int, off_t);
+ inline int ftruncate(int __fd, off_t __length)
+ {
+ return _chsize(__fd, __length);
+ }
+#endif
+
#ifdef _MSC_VER
/* disable certain compiler warnings to be able to actually see the show-stopper ones */
#pragma warning(disable:4101) // unreferenced local variable