Skip to content

Commit 1a7e762

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

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

include/json/config.h

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

90-
#include <stdint.h>
90+
#include <cstdint>
9191
namespace Json {
9292
typedef int Int;
9393
typedef unsigned int UInt;
@@ -100,9 +100,12 @@ typedef unsigned int LargestUInt;
100100
#if defined(_MSC_VER) // Microsoft Visual Studio
101101
typedef __int64 Int64;
102102
typedef unsigned __int64 UInt64;
103-
#else // if defined(_MSC_VER) // Other platforms, use long long
103+
#elif __cplusplus >= 201103L // Using C++11
104104
typedef int64_t Int64;
105105
typedef uint64_t UInt64;
106+
#else // Other platforms, use long long
107+
typedef long long Int64;
108+
typedef unsigned long long Uint64;
106109
#endif // if defined(_MSC_VER)
107110
typedef Int64 LargestInt;
108111
typedef UInt64 LargestUInt;

0 commit comments

Comments
 (0)