diff options
author | Chris Wilson <chris+github@qwirx.com> | 2011-03-27 15:50:54 +0000 |
---|---|---|
committer | Chris Wilson <chris+github@qwirx.com> | 2011-03-27 15:50:54 +0000 |
commit | 2261a3f11a0f3951e774e339d0b532436445abc6 (patch) | |
tree | 7f3e10d239cbd88b8165bcde129302cc313ef2b3 /lib/win32/emu.h | |
parent | 1fcf011a6962b6ffe33b2390b61ff10a7198231c (diff) |
Add inline definition of ftruncate to fix MSVC compile.
Diffstat (limited to 'lib/win32/emu.h')
-rw-r--r-- | lib/win32/emu.h | 10 |
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 |