1
0
mirror of https://github.com/OlafvdSpek/ctemplate.git synced 2025-09-28 19:05:49 +08:00

Don't define snprintf and va_copy for VS2015.

This commit is contained in:
Olaf van der Spek 2016-05-29 12:14:20 +02:00
parent f63420c39f
commit b890ce2f55
2 changed files with 2 additions and 2 deletions

View File

@ -42,7 +42,7 @@
#include "port.h"
// These call the windows _vsnprintf, but always NUL-terminate.
#if !defined(__MINGW32__) && !defined(__MINGW64__) /* mingw already defines */
#if !defined(__MINGW32__) && !defined(__MINGW64__) && (!defined(_MSC_VER) || _MSC_VER < 1900) /* mingw already defines */
int safe_vsnprintf(char *str, size_t size, const char *format, va_list ap) {
if (size == 0) // not even room for a \0?
return -1; // not what C99 says to do, but what windows does

View File

@ -100,7 +100,7 @@
* because they don't always NUL-terminate. :-( We also can't use the
* name vsnprintf, since windows defines that (but not snprintf (!)).
*/
#if !defined(__MINGW32__) && !defined(__MINGW64__) /* mingw already defines */
#if !defined(__MINGW32__) && !defined(__MINGW64__) && (!defined(_MSC_VER) || _MSC_VER < 1900) /* mingw already defines */
extern CTEMPLATE_DLL_DECL int snprintf(char *str, size_t size,
const char *format, ...);
extern int CTEMPLATE_DLL_DECL safe_vsnprintf(char *str, size_t size,