[PATCH v3 15/19] add predefined macros for [u]int{8,16}_t

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



All LP64 & LP32 use [u]char and [u]short for these ones.

Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@xxxxxxxxx>
---
 lib.c                            | 5 +++++
 validation/preprocessor/predef.c | 4 ++++
 2 files changed, 9 insertions(+)

diff --git a/lib.c b/lib.c
index 3a4f9820a..cd427e078 100644
--- a/lib.c
+++ b/lib.c
@@ -1241,6 +1241,11 @@ static void predefined_macros(void)
 	predefined_ctype("LONG",       &long_ctype, PTYPE_ALL);
 	predefined_ctype("LONG_LONG", &llong_ctype, PTYPE_ALL);
 
+	predefined_ctype("INT8",      &schar_ctype, PTYPE_MAX|PTYPE_TYPE);
+	predefined_ctype("UINT8",     &uchar_ctype, PTYPE_MAX|PTYPE_TYPE);
+	predefined_ctype("INT16",     &short_ctype, PTYPE_MAX|PTYPE_TYPE);
+	predefined_ctype("UINT16",   &ushort_ctype, PTYPE_MAX|PTYPE_TYPE);
+
 	predefined_sizeof("INT128", "", 128);
 
 	predefined_ctype("INTMAX",    intmax_ctype, PTYPE_MAX|PTYPE_TYPE|PTYPE_WIDTH);
diff --git a/validation/preprocessor/predef.c b/validation/preprocessor/predef.c
index 22e89bbc0..7a7b575a3 100644
--- a/validation/preprocessor/predef.c
+++ b/validation/preprocessor/predef.c
@@ -17,6 +17,10 @@ int test(void)
 	TEST_SMAX(INT, int);
 	TEST_SMAX(LONG, long);
 	TEST_SMAX(LONG_LONG, long long);
+	TEST_MAX( INT8,  0x7f);
+	TEST_MAX(UINT8,  0xffU);
+	TEST_MAX( INT16, 0x7fff);
+	TEST_MAX(UINT16, 0xffffU);
 	TEST_SMAX(INTMAX, __INTMAX_TYPE__);
 	TEST_UMAX(UINTMAX, __UINTMAX_TYPE__);
 	TEST_SMAX(INTPTR, __INTPTR_TYPE__);
-- 
2.19.2




[Index of Archives]     [Newbies FAQ]     [LKML]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Trinity Fuzzer Tool]

  Powered by Linux