mirror of
https://github.com/pocoproject/poco.git
synced 2025-10-23 16:48:06 +02:00
use _snprintf_s on VS < 2015
This commit is contained in:
@@ -8,15 +8,30 @@
|
||||
#include <errno.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, ...) \
|
||||
if (!json->error) { \
|
||||
json->error = 1; \
|
||||
_snprintf(json->errmsg, sizeof(json->errmsg), \
|
||||
snprintf(json->errmsg, sizeof(json->errmsg), \
|
||||
"error: %lu: " format, \
|
||||
(unsigned long) json->lineno, \
|
||||
__VA_ARGS__); \
|
||||
} \
|
||||
|
||||
#endif // POCO_MSVS_VERSION
|
||||
|
||||
#define STACK_INC 4
|
||||
|
||||
static enum json_type
|
||||
|
Reference in New Issue
Block a user