24
24
extern " C" {
25
25
#endif
26
26
27
- typedef uint64_t swift_typeref_t ;
27
+ // Pointers used here need to be pointer-sized on watchOS for binary
28
+ // compatibility. Everywhere else, they are 64-bit so 32-bit processes can
29
+ // potentially read from 64-bit processes.
30
+ #if defined(__APPLE__) && defined(__MACH__)
31
+ #include < TargetConditionals.h>
32
+ #if TARGET_OS_WATCH
33
+ #define SWIFT_REFLECTION_NATIVE_POINTERS 1
34
+ #endif
35
+ #endif
36
+
37
+ #if SWIFT_REFLECTION_NATIVE_POINTERS
38
+ typedef uintptr_t swift_reflection_ptr_t ;
39
+ #else
40
+ typedef uint64_t swift_reflection_ptr_t ;
41
+ #endif
42
+
43
+ typedef swift_reflection_ptr_t swift_typeref_t ;
28
44
29
45
// / Represents one of the Swift reflection sections of an image.
30
46
typedef struct swift_reflection_section {
@@ -37,37 +53,37 @@ typedef struct swift_reflection_section {
37
53
typedef struct swift_reflection_info {
38
54
struct {
39
55
swift_reflection_section_t section;
40
- uint64_t offset;
56
+ swift_reflection_ptr_t offset;
41
57
} field;
42
58
43
59
struct {
44
60
swift_reflection_section_t section;
45
- uint64_t offset;
61
+ swift_reflection_ptr_t offset;
46
62
} associated_types;
47
63
48
64
struct {
49
65
swift_reflection_section_t section;
50
- uint64_t offset;
66
+ swift_reflection_ptr_t offset;
51
67
} builtin_types;
52
68
53
69
struct {
54
70
swift_reflection_section_t section;
55
- uint64_t offset;
71
+ swift_reflection_ptr_t offset;
56
72
} capture;
57
73
58
74
struct {
59
75
swift_reflection_section_t section;
60
- uint64_t offset;
76
+ swift_reflection_ptr_t offset;
61
77
} type_references;
62
78
63
79
struct {
64
80
swift_reflection_section_t section;
65
- uint64_t offset;
81
+ swift_reflection_ptr_t offset;
66
82
} reflection_strings;
67
83
68
84
// Start address in local and remote address spaces.
69
- uint64_t LocalStartAddress;
70
- uint64_t RemoteStartAddress;
85
+ swift_reflection_ptr_t LocalStartAddress;
86
+ swift_reflection_ptr_t RemoteStartAddress;
71
87
} swift_reflection_info_t ;
72
88
73
89
// / The layout kind of a Swift type.
0 commit comments