From: Hans Hinrichsen Date: Wed, 6 Jan 2016 14:58:53 +0000 (-0600) Subject: Visual Studio 2015 Changes X-Git-Tag: v3.1.900a~20^2^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F644%2Fhead;p=thirdparty%2Flibarchive.git Visual Studio 2015 Changes snprintf shouldn't be defined in a macro in VS2015 and above due to its C99 changes --- diff --git a/cat/test/test.h b/cat/test/test.h index 68473851c..89b593108 100644 --- a/cat/test/test.h +++ b/cat/test/test.h @@ -92,7 +92,7 @@ #endif /* Visual Studio */ -#ifdef _MSC_VER +#if defined(_MSC_VER) && _MSC_VER < 1900 #define snprintf sprintf_s #endif diff --git a/cpio/cpio_windows.h b/cpio/cpio_windows.h index d8576b316..970a63df6 100644 --- a/cpio/cpio_windows.h +++ b/cpio/cpio_windows.h @@ -36,8 +36,10 @@ #define getpwnam(name) NULL #define getpwuid(id) NULL -#ifdef _MSC_VER -#define snprintf sprintf_s +#if defined(_MSC_VER) + #if _MSC_VER < 1900 + #define snprintf sprintf_s + #endif // _MSC_VER < 1900 #define strdup _strdup #define open _open #define read _read diff --git a/cpio/test/test.h b/cpio/test/test.h index 9898be65c..5a39c686c 100644 --- a/cpio/test/test.h +++ b/cpio/test/test.h @@ -90,7 +90,7 @@ #endif /* Visual Studio */ -#ifdef _MSC_VER +#if defined(_MSC_VER) && _MSC_VER < 1900 #define snprintf sprintf_s #endif diff --git a/libarchive/archive_write_set_format_warc.c b/libarchive/archive_write_set_format_warc.c index 923041ec4..ea66929a9 100644 --- a/libarchive/archive_write_set_format_warc.c +++ b/libarchive/archive_write_set_format_warc.c @@ -402,7 +402,7 @@ _popul_ehdr(struct archive_string *tgt, size_t tsz, warc_essential_hdr_t hdr) * handle the minimum number following '%'. * So we have to use snprintf function here instead * of archive_string_snprintf function. */ -#if defined(_WIN32) && !defined(__CYGWIN__) +#if defined(_WIN32) && !defined(__CYGWIN__) && !( defined(_MSC_VER) && _MSC_VER >= 1900) #define snprintf _snprintf #endif snprintf( diff --git a/libarchive/test/test.h b/libarchive/test/test.h index f80565bc1..bde7c1d77 100644 --- a/libarchive/test/test.h +++ b/libarchive/test/test.h @@ -89,7 +89,7 @@ #endif /* Visual Studio */ -#ifdef _MSC_VER +#if defined(_MSC_VER) && _MSC_VER < 1900 #define snprintf sprintf_s #endif diff --git a/tar/test/test.h b/tar/test/test.h index 68473851c..89b593108 100644 --- a/tar/test/test.h +++ b/tar/test/test.h @@ -92,7 +92,7 @@ #endif /* Visual Studio */ -#ifdef _MSC_VER +#if defined(_MSC_VER) && _MSC_VER < 1900 #define snprintf sprintf_s #endif