From: Tim Kientzle Date: Fri, 12 Jun 2009 04:54:24 +0000 (-0400) Subject: Fix libarchive_test on MinGW. Can we do better here? X-Git-Tag: v2.8.0~591 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a132a3eb081b27d4fafe2439c4a336b2c5b72b1a;p=thirdparty%2Flibarchive.git Fix libarchive_test on MinGW. Can we do better here? SVN-Revision: 1158 --- diff --git a/libarchive/test/main.c b/libarchive/test/main.c index 0f217eaf1..710dc9f0f 100644 --- a/libarchive/test/main.c +++ b/libarchive/test/main.c @@ -34,7 +34,9 @@ #include #include #if defined(_WIN32) && !defined(__CYGWIN__) +#if !defined(__GNUC__) #include +#endif #include #include #endif @@ -89,7 +91,7 @@ static int assertions = 0; static const char *refdir; -#if defined(_WIN32) && !defined(__CYGWIN__) +#if defined(_WIN32) && !defined(__CYGWIN__) && !defined(__GNUC__) static void invalid_parameter_handler(const wchar_t * expression, @@ -970,6 +972,8 @@ get_refdir(void) pwd[strlen(pwd) - 1] = '\0'; printf("PWD: %s\n", pwd); +#undef snprintf + /* Look for a known file. */ snprintf(buff, sizeof(buff), "%s", pwd); p = slurpfile(NULL, "%s/%s", buff, KNOWNREF); @@ -1029,7 +1033,7 @@ int main(int argc, char **argv) (void)argc; /* UNUSED */ -#if defined(_WIN32) && !defined(__CYGWIN__) +#if defined(_WIN32) && !defined(__CYGWIN__) && !defined(__GNUC__) /* To stop to run the default invalid parameter handler. */ _set_invalid_parameter_handler(invalid_parameter_handler); /* for open() to a binary mode. */