From 21b2dfa944d1e5a58b79a030bf0f203bd46e224e Mon Sep 17 00:00:00 2001 From: Alex Fabijanic Date: Wed, 8 Nov 2017 17:51:59 -0600 Subject: [PATCH 1/3] replace strerror --- JSON/src/pd_json.c | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/JSON/src/pd_json.c b/JSON/src/pd_json.c index 92e7591b7..f8ebe0214 100644 --- a/JSON/src/pd_json.c +++ b/JSON/src/pd_json.c @@ -8,6 +8,10 @@ #include #include "pd_json.h" +#if defined(_MSC_VER) +#define strerror_r(err, buf, len) strerror_s(buf, len, err) +#endif + #if defined(_MSC_VER) && (_MSC_VER < 1900) #define json_error(json, format, ...) \ @@ -32,6 +36,15 @@ #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 + #define STACK_INC 4 static enum json_type @@ -44,7 +57,7 @@ push(json_stream *json, enum json_type type) stack = (struct json_stack *) json->alloc.realloc(json->stack, (json->stack_size + STACK_INC) * sizeof(*json->stack)); if (stack == NULL) { - json_error(json, "%s", strerror(errno)); + json_error_s(json, errno); return JSON_ERROR; } @@ -141,7 +154,7 @@ static int pushchar(json_stream *json, int c) size_t size = json->data.string_size * 2; char *buffer = (char*) json->alloc.realloc(json->data.string, size); if (buffer == NULL) { - json_error(json, "%s", strerror(errno)); + json_error_s(json, errno); return -1; } else { json->data.string_size = size; @@ -159,7 +172,7 @@ static int init_string(json_stream *json) json->data.string_size = 1024; json->data.string = (char*) json->alloc.malloc(json->data.string_size); if (json->data.string == NULL) { - json_error(json, "%s", strerror(errno)); + json_error_s(json, errno); return -1; } } From 94ef939f930ec87bd5ad8d38a7b7189a15310fe9 Mon Sep 17 00:00:00 2001 From: Alex Fabijanic Date: Wed, 8 Nov 2017 17:53:40 -0600 Subject: [PATCH 2/3] remove _CRT_SECURE_NO_WARNINGS from JSON.progen and regenerate JSON VS projects --- JSON/JSON.progen | 2 +- JSON/JSON_CE_vs90.vcproj | 4 ++-- JSON/JSON_WEC2013_vs110.vcxproj.filters | 4 ++-- JSON/JSON_vs100.vcxproj | 4 ++-- JSON/JSON_vs100.vcxproj.filters | 4 ++-- JSON/JSON_vs110.vcxproj | 4 ++-- JSON/JSON_vs110.vcxproj.filters | 4 ++-- JSON/JSON_vs140.vcxproj | 4 ++-- JSON/JSON_vs140.vcxproj.filters | 4 ++-- JSON/JSON_vs150.vcxproj | 6 +++--- JSON/JSON_vs150.vcxproj.filters | 4 ++-- JSON/JSON_vs90.vcproj | 4 ++-- JSON/JSON_x64_vs100.vcxproj | 4 ++-- JSON/JSON_x64_vs100.vcxproj.filters | 4 ++-- JSON/JSON_x64_vs110.vcxproj | 4 ++-- JSON/JSON_x64_vs110.vcxproj.filters | 4 ++-- JSON/JSON_x64_vs140.vcxproj | 4 ++-- JSON/JSON_x64_vs140.vcxproj.filters | 4 ++-- JSON/JSON_x64_vs150.vcxproj | 6 +++--- JSON/JSON_x64_vs150.vcxproj.filters | 4 ++-- JSON/JSON_x64_vs90.vcproj | 4 ++-- 21 files changed, 43 insertions(+), 43 deletions(-) diff --git a/JSON/JSON.progen b/JSON/JSON.progen index a41ecf80d..1de7a7f5c 100644 --- a/JSON/JSON.progen +++ b/JSON/JSON.progen @@ -9,7 +9,7 @@ vc.project.configurations = debug_shared, release_shared, debug_static_mt, relea vc.project.prototype = ${vc.project.name}_vs90.vcproj vc.project.compiler.include = ..\\Foundation\\include vc.project.compiler.defines = -vc.project.compiler.defines.shared = ${vc.project.name}_EXPORTS;_CRT_SECURE_NO_WARNINGS +vc.project.compiler.defines.shared = ${vc.project.name}_EXPORTS vc.project.compiler.defines.debug_shared = ${vc.project.compiler.defines.shared} vc.project.compiler.defines.release_shared = ${vc.project.compiler.defines.shared} vc.solution.create = true diff --git a/JSON/JSON_CE_vs90.vcproj b/JSON/JSON_CE_vs90.vcproj index d5f56abb5..083e0e117 100644 --- a/JSON/JSON_CE_vs90.vcproj +++ b/JSON/JSON_CE_vs90.vcproj @@ -34,7 +34,7 @@ ExecutionBucket="7" Optimization="0" AdditionalIncludeDirectories=".\include;..\Foundation\include" - PreprocessorDefinitions="_DEBUG;_WIN32_WCE=$(CEVER);UNDER_CE;WINCE;$(ARCHFAM);$(_ARCHFAM_);_UNICODE;UNICODE;$(ProjectName)_EXPORTS;_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;JSON_EXPORTS;_CRT_SECURE_NO_WARNINGS" + PreprocessorDefinitions="_DEBUG;_WIN32_WCE=$(CEVER);UNDER_CE;WINCE;$(ARCHFAM);$(_ARCHFAM_);_UNICODE;UNICODE;$(ProjectName)_EXPORTS;_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;JSON_EXPORTS" StringPooling="true" MinimalRebuild="false" RuntimeLibrary="3" @@ -114,7 +114,7 @@ EnableIntrinsicFunctions="true" FavorSizeOrSpeed="1" AdditionalIncludeDirectories=".\include;..\Foundation\include" - PreprocessorDefinitions="NDEBUG;_WIN32_WCE=$(CEVER);UNDER_CE;WINCE;$(ARCHFAM);$(_ARCHFAM_);_UNICODE;UNICODE;$(ProjectName)_EXPORTS;_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;JSON_EXPORTS;_CRT_SECURE_NO_WARNINGS" + PreprocessorDefinitions="NDEBUG;_WIN32_WCE=$(CEVER);UNDER_CE;WINCE;$(ARCHFAM);$(_ARCHFAM_);_UNICODE;UNICODE;$(ProjectName)_EXPORTS;_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;JSON_EXPORTS" StringPooling="true" MinimalRebuild="false" RuntimeLibrary="2" diff --git a/JSON/JSON_WEC2013_vs110.vcxproj.filters b/JSON/JSON_WEC2013_vs110.vcxproj.filters index ff3e4f006..83ac3fe65 100644 --- a/JSON/JSON_WEC2013_vs110.vcxproj.filters +++ b/JSON/JSON_WEC2013_vs110.vcxproj.filters @@ -2,10 +2,10 @@ - {337fac4a-f3d4-4ae9-9f14-9667a075cda5} + {7ca2e91f-4851-40fb-b147-aaf03976123b} - {4d205a9a-351d-49e3-8a54-afed5df67f23} + {d58c03fb-ed20-4c25-b937-5b60f5fe9e45} diff --git a/JSON/JSON_vs100.vcxproj b/JSON/JSON_vs100.vcxproj index 53e26adcf..1dd16ea64 100644 --- a/JSON/JSON_vs100.vcxproj +++ b/JSON/JSON_vs100.vcxproj @@ -105,7 +105,7 @@ Disabled .\include;..\Foundation\include;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_WINDOWS;_USRDLL;JSON_EXPORTS;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + WIN32;_DEBUG;_WINDOWS;_USRDLL;JSON_EXPORTS;%(PreprocessorDefinitions) true true EnableFastChecks @@ -142,7 +142,7 @@ Speed true .\include;..\Foundation\include;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_WINDOWS;_USRDLL;JSON_EXPORTS;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + WIN32;NDEBUG;_WINDOWS;_USRDLL;JSON_EXPORTS;%(PreprocessorDefinitions) true MultiThreadedDLL false diff --git a/JSON/JSON_vs100.vcxproj.filters b/JSON/JSON_vs100.vcxproj.filters index 6a2d9d202..a5996bfc1 100644 --- a/JSON/JSON_vs100.vcxproj.filters +++ b/JSON/JSON_vs100.vcxproj.filters @@ -2,10 +2,10 @@ - {041b8d3a-67ce-4ef5-aaa1-ad1d20794ec4} + {9e86c99a-9097-4948-b98b-075743aa8a0c} - {9d4e9bc2-f859-4f92-a54c-2d19fed810cf} + {31646366-de65-4105-89b4-75b878b6529f} diff --git a/JSON/JSON_vs110.vcxproj b/JSON/JSON_vs110.vcxproj index 0961ec0ad..e563f955e 100644 --- a/JSON/JSON_vs110.vcxproj +++ b/JSON/JSON_vs110.vcxproj @@ -123,7 +123,7 @@ Disabled .\include;..\Foundation\include;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_WINDOWS;_USRDLL;JSON_EXPORTS;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + WIN32;_DEBUG;_WINDOWS;_USRDLL;JSON_EXPORTS;%(PreprocessorDefinitions) true true EnableFastChecks @@ -156,7 +156,7 @@ Speed true .\include;..\Foundation\include;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_WINDOWS;_USRDLL;JSON_EXPORTS;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + WIN32;NDEBUG;_WINDOWS;_USRDLL;JSON_EXPORTS;%(PreprocessorDefinitions) true MultiThreadedDLL false diff --git a/JSON/JSON_vs110.vcxproj.filters b/JSON/JSON_vs110.vcxproj.filters index 0ec33ef72..300ced88e 100644 --- a/JSON/JSON_vs110.vcxproj.filters +++ b/JSON/JSON_vs110.vcxproj.filters @@ -2,10 +2,10 @@ - {69634a2a-5bfa-411b-b554-6f4916cc19a4} + {1a2ecba3-07fd-4f04-a2c2-92e51ca5aff0} - {61eb6c4b-fed2-45cb-9178-753e60fd8592} + {36496190-eb12-4b93-8edf-05456e47185e} diff --git a/JSON/JSON_vs140.vcxproj b/JSON/JSON_vs140.vcxproj index 38db49bd8..0cd6748d9 100644 --- a/JSON/JSON_vs140.vcxproj +++ b/JSON/JSON_vs140.vcxproj @@ -123,7 +123,7 @@ Disabled .\include;..\Foundation\include;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_WINDOWS;_USRDLL;JSON_EXPORTS;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + WIN32;_DEBUG;_WINDOWS;_USRDLL;JSON_EXPORTS;%(PreprocessorDefinitions) true true EnableFastChecks @@ -156,7 +156,7 @@ Speed true .\include;..\Foundation\include;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_WINDOWS;_USRDLL;JSON_EXPORTS;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + WIN32;NDEBUG;_WINDOWS;_USRDLL;JSON_EXPORTS;%(PreprocessorDefinitions) true MultiThreadedDLL false diff --git a/JSON/JSON_vs140.vcxproj.filters b/JSON/JSON_vs140.vcxproj.filters index 2fd141a39..7e267ab7b 100644 --- a/JSON/JSON_vs140.vcxproj.filters +++ b/JSON/JSON_vs140.vcxproj.filters @@ -2,10 +2,10 @@ - {d2310028-1107-43a3-aa53-b59049980845} + {999f1d5e-0ee9-4b07-bc25-fda02a2aaf0e} - {bab99a54-e8b9-4225-83ec-9ea797b00123} + {2abee5d5-0e55-4fab-8d7c-eba4e91ae893} diff --git a/JSON/JSON_vs150.vcxproj b/JSON/JSON_vs150.vcxproj index 2add216ba..6d1a83217 100644 --- a/JSON/JSON_vs150.vcxproj +++ b/JSON/JSON_vs150.vcxproj @@ -85,7 +85,7 @@ - <_ProjectFileVersion>15.0.26228.10 + <_ProjectFileVersion>15.0.26919.1 PocoJSONd PocoJSONmdd PocoJSONmtd @@ -123,7 +123,7 @@ Disabled .\include;..\Foundation\include;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_WINDOWS;_USRDLL;JSON_EXPORTS;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + WIN32;_DEBUG;_WINDOWS;_USRDLL;JSON_EXPORTS;%(PreprocessorDefinitions) true true EnableFastChecks @@ -156,7 +156,7 @@ Speed true .\include;..\Foundation\include;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_WINDOWS;_USRDLL;JSON_EXPORTS;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + WIN32;NDEBUG;_WINDOWS;_USRDLL;JSON_EXPORTS;%(PreprocessorDefinitions) true MultiThreadedDLL false diff --git a/JSON/JSON_vs150.vcxproj.filters b/JSON/JSON_vs150.vcxproj.filters index 5b07d1fb8..c68ebec3e 100644 --- a/JSON/JSON_vs150.vcxproj.filters +++ b/JSON/JSON_vs150.vcxproj.filters @@ -2,10 +2,10 @@ - {eaf5d420-116e-47d8-815f-b6a9ed4f5040} + {8b425bb7-fb55-4ffb-9dd2-6ccc238f9a33} - {d2119fd7-5f38-4f12-bbc6-e6c28c25cbfa} + {08805c4e-6465-4f4a-9e55-35e72b0262eb} diff --git a/JSON/JSON_vs90.vcproj b/JSON/JSON_vs90.vcproj index c323b04f5..5a124f9d8 100644 --- a/JSON/JSON_vs90.vcproj +++ b/JSON/JSON_vs90.vcproj @@ -32,7 +32,7 @@ Name="VCCLCompilerTool" Optimization="0" AdditionalIncludeDirectories=".\include;..\Foundation\include" - PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;JSON_EXPORTS;_CRT_SECURE_NO_WARNINGS" + PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;JSON_EXPORTS" StringPooling="true" MinimalRebuild="true" BasicRuntimeChecks="3" @@ -106,7 +106,7 @@ FavorSizeOrSpeed="1" OmitFramePointers="true" AdditionalIncludeDirectories=".\include;..\Foundation\include" - PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;JSON_EXPORTS;_CRT_SECURE_NO_WARNINGS" + PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;JSON_EXPORTS" StringPooling="true" RuntimeLibrary="2" BufferSecurityCheck="false" diff --git a/JSON/JSON_x64_vs100.vcxproj b/JSON/JSON_x64_vs100.vcxproj index a78d9186d..aa6611f48 100644 --- a/JSON/JSON_x64_vs100.vcxproj +++ b/JSON/JSON_x64_vs100.vcxproj @@ -105,7 +105,7 @@ Disabled .\include;..\Foundation\include;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_WINDOWS;_USRDLL;JSON_EXPORTS;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + WIN32;_DEBUG;_WINDOWS;_USRDLL;JSON_EXPORTS;%(PreprocessorDefinitions) true true EnableFastChecks @@ -142,7 +142,7 @@ Speed true .\include;..\Foundation\include;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_WINDOWS;_USRDLL;JSON_EXPORTS;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + WIN32;NDEBUG;_WINDOWS;_USRDLL;JSON_EXPORTS;%(PreprocessorDefinitions) true MultiThreadedDLL false diff --git a/JSON/JSON_x64_vs100.vcxproj.filters b/JSON/JSON_x64_vs100.vcxproj.filters index 80f5ef949..a74acef1d 100644 --- a/JSON/JSON_x64_vs100.vcxproj.filters +++ b/JSON/JSON_x64_vs100.vcxproj.filters @@ -2,10 +2,10 @@ - {49545bfe-a20a-45d4-9b2a-cd7e69fe8e12} + {88007ac3-a8b4-480c-836f-e3f2c1287217} - {270b75c6-5259-41f6-b8e2-2b7edfe8ad4e} + {aee6ec45-076f-4b2b-8962-ed943ea63bb0} diff --git a/JSON/JSON_x64_vs110.vcxproj b/JSON/JSON_x64_vs110.vcxproj index ae8d4be24..ee9bbe50d 100644 --- a/JSON/JSON_x64_vs110.vcxproj +++ b/JSON/JSON_x64_vs110.vcxproj @@ -123,7 +123,7 @@ Disabled .\include;..\Foundation\include;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_WINDOWS;_USRDLL;JSON_EXPORTS;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + WIN32;_DEBUG;_WINDOWS;_USRDLL;JSON_EXPORTS;%(PreprocessorDefinitions) true true EnableFastChecks @@ -156,7 +156,7 @@ Speed true .\include;..\Foundation\include;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_WINDOWS;_USRDLL;JSON_EXPORTS;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + WIN32;NDEBUG;_WINDOWS;_USRDLL;JSON_EXPORTS;%(PreprocessorDefinitions) true MultiThreadedDLL false diff --git a/JSON/JSON_x64_vs110.vcxproj.filters b/JSON/JSON_x64_vs110.vcxproj.filters index a2b27d51e..cda532863 100644 --- a/JSON/JSON_x64_vs110.vcxproj.filters +++ b/JSON/JSON_x64_vs110.vcxproj.filters @@ -2,10 +2,10 @@ - {f83a409c-fc8e-45f5-9688-8ead00f2169d} + {27eb28f7-43fe-43b9-9b04-cd5fe32a1ed6} - {6d4235ea-23a5-47a5-a51e-4f4e41456129} + {117138ab-6eb7-483e-b2c1-d28f5b01b60d} diff --git a/JSON/JSON_x64_vs140.vcxproj b/JSON/JSON_x64_vs140.vcxproj index c85efd6be..68bbd7fba 100644 --- a/JSON/JSON_x64_vs140.vcxproj +++ b/JSON/JSON_x64_vs140.vcxproj @@ -123,7 +123,7 @@ Disabled .\include;..\Foundation\include;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_WINDOWS;_USRDLL;JSON_EXPORTS;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + WIN32;_DEBUG;_WINDOWS;_USRDLL;JSON_EXPORTS;%(PreprocessorDefinitions) true true EnableFastChecks @@ -156,7 +156,7 @@ Speed true .\include;..\Foundation\include;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_WINDOWS;_USRDLL;JSON_EXPORTS;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + WIN32;NDEBUG;_WINDOWS;_USRDLL;JSON_EXPORTS;%(PreprocessorDefinitions) true MultiThreadedDLL false diff --git a/JSON/JSON_x64_vs140.vcxproj.filters b/JSON/JSON_x64_vs140.vcxproj.filters index 85f5f4e85..071ff1244 100644 --- a/JSON/JSON_x64_vs140.vcxproj.filters +++ b/JSON/JSON_x64_vs140.vcxproj.filters @@ -2,10 +2,10 @@ - {d6ab9586-3599-4b69-b7ef-d66c96404669} + {e2e51999-1855-4980-99bd-6859cc12eeb4} - {e4225b0c-64e7-4ee6-a77a-0c7b9050578a} + {1f145d26-cb6a-4e88-8838-47713f535ee0} diff --git a/JSON/JSON_x64_vs150.vcxproj b/JSON/JSON_x64_vs150.vcxproj index 96cf32f6b..342a8d6eb 100644 --- a/JSON/JSON_x64_vs150.vcxproj +++ b/JSON/JSON_x64_vs150.vcxproj @@ -85,7 +85,7 @@ - <_ProjectFileVersion>15.0.26228.10 + <_ProjectFileVersion>15.0.26919.1 PocoJSON64d PocoJSONmdd PocoJSONmtd @@ -123,7 +123,7 @@ Disabled .\include;..\Foundation\include;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_WINDOWS;_USRDLL;JSON_EXPORTS;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + WIN32;_DEBUG;_WINDOWS;_USRDLL;JSON_EXPORTS;%(PreprocessorDefinitions) true true EnableFastChecks @@ -156,7 +156,7 @@ Speed true .\include;..\Foundation\include;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_WINDOWS;_USRDLL;JSON_EXPORTS;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + WIN32;NDEBUG;_WINDOWS;_USRDLL;JSON_EXPORTS;%(PreprocessorDefinitions) true MultiThreadedDLL false diff --git a/JSON/JSON_x64_vs150.vcxproj.filters b/JSON/JSON_x64_vs150.vcxproj.filters index e7cae7b3d..51bbf68dc 100644 --- a/JSON/JSON_x64_vs150.vcxproj.filters +++ b/JSON/JSON_x64_vs150.vcxproj.filters @@ -2,10 +2,10 @@ - {f260b17e-44d9-4181-9130-0c3117638ea1} + {2e67adac-6d6d-42fe-bca1-56a21f5c7e36} - {cd9124b6-1e5f-44fa-824a-80ce45895b68} + {5503d879-b367-4924-8fe0-e77cb4e05a00} diff --git a/JSON/JSON_x64_vs90.vcproj b/JSON/JSON_x64_vs90.vcproj index 5e6b299f6..f79f7e114 100644 --- a/JSON/JSON_x64_vs90.vcproj +++ b/JSON/JSON_x64_vs90.vcproj @@ -32,7 +32,7 @@ Name="VCCLCompilerTool" Optimization="0" AdditionalIncludeDirectories=".\include;..\Foundation\include" - PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;JSON_EXPORTS;_CRT_SECURE_NO_WARNINGS" + PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;JSON_EXPORTS" StringPooling="true" MinimalRebuild="true" BasicRuntimeChecks="3" @@ -106,7 +106,7 @@ FavorSizeOrSpeed="1" OmitFramePointers="true" AdditionalIncludeDirectories=".\include;..\Foundation\include" - PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;JSON_EXPORTS;_CRT_SECURE_NO_WARNINGS" + PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;JSON_EXPORTS" StringPooling="true" RuntimeLibrary="2" BufferSecurityCheck="false" From 18c3ed39412e6b8c4c841b8bda60d3dfadd5b362 Mon Sep 17 00:00:00 2001 From: Alex Fabijanic Date: Thu, 9 Nov 2017 07:04:27 -0600 Subject: [PATCH 3/3] 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