aboutsummaryrefslogtreecommitdiff
path: root/cmake
diff options
context:
space:
mode:
authorOlehKulykov <nonamedemail@gmail.com>2015-08-31 23:43:29 +0200
committerOlehKulykov <nonamedemail@gmail.com>2015-08-31 23:43:29 +0200
commit8f2298bad8f77a22efe0dc9a95676fae6c203e36 (patch)
tree133b3e54e32b3cc43b20bcd4de7fe3653a483f1a /cmake
parent4c4f692bd6814e598c9aa538a3c9979cdf05d566 (diff)
downloadjansson-8f2298bad8f77a22efe0dc9a95676fae6c203e36.zip
jansson-8f2298bad8f77a22efe0dc9a95676fae6c203e36.tar.gz
jansson-8f2298bad8f77a22efe0dc9a95676fae6c203e36.tar.bz2
Buildable with MS Compiler version >= 1900
Diffstat (limited to 'cmake')
-rw-r--r--cmake/jansson_private_config.h.cmake14
1 files changed, 14 insertions, 0 deletions
diff --git a/cmake/jansson_private_config.h.cmake b/cmake/jansson_private_config.h.cmake
index ee1078f..ac7318f 100644
--- a/cmake/jansson_private_config.h.cmake
+++ b/cmake/jansson_private_config.h.cmake
@@ -49,6 +49,20 @@
#cmakedefine HAVE_SNPRINTF 1
+/* snprintf should not be defined as macro with MSC_VER >= 1900 */
+#if defined(_WIN32) || defined(WIN32)
+# if defined(_MSC_VER) /* MS compiller */
+# if (_MSC_VER < 1900) /* snprintf not introduced */
+# if !defined(snprintf)
+# define snprintf _snprintf
+# define HAVE_SNPRINTF 1 /* snprintf defined manually */
+# endif
+# else
+# define HAVE_SNPRINTF 1 /* snprintf available via sdk */
+# endif
+# endif
+#endif
+
#ifndef HAVE_SNPRINTF
# define snprintf @JSON_SNPRINTF@
#endif