]> git.ipfire.org Git - thirdparty/libarchive.git/commitdiff
Visual Studio 2015 Changes 644/head
authorHans Hinrichsen <hinrichsen.hans@gmail.com>
Wed, 6 Jan 2016 14:58:53 +0000 (08:58 -0600)
committerHans Hinrichsen <hinrichsen.hans@gmail.com>
Thu, 14 Jan 2016 04:26:34 +0000 (22:26 -0600)
snprintf shouldn't be defined in a macro in VS2015 and above due to its C99 changes

cat/test/test.h
cpio/cpio_windows.h
cpio/test/test.h
libarchive/archive_write_set_format_warc.c
libarchive/test/test.h
tar/test/test.h

index 68473851cbc298b981bd12a43950390f3529e5db..89b593108c20410a320a536f9410ddd6f183f70a 100644 (file)
@@ -92,7 +92,7 @@
 #endif
 
 /* Visual Studio */
-#ifdef _MSC_VER
+#if defined(_MSC_VER) && _MSC_VER < 1900
 #define snprintf       sprintf_s
 #endif
 
index d8576b316d336d7403ac443d782200298687a4a3..970a63df663dfc5da6ba8a108284068694f86540 100644 (file)
 #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
index 9898be65c10c2bba69a64bdcf010ffcb65a760e5..5a39c686c67e467c22b24191d409c52da5a62377 100644 (file)
@@ -90,7 +90,7 @@
 #endif
 
 /* Visual Studio */
-#ifdef _MSC_VER
+#if defined(_MSC_VER) && _MSC_VER < 1900
 #define snprintf       sprintf_s
 #endif
 
index 923041ec4ca54f28b8122a2a1315b946d92f08e0..ea66929a97670ba9baf79f2b77038a8fa1e59c63 100644 (file)
@@ -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(
index f80565bc1b408d4accd376f5cf4455ace8c0474f..bde7c1d77ad1c4def430fe7cf2ebaeddb1da8e53 100644 (file)
@@ -89,7 +89,7 @@
 #endif
 
 /* Visual Studio */
-#ifdef _MSC_VER
+#if defined(_MSC_VER) && _MSC_VER < 1900
 #define snprintf       sprintf_s
 #endif
 
index 68473851cbc298b981bd12a43950390f3529e5db..89b593108c20410a320a536f9410ddd6f183f70a 100644 (file)
@@ -92,7 +92,7 @@
 #endif
 
 /* Visual Studio */
-#ifdef _MSC_VER
+#if defined(_MSC_VER) && _MSC_VER < 1900
 #define snprintf       sprintf_s
 #endif