Debian Patches

Status for libjsoncpp/1.9.7-4

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
1685.patch [PATCH 1/2] fix: GCC 16 / C++20 build failure with u8 string literals (#1684)

In C++20, the `u8""` string literal prefix was changed to evaluate to `const char8_t[]` instead of `const char[]`. This caused compilation errors when these literals were implicitly converted to `std::string` or passed to functions expecting `const char*`.

This commit adds `reinterpret_cast<const char*>` around the `u8` string literals in the test suite to resolve the build errors while maintaining the intended UTF-8 semantics.

Additionally, this adds C++20 to the GitHub Actions CMake test matrix to ensure we don't regress on newer standards.

Fixes #1684
Jordan Bayles <jophba@chromium.org> no 2026-05-14

All known versions for source package 'libjsoncpp'

Links