From 853333cd709cc063e4f97418c1297f9c83e48d41 Mon Sep 17 00:00:00 2001 From: Arseny Kapoulkine Date: Thu, 22 Jun 2017 20:28:06 -0700 Subject: Use PUGI__MSVC_CRT_VERSION instead of _MSC_VER It's not clear whether we still need PUGI__MSVC_CRT_VERSION, but it's more consistent for now to use it for _snprintf_s since this is relying on a CRT extension, not on a compiler feature. --- src/pugixml.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pugixml.cpp b/src/pugixml.cpp index e047822..da4ecf9 100644 --- a/src/pugixml.cpp +++ b/src/pugixml.cpp @@ -130,7 +130,7 @@ using std::memset; // Not all platforms have snprintf; we define a wrapper that uses snprintf if possible. This only works with buffers with a known size. #if __cplusplus >= 201103 # define PUGI__SNPRINTF(buf, ...) snprintf(buf, sizeof(buf), __VA_ARGS__) -#elif defined(_MSC_VER) && _MSC_VER >= 1400 +#elif defined(PUGI__MSVC_CRT_VERSION) && PUGI__MSVC_CRT_VERSION >= 1400 # define PUGI__SNPRINTF(buf, ...) _snprintf_s(buf, _countof(buf), _TRUNCATE, __VA_ARGS__) #else # define PUGI__SNPRINTF sprintf -- cgit v1.2.3