Debian Patches

Status for libjsoncpp/1.9.7-2

Patch Description Author Forwarded Bugs Origin Last update
0001-Prefer-shared-library-for-namespaced-target.patch Prefer shared library for namespaced target Timo Röhling <roehling@debian.org> not-needed 2025-11-11
0002-inline-std-string_view-methods-to-prevent-ABI-breaks.patch inline std::string_view methods to prevent ABI breaks
This patch completely eliminates the ABI breakage that occurs across C++ standard boundaries when using `std::string_view`.

Previously, when the library was built with C++17+, CMake would leak `JSONCPP_HAS_STRING_VIEW=1` as a PUBLIC definition. A C++11 consumer would receive this definition, attempt to parse the header, and fail with compiler errors because `std::string_view` is not available in their environment.

Conversely, if the library was built in C++11 (without `string_view` symbols), a C++17 consumer would naturally define `JSONCPP_HAS_STRING_VIEW` based on `__cplusplus` inside `value.h`. The consumer would then call the declared `string_view` methods, resulting in linker errors because the methods weren't compiled into the library.

By moving all `std::string_view` overloads directly into `value.h` as `inline` methods that delegate to the fundamental `const char*, const char*` methods:
1. The consumer's compiler dictates whether the overloads are visible (via `__cplusplus >= 201703L`).
2. The consumer compiles the inline wrappers locally, removing any reliance on the library's exported symbols for `std::string_view`.
3. CMake no longer needs to pollute the consumer's environment with PUBLIC compile definitions.
Jordan Bayles <jophba@chromium.org> not-needed vendor, https://github.com/open-source-parsers/jsoncpp/pull/1675 2026-05-06

All known versions for source package 'libjsoncpp'

Links