]> git.ipfire.org Git - thirdparty/libarchive.git/commitdiff
On msys, include unistd.h before we redefine ftruncate() to
authorMichihiro NAKAJIMA <ggcueroad@gmail.com>
Tue, 1 Jun 2010 10:45:39 +0000 (06:45 -0400)
committerMichihiro NAKAJIMA <ggcueroad@gmail.com>
Tue, 1 Jun 2010 10:45:39 +0000 (06:45 -0400)
prevent build error from a type mismatch of ftruncate().

Msys has a unistd.h file and it defines ftruncate() with off_t, and
then it will causes build error after we redefine ftruncate() as
__la_ftruncate(int, int64_t).

SVN-Revision: 2438

libarchive/archive_windows.h

index 1b878c2a9f852430ade02898f029296b5176c30a..8d933fa179b90c8107e2ae7426c635fb0b439699 100644 (file)
 #include <sys/stat.h>
 #include <process.h>
 #include <direct.h>
+#if defined(__MINGW32__) && defined(HAVE_UNISTD_H)
+/* Prevent build error from a type mismatch of ftruncate().
+ * This unistd.h defines it as ftruncate(int, off_t). */
+#include <unistd.h>
+#endif
 #define NOCRYPT
 #include <windows.h>
 //#define      EFTYPE 7