Skip to content

Commit 4689a3b

Browse files
committed
Only use fix-width types for C++11 (Issue open-source-parsers#64)
1 parent 533dbe0 commit 4689a3b

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

include/json/config.h

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@
8787
#define JSONCPP_DEPRECATED(message)
8888
#endif // if !defined(JSONCPP_DEPRECATED)
8989

90+
#include <cstdint>
9091
namespace Json {
9192
typedef int Int;
9293
typedef unsigned int UInt;
@@ -99,9 +100,12 @@ typedef unsigned int LargestUInt;
99100
#if defined(_MSC_VER) // Microsoft Visual Studio
100101
typedef __int64 Int64;
101102
typedef unsigned __int64 UInt64;
102-
#else // if defined(_MSC_VER) // Other platforms, use long long
103-
typedef long long int Int64;
104-
typedef unsigned long long int UInt64;
103+
#elif __cplusplus >= 201103L // Using C++11
104+
typedef int64_t Int64;
105+
typedef uint64_t UInt64;
106+
#else // Other platforms, use long long
107+
typedef long long Int64;
108+
typedef unsigned long long Uint64;
105109
#endif // if defined(_MSC_VER)
106110
typedef Int64 LargestInt;
107111
typedef UInt64 LargestUInt;

0 commit comments

Comments
 (0)