|
16 | 16 |
|
17 | 17 | SWT_ASSUME_NONNULL_BEGIN |
18 | 18 |
|
19 | | -#pragma mark - Test content records |
20 | | - |
21 | | -/// The type of a test content accessor. |
22 | | -/// |
23 | | -/// - Parameters: |
24 | | -/// - outValue: On successful return, initialized to the value of the |
25 | | -/// represented test content record. |
26 | | -/// - hint: A hint value whose type and meaning depend on the type of test |
27 | | -/// record being accessed. |
28 | | -/// |
29 | | -/// - Returns: Whether or not the test record was initialized at `outValue`. If |
30 | | -/// this function returns `true`, the caller is responsible for deinitializing |
31 | | -/// the memory at `outValue` when done. |
32 | | -typedef bool (* SWTTestContentAccessor)(void *outValue, const void *_Null_unspecified hint); |
33 | | - |
34 | | -/// Resign an accessor function from a test content record. |
35 | | -/// |
36 | | -/// - Parameters: |
37 | | -/// - accessor: The accessor function to resign. |
38 | | -/// |
39 | | -/// - Returns: A resigned copy of `accessor` on platforms that use pointer |
40 | | -/// authentication, and an exact copy of `accessor` elsewhere. |
41 | | -/// |
42 | | -/// - Bug: This C function is needed because Apple's pointer authentication |
43 | | -/// intrinsics are not available in Swift. ([141465242](rdar://141465242)) |
44 | | -SWT_SWIFT_NAME(swt_resign(_:)) |
45 | | -static SWTTestContentAccessor swt_resignTestContentAccessor(SWTTestContentAccessor accessor) { |
46 | | -#if defined(__APPLE__) && __has_include(<ptrauth.h>) |
47 | | - accessor = ptrauth_strip(accessor, ptrauth_key_function_pointer); |
48 | | - accessor = ptrauth_sign_unauthenticated(accessor, ptrauth_key_function_pointer, 0); |
49 | | -#endif |
50 | | - return accessor; |
51 | | -} |
52 | | - |
53 | 19 | #if defined(__ELF__) && defined(__swift__) |
| 20 | +#pragma mark - ELF image enumeration |
| 21 | + |
54 | 22 | /// A function exported by the Swift runtime that enumerates all metadata |
55 | 23 | /// sections loaded into the current process. |
56 | 24 | /// |
|
0 commit comments