]> git.saurik.com Git - apple/javascriptcore.git/blobdiff - os-win32/stdint.h
JavaScriptCore-521.tar.gz
[apple/javascriptcore.git] / os-win32 / stdint.h
index 48ae474d25c48ef3679c351ff9afe0da35e96ae9..efab2ae5474de0989ee13735677ee3be496d6a03 100644 (file)
@@ -29,6 +29,8 @@
 #error "This stdint.h file should only be compiled under Windows"
 #endif
 
+#include <limits.h>
+
 typedef unsigned char uint8_t;
 typedef signed char int8_t;
 typedef unsigned short uint16_t;
@@ -38,6 +40,16 @@ typedef int int32_t;
 typedef __int64 int64_t;
 typedef unsigned __int64 uint64_t;
 
+#if !defined(__cplusplus) || defined(__STDC_LIMIT_MACROS)
+#ifndef SIZE_MAX
+#ifdef _WIN64
+#define SIZE_MAX  _UI64_MAX
+#else
+#define SIZE_MAX  _UI32_MAX
+#endif
+#endif
+#endif
+
 #ifndef CASSERT
 #define CASSERT(exp, name) typedef int dummy##name [(exp) ? 1 : -1];
 #endif