]> git.ipfire.org Git - thirdparty/json-c.git/commitdiff
Define macros from inttypes.h when not available
authorJames Myatt <james.myatt@tessella.com>
Thu, 5 Feb 2015 15:58:12 +0000 (15:58 +0000)
committerJames Myatt <james.myatt@tessella.com>
Wed, 4 Mar 2015 10:45:36 +0000 (10:45 +0000)
json_inttypes.h

index 9de8d246d9dda0ab82772fc9d97ec1a9b3ad2807..e86f4ccf88459151dee4708c472da39087bd8b14 100644 (file)
@@ -4,24 +4,15 @@
 
 #include "json_config.h"
 
-#if defined(_MSC_VER) && _MSC_VER <= 1700
-
-/* Anything less than Visual Studio C++ 10 is missing stdint.h and inttypes.h */
-typedef __int32 int32_t;
-#define INT32_MIN    ((int32_t)_I32_MIN)
-#define INT32_MAX    ((int32_t)_I32_MAX)
-typedef __int64 int64_t;
-#define INT64_MIN    ((int64_t)_I64_MIN)
-#define INT64_MAX    ((int64_t)_I64_MAX)
-#define PRId64 "I64d"
-#define SCNd64 "I64d"
+#ifdef JSON_C_HAVE_INTTYPES_H
+/* inttypes.h includes stdint.h */
+#include <inttypes.h>
 
 #else
+#include <stdint.h>
 
-#ifdef JSON_C_HAVE_INTTYPES_H
-#include <inttypes.h>
-#endif
-/* inttypes.h includes stdint.h */
+#define PRId64 "I64d"
+#define SCNd64 "I64d"
 
 #endif