@@ -343,6 +343,13 @@ CF_PRIVATE Boolean __CFProcessIsRestricted();
343
343
CF_EXPORT void * __CFConstantStringClassReferencePtr ;
344
344
CF_EXPORT void * __CFConstantStringClassReference [];
345
345
346
+ #if __CF_BIG_ENDIAN__
347
+ #define CFINFO {0x00, 0x00, 0x07, 0xc8}
348
+ #elif __CF_LITTLE_ENDIAN__
349
+ #define CFINFO {0xc8, 0x07, 0x00, 0x00}
350
+ #endif
351
+
352
+
346
353
#ifdef __CONSTANT_CFSTRINGS__
347
354
348
355
#if DEPLOYMENT_RUNTIME_SWIFT
@@ -353,59 +360,53 @@ CF_EXPORT void *__CFConstantStringClassReference[];
353
360
#define CONST_STRING_SECTION
354
361
#endif
355
362
363
+
356
364
// TODO: Pinned retain count for constants?
357
365
#define CONST_STRING_DECL (S , V ) \
358
- const struct __CFConstStr __##S CONST_STRING_SECTION = {{(uintptr_t)&__CFConstantStringClassReference, _CF_CONSTANT_OBJECT_STRONG_RC, 0, {0xc8, 0x07, 0x00, 0x00} }, (uint8_t *)(V), sizeof(V) - 1}; \
366
+ const struct __CFConstStr __##S CONST_STRING_SECTION = {{(uintptr_t)&__CFConstantStringClassReference, _CF_CONSTANT_OBJECT_STRONG_RC, 0, CFINFO }, (uint8_t *)(V), sizeof(V) - 1}; \
359
367
const CFStringRef S = (CFStringRef)&__##S;
360
368
361
369
#define PE_CONST_STRING_DECL (S , V ) \
362
- const static struct __CFConstStr __##S CONST_STRING_SECTION = {{(uintptr_t)&__CFConstantStringClassReference, _CF_CONSTANT_OBJECT_STRONG_RC, 0, {0xc8, 0x07, 0x00, 0x00} }, (uint8_t *)(V), sizeof(V) - 1}; \
370
+ const static struct __CFConstStr __##S CONST_STRING_SECTION = {{(uintptr_t)&__CFConstantStringClassReference, _CF_CONSTANT_OBJECT_STRONG_RC, 0, CFINFO }, (uint8_t *)(V), sizeof(V) - 1}; \
363
371
CF_PRIVATE const CFStringRef S = (CFStringRef)&__##S;
364
372
373
+
365
374
#else
366
375
367
376
#define CONST_STRING_DECL (S , V ) \
368
- const struct __CFConstStr __##S = {{(uintptr_t)&__CFConstantStringClassReference, _CFSWIFT_RC_INIT {0xc8, 0x07, 0x00, 0x00} }, (uint8_t *)(V), sizeof(V) - 1}; \
377
+ const struct __CFConstStr __##S = {{(uintptr_t)&__CFConstantStringClassReference, _CFSWIFT_RC_INIT CFINFO }, (uint8_t *)(V), sizeof(V) - 1}; \
369
378
const CFStringRef S = (CFStringRef)&__##S;
370
379
371
380
#define PE_CONST_STRING_DECL (S , V ) \
372
- const static struct __CFConstStr __##S = {{(uintptr_t)&__CFConstantStringClassReference, _CFSWIFT_RC_INIT {0xc8, 0x07, 0x00, 0x00} }, (uint8_t *)(V), sizeof(V) - 1}; \
381
+ const static struct __CFConstStr __##S = {{(uintptr_t)&__CFConstantStringClassReference, _CFSWIFT_RC_INIT CFINFO }, (uint8_t *)(V), sizeof(V) - 1}; \
373
382
CF_PRIVATE const CFStringRef S = (CFStringRef)&__##S;
374
383
384
+
375
385
#endif
376
386
377
387
#else
378
388
379
389
struct CF_CONST_STRING {
380
390
CFRuntimeBase _base ;
381
391
uint8_t * _ptr ;
392
+ #if defined(__LP64__ ) && defined(__BIG_ENDIAN__ )
393
+ uint64_t _length ;
394
+ #else
382
395
uint32_t _length ;
396
+ #endif
383
397
};
384
398
385
399
CF_EXPORT int __CFConstantStringClassReference [];
386
400
387
401
/* CFNetwork also has a copy of the CONST_STRING_DECL macro (for use on platforms without constant string support in cc); please warn cfnetwork-core@group.apple.com of any necessary changes to this macro. -- REW, 1/28/2002 */
388
402
389
- #if __CF_BIG_ENDIAN__
390
-
391
- #define CONST_STRING_DECL (S , V ) \
392
- static struct CF_CONST_STRING __ ## S ## __ = {{(uintptr_t)&__CFConstantStringClassReference, {0x00, 0x00, 0x07, 0xc8}}, (uint8_t *)V, sizeof(V) - 1}; \
393
- const CFStringRef S = (CFStringRef) & __ ## S ## __;
394
- #define PE_CONST_STRING_DECL (S , V ) \
395
- static struct CF_CONST_STRING __ ## S ## __ = {{(uintptr_t)&__CFConstantStringClassReference, {0x00, 0x00, 0x07, 0xc8}}, (uint8_t *)V, sizeof(V) - 1}; \
396
- CF_PRIVATE const CFStringRef S = (CFStringRef) & __ ## S ## __;
397
-
398
- #elif __CF_LITTLE_ENDIAN__
399
-
400
403
#define CONST_STRING_DECL (S , V ) \
401
- static struct CF_CONST_STRING __ ## S ## __ = {{(uintptr_t)&__CFConstantStringClassReference, {0xc8, 0x07, 0x00, 0x00} }, (uint8_t *)(V), sizeof(V) - 1}; \
404
+ static struct CF_CONST_STRING __ ## S ## __ = {{(uintptr_t)&__CFConstantStringClassReference, CFINFO }, (uint8_t *)(V), sizeof(V) - 1}; \
402
405
const CFStringRef S = (CFStringRef) & __ ## S ## __;
403
406
#define PE_CONST_STRING_DECL (S , V ) \
404
- static struct CF_CONST_STRING __ ## S ## __ = {{(uintptr_t)&__CFConstantStringClassReference, {0xc8, 0x07, 0x00, 0x00} }, (uint8_t *)(V), sizeof(V) - 1}; \
407
+ static struct CF_CONST_STRING __ ## S ## __ = {{(uintptr_t)&__CFConstantStringClassReference, CFINFO }, (uint8_t *)(V), sizeof(V) - 1}; \
405
408
CF_PRIVATE const CFStringRef S = (CFStringRef) & __ ## S ## __;
406
409
407
- #endif
408
-
409
410
#endif // __CONSTANT_CFSTRINGS__
410
411
411
412
CF_EXPORT bool __CFOASafe ;
0 commit comments