summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlavio Cruz <flaviocruz@gmail.com>2022-12-19 10:18:25 -0500
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2022-12-21 12:35:46 +0100
commitc7654756ee191de3d495a5d716ffe9b09d22ba6c (patch)
tree7011d0c639dc71355559322992634feb9c694558
parent73fbf2504ae606dda81372701a67dad6fee0865e (diff)
Provide intptr_t and uintptr_t as default types
Message-Id: <Y6CAwaY0IRqihOjU@mars>
-rw-r--r--cpu.sym3
-rw-r--r--type.c6
2 files changed, 9 insertions, 0 deletions
diff --git a/cpu.sym b/cpu.sym
index 5e34074..6bcb878 100644
--- a/cpu.sym
+++ b/cpu.sym
@@ -30,6 +30,7 @@
* Fetch values from the Mach header.
*/
#include <mach/message.h>
+#include <stdint.h>
/*
* Known values for the msgt_name field.
@@ -103,6 +104,8 @@ expr sizeof(int) sizeof_int
expr sizeof(long) sizeof_long
expr sizeof(float) sizeof_float
expr sizeof(double) sizeof_double
+expr sizeof(uintptr_t) sizeof_uintptr_t
+expr sizeof(intptr_t) sizeof_intptr_t
expr sizeof(mach_msg_header_t) sizeof_mach_msg_header_t
expr sizeof(mach_msg_type_long_t) sizeof_mach_msg_type_long_t
expr sizeof(mach_msg_type_t) sizeof_mach_msg_type_t
diff --git a/type.c b/type.c
index f954de4..b104c66 100644
--- a/type.c
+++ b/type.c
@@ -57,6 +57,8 @@ ipc_type_t *itWaitTimeType; /* used for dummy WaitTime args */
ipc_type_t *itMsgOptionType; /* used for dummy MsgOption args */
ipc_type_t *itShortType; /* used for the short type */
ipc_type_t *itIntType; /* used for the int type */
+ipc_type_t *itUintPtrType; /* used for the uintptr_t type */
+ipc_type_t *itIntPtrType; /* used for the intptr_t type */
static bool types_initialized = false;
static ipc_type_t *list = itNULL;
@@ -960,6 +962,10 @@ init_type(void)
itInsert("short", itShortType);
itIntType = itCIntTypeDecl("int", sizeof_int);
itInsert("int", itIntType);
+ itUintPtrType = itCIntTypeDecl("uintptr_t", sizeof_uintptr_t);
+ itInsert("uintptr_t", itUintPtrType);
+ itIntPtrType = itCIntTypeDecl("intptr_t", sizeof_intptr_t);
+ itInsert("intptr_t", itIntPtrType);
}
/******************************************************