Skip to content

Commit 5136e52

Browse files
committed
Drop <stdint.h> dependency from <ptrauth.h>
This is needed to eliminate some cyclic module dependencies in some SDK configurations.
1 parent e38a71b commit 5136e52

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

clang/lib/Headers/ptrauth.h

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,6 @@
2424
#ifndef __PTRAUTH_H
2525
#define __PTRAUTH_H
2626

27-
#include <stdint.h>
28-
2927
typedef enum {
3028
ptrauth_key_asia = 0,
3129
ptrauth_key_asib = 1,
@@ -90,10 +88,10 @@ typedef enum {
9088
} ptrauth_key;
9189

9290
/* 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;
9492

9593
/* 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;
9795

9896
/* A signed pointer value embeds the original pointer together with
9997
a signature that attests to the validity of that pointer. Because
@@ -149,7 +147,7 @@ typedef uintptr_t ptrauth_generic_signature_t;
149147
150148
The first argument must be an expression of pointer type.
151149
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__. */
153151
#define ptrauth_blend_discriminator(__pointer, __integer) \
154152
__builtin_ptrauth_blend_discriminator(__pointer, __integer)
155153

@@ -280,7 +278,7 @@ typedef uintptr_t ptrauth_generic_signature_t;
280278
if the arguments were a pointer and a discriminator.
281279
282280
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__. */
284282
#define ptrauth_sign_generic_data(__value, __data) \
285283
__builtin_ptrauth_sign_generic_data(__value, __data)
286284

@@ -324,14 +322,14 @@ typedef uintptr_t ptrauth_generic_signature_t;
324322
#else
325323

326324
#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)
328326
#define ptrauth_sign_constant(__value, __key, __data) __value
329327
#define ptrauth_sign_unauthenticated(__value, __key, __data) __value
330328
#define ptrauth_auth_and_resign(__value, __old_key, __old_data, __new_key, __new_data) __value
331329
#define ptrauth_auth_function(__value, __old_key, __old_data) __value
332330
#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)
335333
#define ptrauth_sign_generic_data(__value, __data) ((ptrauth_generic_signature_t)0)
336334

337335
#define __ptrauth_function_pointer

0 commit comments

Comments
 (0)