|
24 | 24 | #ifndef __PTRAUTH_H
|
25 | 25 | #define __PTRAUTH_H
|
26 | 26 |
|
27 |
| -#include <stdint.h> |
28 |
| - |
29 | 27 | typedef enum {
|
30 | 28 | ptrauth_key_asia = 0,
|
31 | 29 | ptrauth_key_asib = 1,
|
@@ -90,10 +88,10 @@ typedef enum {
|
90 | 88 | } ptrauth_key;
|
91 | 89 |
|
92 | 90 | /* An integer type of the appropriate size for a discriminator argument. */
|
93 |
| -typedef uintptr_t ptrauth_extra_data_t; |
| 91 | +typedef __UINTPTR_TYPE__ ptrauth_extra_data_t; |
94 | 92 |
|
95 | 93 | /* An integer type of the appropriate size for a generic signature. */
|
96 |
| -typedef uintptr_t ptrauth_generic_signature_t; |
| 94 | +typedef __UINTPTR_TYPE__ ptrauth_generic_signature_t; |
97 | 95 |
|
98 | 96 | /* A signed pointer value embeds the original pointer together with
|
99 | 97 | a signature that attests to the validity of that pointer. Because
|
@@ -149,7 +147,7 @@ typedef uintptr_t ptrauth_generic_signature_t;
|
149 | 147 |
|
150 | 148 | The first argument must be an expression of pointer type.
|
151 | 149 | The second argument must be an expression of integer type.
|
152 |
| - The result will have type uintptr_t. */ |
| 150 | + The result will have type __UINTPTR_TYPE__. */ |
153 | 151 | #define ptrauth_blend_discriminator(__pointer, __integer) \
|
154 | 152 | __builtin_ptrauth_blend_discriminator(__pointer, __integer)
|
155 | 153 |
|
@@ -280,7 +278,7 @@ typedef uintptr_t ptrauth_generic_signature_t;
|
280 | 278 | if the arguments were a pointer and a discriminator.
|
281 | 279 |
|
282 | 280 | The arguments must be either pointers or integers; if integers, they
|
283 |
| - will be coerce to uintptr_t. */ |
| 281 | + will be coerce to __UINTPTR_TYPE__. */ |
284 | 282 | #define ptrauth_sign_generic_data(__value, __data) \
|
285 | 283 | __builtin_ptrauth_sign_generic_data(__value, __data)
|
286 | 284 |
|
@@ -324,14 +322,14 @@ typedef uintptr_t ptrauth_generic_signature_t;
|
324 | 322 | #else
|
325 | 323 |
|
326 | 324 | #define ptrauth_strip(__value, __key) __value
|
327 |
| -#define ptrauth_blend_discriminator(__pointer, __integer) ((uintptr_t)0) |
| 325 | +#define ptrauth_blend_discriminator(__pointer, __integer) ((__UINTPTR_TYPE__)0) |
328 | 326 | #define ptrauth_sign_constant(__value, __key, __data) __value
|
329 | 327 | #define ptrauth_sign_unauthenticated(__value, __key, __data) __value
|
330 | 328 | #define ptrauth_auth_and_resign(__value, __old_key, __old_data, __new_key, __new_data) __value
|
331 | 329 | #define ptrauth_auth_function(__value, __old_key, __old_data) __value
|
332 | 330 | #define ptrauth_auth_data(__value, __old_key, __old_data) __value
|
333 |
| -#define ptrauth_string_discriminator(__string) ((uintptr_t)0) |
334 |
| -#define ptrauth_type_discriminator(__type) ((uintptr_t)0) |
| 331 | +#define ptrauth_string_discriminator(__string) ((__UINTPTR_TYPE__)0) |
| 332 | +#define ptrauth_type_discriminator(__type) ((__UINTPTR_TYPE__)0) |
335 | 333 | #define ptrauth_sign_generic_data(__value, __data) ((ptrauth_generic_signature_t)0)
|
336 | 334 |
|
337 | 335 | #define __ptrauth_function_pointer
|
|
0 commit comments