mirror of
https://github.com/open-source-parsers/jsoncpp.git
synced 2025-10-10 17:43:46 +02:00
Add new JSON_USE_NULLREF flag
This patch adds a new flag, JSON_USE_NULLREF, which removes the legacy singletons null, nullRef for consumers that require not having static initialized globals, like Chromium.
This commit is contained in:
@@ -30,6 +30,11 @@
|
||||
#define JSON_USE_EXCEPTION 1
|
||||
#endif
|
||||
|
||||
// Temporary, tracked for removal with issue #982.
|
||||
#ifndef JSON_USE_NULLREF
|
||||
#define JSON_USE_NULLREF 1
|
||||
#endif
|
||||
|
||||
/// If defined, indicates that the source file is amalgamated
|
||||
/// to prevent private header inclusion.
|
||||
/// Remarks: it is automatically defined in the generated amalgamated header.
|
||||
|
@@ -193,11 +193,14 @@ public:
|
||||
// Required for boost integration, e. g. BOOST_TEST
|
||||
typedef std::string value_type;
|
||||
|
||||
static const Value& null; ///< We regret this reference to a global instance;
|
||||
///< prefer the simpler Value().
|
||||
static const Value& nullRef; ///< just a kludge for binary-compatibility; same
|
||||
///< as null
|
||||
static Value const& nullSingleton(); ///< Prefer this to null or nullRef.
|
||||
#if JSON_USE_NULLREF
|
||||
// Binary compatibility kludges, do not use.
|
||||
static const Value& null;
|
||||
static const Value& nullRef;
|
||||
#endif
|
||||
|
||||
// null and nullRef are deprecated, use this instead.
|
||||
static Value const& nullSingleton();
|
||||
|
||||
/// Minimum signed integer value that can be stored in a Json::Value.
|
||||
static const LargestInt minLargestInt;
|
||||
|
Reference in New Issue
Block a user