Skip to content

Commit 46acbc8

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 46acbc8

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

Diff for: include/json/config.h

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

176-
template <typename T>
177-
using Allocator = typename std::conditional<JSONCPP_USING_SECURE_MEMORY,
178-
SecureAllocator<T>,
179-
std::allocator<T>>::type;
180-
using String = std::basic_string<char, std::char_traits<char>, Allocator<char>>;
176+
#if JSONCPP_USING_SECURE_MEMORY
177+
using String = std::basic_string<char, std::char_traits<char>, SecureAllocator<char>>;
178+
#else // !JSONCPP_USING_SECURE_MEMORY
179+
using String = std::string;
180+
#endif // JSONCPP_USING_SECURE_MEMORY
181181
using IStringStream = std::basic_istringstream<String::value_type,
182182
String::traits_type,
183183
String::allocator_type>;

0 commit comments

Comments
 (0)