From: Michihiro NAKAJIMA Date: Tue, 1 Jun 2010 10:45:39 +0000 (-0400) Subject: On msys, include unistd.h before we redefine ftruncate() to X-Git-Tag: v3.0.0a~983 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=05e3b8250ed153439f482be2ef544b31227f0aa7;p=thirdparty%2Flibarchive.git 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 --- 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