mirror of
https://github.com/pocoproject/poco.git
synced 2025-03-30 23:51:34 +02:00
use _snprintf_s on VS < 2015
This commit is contained in:
parent
1bc210dcf9
commit
6bcd362c74
@ -164,6 +164,12 @@
|
|||||||
#elif (_MSC_VER >= 1800) && (_MSC_VER < 1900) // Visual Studio 2013, MSVC++ 12.0
|
#elif (_MSC_VER >= 1800) && (_MSC_VER < 1900) // Visual Studio 2013, MSVC++ 12.0
|
||||||
#define POCO_MSVS_VERSION 2013
|
#define POCO_MSVS_VERSION 2013
|
||||||
#define POCO_MSVC_VERSION 120
|
#define POCO_MSVC_VERSION 120
|
||||||
|
#elif (_MSC_VER >= 1900) && (_MSC_VER < 1910) // Visual Studio 2015, MSVC++ 14.0
|
||||||
|
#define POCO_MSVS_VERSION 2015
|
||||||
|
#define POCO_MSVC_VERSION 140
|
||||||
|
#elif (_MSC_VER >= 1910) && (_MSC_VER < 2000) // Visual Studio 2017, MSVC++ 14.1
|
||||||
|
#define POCO_MSVS_VERSION 2017
|
||||||
|
#define POCO_MSVC_VERSION 141
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
@ -8,15 +8,30 @@
|
|||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include "pd_json.h"
|
#include "pd_json.h"
|
||||||
|
|
||||||
|
#if defined(_MSC_VER) && (_MSC_VER < 1900)
|
||||||
|
|
||||||
|
#define json_error(json, format, ...) \
|
||||||
|
if (!json->error) { \
|
||||||
|
json->error = 1; \
|
||||||
|
_snprintf_s(json->errmsg, sizeof(json->errmsg), _TRUNCATE, \
|
||||||
|
"error: %lu: " format, \
|
||||||
|
(unsigned long) json->lineno, \
|
||||||
|
__VA_ARGS__); \
|
||||||
|
} \
|
||||||
|
|
||||||
|
#else
|
||||||
|
|
||||||
#define json_error(json, format, ...) \
|
#define json_error(json, format, ...) \
|
||||||
if (!json->error) { \
|
if (!json->error) { \
|
||||||
json->error = 1; \
|
json->error = 1; \
|
||||||
_snprintf(json->errmsg, sizeof(json->errmsg), \
|
snprintf(json->errmsg, sizeof(json->errmsg), \
|
||||||
"error: %lu: " format, \
|
"error: %lu: " format, \
|
||||||
(unsigned long) json->lineno, \
|
(unsigned long) json->lineno, \
|
||||||
__VA_ARGS__); \
|
__VA_ARGS__); \
|
||||||
} \
|
} \
|
||||||
|
|
||||||
|
#endif // POCO_MSVS_VERSION
|
||||||
|
|
||||||
#define STACK_INC 4
|
#define STACK_INC 4
|
||||||
|
|
||||||
static enum json_type
|
static enum json_type
|
||||||
|
Loading…
x
Reference in New Issue
Block a user