[PATCH 10/11] add predefined macros for [u]int64_t

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

 



All LP32 archs use [u]llong and all LP64 use [u]long for these
but Darwing which seems to always use [u]llong.
---
 lib.c    | 8 ++++++++
 target.c | 2 ++
 target.h | 2 ++
 3 files changed, 12 insertions(+)

diff --git a/lib.c b/lib.c
index 27c90aeca..062f24c16 100644
--- a/lib.c
+++ b/lib.c
@@ -492,6 +492,8 @@ static void handle_arch_m64_finalize(void)
 		goto case_x86_64;
 	case ARCH_LP32:
 		/* default values */
+		int64_ctype = &llong_ctype;
+		uint64_ctype = &ullong_ctype;
 		intmax_ctype = &llong_ctype;
 		uintmax_ctype = &ullong_ctype;
 		return;
@@ -500,6 +502,10 @@ static void handle_arch_m64_finalize(void)
 		max_int_alignment = 8;
 		size_t_ctype = &ulong_ctype;
 		ssize_t_ctype = &long_ctype;
+#if defined(__APPLE__)
+		int64_ctype = &llong_ctype;
+		uint64_ctype = &ullong_ctype;
+#endif
 		intmax_ctype = &long_ctype;
 		uintmax_ctype = &ulong_ctype;
 		predefine("__LP64__", 1, "1");
@@ -1262,6 +1268,8 @@ static void predefined_macros(void)
 	predefined_ctype("UINT8",  &schar_ctype,  PTYPE_TYPE|PTYPE_MAX);
 	predefined_ctype("INT16",  &short_ctype,  PTYPE_TYPE|PTYPE_MAX);
 	predefined_ctype("UINT16", &ushort_ctype, PTYPE_TYPE|PTYPE_MAX);
+	predefined_ctype("INT64",  int64_ctype,  PTYPE_TYPE|PTYPE_MAX);
+	predefined_ctype("UINT64", uint64_ctype, PTYPE_TYPE|PTYPE_MAX);
 
 	predefined_sizeof("INT128", "", 128);
 
diff --git a/target.c b/target.c
index 0b95e484f..6e948dfeb 100644
--- a/target.c
+++ b/target.c
@@ -7,6 +7,8 @@ struct symbol *size_t_ctype = &uint_ctype;
 struct symbol *ssize_t_ctype = &int_ctype;
 struct symbol *intmax_ctype = &llong_ctype;
 struct symbol *uintmax_ctype = &ullong_ctype;
+struct symbol *int64_ctype = &long_ctype;
+struct symbol *uint64_ctype = &ulong_ctype;
 struct symbol *wchar_ctype = &int_ctype;
 
 /*
diff --git a/target.h b/target.h
index 684b8420a..4ecbb9a6b 100644
--- a/target.h
+++ b/target.h
@@ -5,6 +5,8 @@ extern struct symbol *size_t_ctype;
 extern struct symbol *ssize_t_ctype;
 extern struct symbol *intmax_ctype;
 extern struct symbol *uintmax_ctype;
+extern struct symbol *int64_ctype;
+extern struct symbol *uint64_ctype;
 extern struct symbol *wchar_ctype;
 
 /*
-- 
2.19.0




[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