File tree Expand file tree Collapse file tree 2 files changed +23
-3
lines changed Expand file tree Collapse file tree 2 files changed +23
-3
lines changed Original file line number Diff line number Diff line change 13
13
#ifndef SWIFT_STDLIB_SHIMS_SWIFT_STDDEF_H
14
14
#define SWIFT_STDLIB_SHIMS_SWIFT_STDDEF_H
15
15
16
+ // stddef.h is provided by Clang, but it dispatches to libc's stddef.h. As a
17
+ // result, using stddef.h here would pull in Darwin module (which includes
18
+ // libc). This creates a dependency cycle, so we can't use stddef.h in
19
+ // SwiftShims.
20
+ #if !defined(__APPLE__)
21
+ #include < stddef.h>
22
+ typedef size_t __swift_size_t ;
23
+ #else
16
24
typedef __SIZE_TYPE__ __swift_size_t ;
25
+ #endif
17
26
18
27
#endif // SWIFT_STDLIB_SHIMS_SWIFT_STDDEF_H
19
-
Original file line number Diff line number Diff line change 20
20
21
21
// Clang has been defining __INTxx_TYPE__ macros for a long time.
22
22
// __UINTxx_TYPE__ are defined only since Clang 3.5.
23
-
23
+ #if !defined(__APPLE__)
24
+ #include < stdint.h>
25
+ typedef int64_t __swift_int64_t ;
26
+ typedef uint64_t __swift_uint64_t ;
27
+ typedef int32_t __swift_int32_t ;
28
+ typedef uint32_t __swift_uint32_t ;
29
+ typedef int16_t __swift_int16_t ;
30
+ typedef uint16_t __swift_uint16_t ;
31
+ typedef int8_t __swift_int8_t ;
32
+ typedef uint8_t __swift_uint8_t ;
33
+ typedef intptr_t __swift_intptr_t ;
34
+ typedef uintptr_t __swift_uintptr_t ;
35
+ #else
24
36
typedef __INT64_TYPE__ __swift_int64_t ;
25
37
#ifdef __UINT64_TYPE__
26
38
typedef __UINT64_TYPE__ __swift_uint64_t ;
@@ -56,6 +68,6 @@ typedef unsigned __INT8_TYPE__ __swift_uint8_t;
56
68
57
69
typedef __swift_intn_t (__INTPTR_WIDTH__) __swift_intptr_t;
58
70
typedef __swift_uintn_t (__INTPTR_WIDTH__) __swift_uintptr_t;
71
+ #endif
59
72
60
73
#endif // SWIFT_STDLIB_SHIMS_SWIFT_STDINT_H
61
-
You can’t perform that action at this time.
0 commit comments