mirror of
https://github.com/nlohmann/json.git
synced 2026-10-17 11:38:14 +00:00
Add ABI tags for JSON_DISABLE_STREAM_BULK_SCAN and JSON_DISABLE_UNLOCKED_FILE_IO
Both macros select between two definitions of an input adapter, so translation units compiled with different settings violated the ODR when linked together. Like the other ABI-affecting macros, they now append a tag to the inline namespace: _dsbs and _dufio. Their defaults move to abi_macros.hpp so that json_fwd.hpp sees them, and the natvis file is regenerated for the new namespaces. Signed-off-by: Niels Lohmann <mail@nlohmann.me>
This commit is contained in:
13 files changed
+113783
-46
No files matched your search
@@ -21,7 +21,9 @@ foreach(test default noversion)
|
||||
target_compile_definitions(abi_config_${test}_all_tags PRIVATE
|
||||
JSON_DIAGNOSTICS=1
|
||||
JSON_DIAGNOSTIC_POSITIONS=1
|
||||
JSON_USE_LEGACY_DISCARDED_VALUE_COMPARISON=1)
|
||||
JSON_USE_LEGACY_DISCARDED_VALUE_COMPARISON=1
|
||||
JSON_DISABLE_STREAM_BULK_SCAN=1
|
||||
JSON_DISABLE_UNLOCKED_FILE_IO=1)
|
||||
target_link_libraries(abi_config_${test}_all_tags PRIVATE abi_compat_main)
|
||||
add_test(
|
||||
NAME test-abi_config_${test}_all_tags
|
||||
|
||||
@@ -52,6 +52,14 @@ TEST_CASE("default namespace")
|
||||
expected += "_ekmo";
|
||||
#endif
|
||||
|
||||
#if JSON_DISABLE_STREAM_BULK_SCAN
|
||||
expected += "_dsbs";
|
||||
#endif
|
||||
|
||||
#if JSON_DISABLE_UNLOCKED_FILE_IO
|
||||
expected += "_dufio";
|
||||
#endif
|
||||
|
||||
expected += "_v" STRINGIZE(NLOHMANN_JSON_VERSION_MAJOR);
|
||||
expected += "_" STRINGIZE(NLOHMANN_JSON_VERSION_MINOR);
|
||||
expected += "_" STRINGIZE(NLOHMANN_JSON_VERSION_PATCH) "::basic_json";
|
||||
|
||||
@@ -53,6 +53,14 @@ TEST_CASE("default namespace without version component")
|
||||
expected += "_ekmo";
|
||||
#endif
|
||||
|
||||
#if JSON_DISABLE_STREAM_BULK_SCAN
|
||||
expected += "_dsbs";
|
||||
#endif
|
||||
|
||||
#if JSON_DISABLE_UNLOCKED_FILE_IO
|
||||
expected += "_dufio";
|
||||
#endif
|
||||
|
||||
expected += "::basic_json";
|
||||
|
||||
// fallback for Clang
|
||||
|
||||
Reference in new issue
Block a user