That hasn't been needed since since commit 6068d3f, which changed that code to
check an env var instead ("_JSON_C_STRERROR_ENABLE").
Fixes issue #812, about dup symbols in static builds with clang.
tags/json-c-0.17-20230812
| @@ -398,7 +398,6 @@ set(JSON_C_HEADERS | |||||
| ${PROJECT_SOURCE_DIR}/json_object_private.h | ${PROJECT_SOURCE_DIR}/json_object_private.h | ||||
| ${PROJECT_SOURCE_DIR}/random_seed.h | ${PROJECT_SOURCE_DIR}/random_seed.h | ||||
| ${PROJECT_SOURCE_DIR}/strerror_override.h | ${PROJECT_SOURCE_DIR}/strerror_override.h | ||||
| ${PROJECT_SOURCE_DIR}/strerror_override_private.h | |||||
| ${PROJECT_SOURCE_DIR}/math_compat.h | ${PROJECT_SOURCE_DIR}/math_compat.h | ||||
| ${PROJECT_SOURCE_DIR}/snprintf_compat.h | ${PROJECT_SOURCE_DIR}/snprintf_compat.h | ||||
| ${PROJECT_SOURCE_DIR}/strdup_compat.h | ${PROJECT_SOURCE_DIR}/strdup_compat.h | ||||
| @@ -41,6 +41,8 @@ JSONC_PRIVATE { | |||||
| printbuf_new; | printbuf_new; | ||||
| printbuf_reset; | printbuf_reset; | ||||
| sprintbuf; | sprintbuf; | ||||
| # Used by tests: | |||||
| _json_c_strerror; | |||||
| }; | }; | ||||
| JSONC_0.14 { | JSONC_0.14 { | ||||
| @@ -1,14 +0,0 @@ | |||||
| #ifndef __json_strerror_override_private_h__ | |||||
| #define __json_strerror_override_private_h__ | |||||
| /** | |||||
| * @file | |||||
| * @brief Do not use, json-c internal, may be changed or removed at any time. | |||||
| */ | |||||
| #include "json_types.h" | |||||
| /* Used by tests to get consistent output */ | |||||
| JSON_EXPORT int _json_c_strerror_enable; | |||||
| #endif | |||||
| @@ -44,10 +44,6 @@ endif() | |||||
| foreach(TESTNAME ${ALL_TEST_NAMES}) | foreach(TESTNAME ${ALL_TEST_NAMES}) | ||||
| add_executable(${TESTNAME} ${TESTNAME}.c) | add_executable(${TESTNAME} ${TESTNAME}.c) | ||||
| if(${TESTNAME} STREQUAL test_strerror OR ${TESTNAME} STREQUAL test_util_file) | |||||
| # For output consistency, we need _json_c_strerror() in some tests: | |||||
| target_sources(${TESTNAME} PRIVATE ../strerror_override.c) | |||||
| endif() | |||||
| add_test(NAME ${TESTNAME} COMMAND ${PROJECT_SOURCE_DIR}/tests/${TESTNAME}.test) | add_test(NAME ${TESTNAME} COMMAND ${PROJECT_SOURCE_DIR}/tests/${TESTNAME}.test) | ||||
| # XXX using the non-target_ versions of these doesn't work :( | # XXX using the non-target_ versions of these doesn't work :( | ||||
| @@ -2,7 +2,6 @@ | |||||
| #undef NDEBUG | #undef NDEBUG | ||||
| #endif | #endif | ||||
| #include "strerror_override.h" | #include "strerror_override.h" | ||||
| #include "strerror_override_private.h" | |||||
| #include <stdio.h> | #include <stdio.h> | ||||
| @@ -2,7 +2,6 @@ | |||||
| #undef NDEBUG | #undef NDEBUG | ||||
| #endif | #endif | ||||
| #include "strerror_override.h" | #include "strerror_override.h" | ||||
| #include "strerror_override_private.h" | |||||
| #ifdef WIN32 | #ifdef WIN32 | ||||
| #define WIN32_LEAN_AND_MEAN | #define WIN32_LEAN_AND_MEAN | ||||
| #include <io.h> | #include <io.h> | ||||