Skip to content

Commit 0a01f3d

Browse files
committed
Do not reference SecureAllocator when not JSONCPP_USING_SECURE_MEMORY
Amalgamated version of jsoncpp does not include allocator.h and as a result doesn't have definition of SecureAllocator and results in compilation error when referencing SecureAllocator in config.h
1 parent 2b593a9 commit 0a01f3d

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

Diff for: include/json/config.h

+6-3
Original file line numberDiff line numberDiff line change
@@ -173,10 +173,13 @@ typedef UInt64 LargestUInt;
173173
#define JSON_HAS_INT64
174174
#endif // if defined(JSON_NO_INT64)
175175

176+
#if JSONCPP_USING_SECURE_MEMORY
176177
template <typename T>
177-
using Allocator = typename std::conditional<JSONCPP_USING_SECURE_MEMORY,
178-
SecureAllocator<T>,
179-
std::allocator<T>>::type;
178+
using Allocator = SecureAllocator<T>;
179+
#else // !JSONCPP_USING_SECURE_MEMORY
180+
template <typename T>
181+
using Allocator = std::allocator<T>;
182+
#endif // JSONCPP_USING_SECURE_MEMORY
180183
using String = std::basic_string<char, std::char_traits<char>, Allocator<char>>;
181184
using IStringStream = std::basic_istringstream<String::value_type,
182185
String::traits_type,

0 commit comments

Comments
 (0)