summaryrefslogtreecommitdiff
path: root/inttypes
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2007-08-20 20:09:11 +0000
committerH. Peter Anvin <hpa@zytor.com>2007-08-20 20:09:11 +0000
commitea8a28253ba758145abfd952d503c8b13163e9c1 (patch)
tree318ae9ca6f60e98994b7fc2cb770b8f181c2b0a7 /inttypes
parent3b69717a120aeb4bf6759140884e40456248c1e6 (diff)
downloadnasm-ea8a28253ba758145abfd952d503c8b13163e9c1.tar.gz
Add _MIN and _MAX macros for the fixed-size types.
Diffstat (limited to 'inttypes')
-rw-r--r--inttypes/inttypes.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/inttypes/inttypes.h b/inttypes/inttypes.h
index c4e56662..e353aa93 100644
--- a/inttypes/inttypes.h
+++ b/inttypes/inttypes.h
@@ -182,4 +182,20 @@ typedef unsigned char uint8_t;
#define SCNx32 _scn32 "x"
#define SCNx64 _scn64 "x"
+#define INT8_MIN INT8_C(-128)
+#define INT8_MAX INT8_C(127)
+#define UINT8_MAX UINT8_C(255)
+
+#define INT16_MIN INT16_C(-32768)
+#define INT16_MAX INT16_C(32767)
+#define UINT16_MAX UINT16_C(65535)
+
+#define INT32_MIN INT32_C(-2147483648)
+#define INT32_MAX INT32_C(2147483647)
+#define UINT32_MAX UINT32_C(4294967295)
+
+#define INT64_MIN INT64_C(-9223372036854775808)
+#define INT64_MAX INT64_C(9223372036854775807)
+#define UINT64_MAX UINT64_C(18446744073709551615)
+
#endif /* INTTYPES_H */