change json_error_s into function

This commit is contained in:
Alex Fabijanic 2017-11-09 07:04:27 -06:00
parent 94ef939f93
commit 18c3ed3941

View File

@ -36,14 +36,12 @@
#endif // POCO_MSVS_VERSION
#if defined(_GNU_SOURCE) || defined(_POSIX_C_SOURCE) && (_POSIX_C_SOURCE < 200112L)
#define json_error_s(json, err) char errbuf[1024] = { 0 }; \
json_error(json, "%s", strerror_r(err, errbuf, sizeof(errbuf)));
#else
#define json_error_s(json, err) char errbuf[1024] = { 0 }; \
strerror_r(err, errbuf, sizeof(errbuf)); \
json_error(json, "%s", errbuf);
#endif
static void json_error_s(json_stream *json, int err)
{
char errbuf[1024] = {0};
strerror_r(err, errbuf, sizeof(errbuf));
json_error(json, "%s", errbuf);
}
#define STACK_INC 4