@@ -152,14 +152,16 @@ since it is the default choice with Mac OS X developer tools.
152
152
#endif
153
153
154
154
#if DEPLOYMENT_RUNTIME_SWIFT
155
+ #if TARGET_OS_MAC
156
+ #define _CF_CONSTANT_STRING_SWIFT_CLASS $s15SwiftFoundation19_NSCFConstantStringCN
157
+ #else
158
+ #define _CF_CONSTANT_STRING_SWIFT_CLASS $s10Foundation19_NSCFConstantStringCN
159
+ #endif
155
160
156
- #if TARGET_OS_MAC
157
- #define _CF_CONSTANT_STRING_SWIFT_CLASS $s15SwiftFoundation19_NSCFConstantStringCN
158
- #else
159
- #define _CF_CONSTANT_STRING_SWIFT_CLASS $s10Foundation19_NSCFConstantStringCN
161
+ CF_EXPORT void * _CF_CONSTANT_STRING_SWIFT_CLASS [];
160
162
#endif
161
163
162
- CF_EXPORT void * _CF_CONSTANT_STRING_SWIFT_CLASS [];
164
+ #if DEPLOYMENT_RUNTIME_SWIFT && TARGET_OS_MAC
163
165
164
166
struct __CFConstStr {
165
167
struct {
@@ -175,20 +177,14 @@ struct __CFConstStr {
175
177
#endif // defined(__LP64__) || defined(__LLP64__)
176
178
};
177
179
178
- #if TARGET_OS_LINUX
179
- #define CONST_STRING_LITERAL_SECTION __attribute__((section(".cfstrlit.data")))
180
- #else
181
- #define CONST_STRING_LITERAL_SECTION
182
- #endif // TARGET_OS_LINUX
183
-
184
180
#if __BIG_ENDIAN__
185
181
#define CFSTR (cStr ) ({ \
186
- static struct __CFConstStr str CONST_STRING_LITERAL_SECTION = {{(uintptr_t)&_CF_CONSTANT_STRING_SWIFT_CLASS, _CF_CONSTANT_OBJECT_STRONG_RC, 0x00000000C8070000}, (uint8_t *)(cStr), sizeof(cStr) - 1}; \
182
+ static struct __CFConstStr str = {{(uintptr_t)&_CF_CONSTANT_STRING_SWIFT_CLASS, _CF_CONSTANT_OBJECT_STRONG_RC, 0x00000000C8070000}, (uint8_t *)(cStr), sizeof(cStr) - 1}; \
187
183
(CFStringRef)&str; \
188
184
})
189
185
#else // Little endian:
190
186
#define CFSTR (cStr ) ({ \
191
- static struct __CFConstStr str CONST_STRING_LITERAL_SECTION = {{(uintptr_t)&_CF_CONSTANT_STRING_SWIFT_CLASS, _CF_CONSTANT_OBJECT_STRONG_RC, 0x07C8}, (uint8_t *)(cStr), sizeof(cStr) - 1}; \
187
+ static struct __CFConstStr str = {{(uintptr_t)&_CF_CONSTANT_STRING_SWIFT_CLASS, _CF_CONSTANT_OBJECT_STRONG_RC, 0x07C8}, (uint8_t *)(cStr), sizeof(cStr) - 1}; \
192
188
(CFStringRef)&str; \
193
189
})
194
190
#endif // __BIG_ENDIAN__
0 commit comments