We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c32772f commit 79dd115Copy full SHA for 79dd115
include/stdint.h
@@ -36,9 +36,19 @@ typedef unsigned long long uintmax_t;
36
#define INT64_MAX 9223372036854775807
37
#define UINT64_MAX 18446744073709551615
38
39
-#define INTPTR_MAX ((((intptr_t)1) << (sizeof(intptr_t) * 8 - 1)) - 1)
40
-#define INTPTR_MIN (((intptr_t)-1) << (sizeof(intptr_t) * 8 - 1))
41
-
42
#define INTMAX_MIN INT64_MIN
43
#define INTMAX_MAX INT64_MAX
44
#define UINTMAX_MAX UINT64_MAX
+
+#if defined(__ILP32__)
+#define INTPTR_MIN -2147483648L
45
+#define INTPTR_MAX 2147483647L
46
+#define UINTPTR_MAX 4294967295UL
47
48
+#else
49
+#define INTPTR_MIN -9223372036854775808L
50
+#define INTPTR_MAX 9223372036854775807L
51
+#define UINTPTR_MAX 18446744073709551615UL
52
+#endif
53
54
+#define SIZE_MAX UINTPTR_MAX
0 commit comments