diff options
| author | Mark Rowe <mark@vector35.com> | 2026-02-06 00:47:19 -0800 |
|---|---|---|
| committer | Mark Rowe <mark@vector35.com> | 2026-04-15 12:46:37 -0700 |
| commit | 6c34643b639607d7c0a652300bbdbc261fbe2388 (patch) | |
| tree | c9709bb2da6950d9335878958422e733878287e8 /json/json-forwards.h | |
| parent | 877b01ac02ca4e63b0cacbef4f641b73f7d6298e (diff) | |
Compile jsoncpp into a different namespace when building as part of core
This allows it to be compiled into statically linked builds without
causing ODR violations.
Diffstat (limited to 'json/json-forwards.h')
| -rw-r--r-- | json/json-forwards.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/json/json-forwards.h b/json/json-forwards.h index 4dad2056..159df166 100644 --- a/json/json-forwards.h +++ b/json/json-forwards.h @@ -79,6 +79,14 @@ license you like. /// to prevent private header inclusion. #define JSON_IS_AMALGAMATION +#ifdef BINARYNINJACORE_LIBRARY +#define JSONCPP_INLINE_NS_BEGIN inline namespace Core { +#define JSONCPP_INLINE_NS_END } +#else +#define JSONCPP_INLINE_NS_BEGIN +#define JSONCPP_INLINE_NS_END +#endif + // ////////////////////////////////////////////////////////////////////// // Beginning of content of file: include/json/config.h // ////////////////////////////////////////////////////////////////////// @@ -243,6 +251,7 @@ license you like. #endif // if !defined(JSON_IS_AMALGAMATION) namespace Json { +JSONCPP_INLINE_NS_BEGIN typedef int Int; typedef unsigned int UInt; #if defined(JSON_NO_INT64) @@ -280,6 +289,7 @@ typedef UInt64 LargestUInt; #define JSONCPP_ISTRINGSTREAM std::istringstream #define JSONCPP_ISTREAM std::istream #endif // if JSONCPP_USING_SECURE_MEMORY +JSONCPP_INLINE_NS_END } // end namespace Json #endif // JSON_CONFIG_H_INCLUDED @@ -310,6 +320,7 @@ typedef UInt64 LargestUInt; #endif // if !defined(JSON_IS_AMALGAMATION) namespace Json { +JSONCPP_INLINE_NS_BEGIN // writer.h class FastWriter; @@ -331,6 +342,7 @@ class ValueIteratorBase; class ValueIterator; class ValueConstIterator; +JSONCPP_INLINE_NS_END } // namespace Json #endif // JSON_FORWARDS_H_INCLUDED |
