From 18c3ed39412e6b8c4c841b8bda60d3dfadd5b362 Mon Sep 17 00:00:00 2001 From: Alex Fabijanic Date: Thu, 9 Nov 2017 07:04:27 -0600 Subject: [PATCH] change json_error_s into function --- JSON/src/pd_json.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/JSON/src/pd_json.c b/JSON/src/pd_json.c index f8ebe0214..48e4467fa 100644 --- a/JSON/src/pd_json.c +++ b/JSON/src/pd_json.c @@ -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