From 05e3b8250ed153439f482be2ef544b31227f0aa7 Mon Sep 17 00:00:00 2001 From: Michihiro NAKAJIMA Date: Tue, 1 Jun 2010 06:45:39 -0400 Subject: [PATCH] On msys, include unistd.h before we redefine ftruncate() to 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 | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/libarchive/archive_windows.h b/libarchive/archive_windows.h index 1b878c2a9..8d933fa17 100644 --- a/libarchive/archive_windows.h +++ b/libarchive/archive_windows.h @@ -62,6 +62,11 @@ #include #include #include +#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 +#endif #define NOCRYPT #include //#define EFTYPE 7 -- 2.47.3