@@ -352,6 +352,13 @@ CF_PRIVATE Boolean __CFProcessIsRestricted();
352
352
CF_EXPORT void * __CFConstantStringClassReferencePtr ;
353
353
CF_EXPORT void * __CFConstantStringClassReference [];
354
354
355
+ #if __CF_BIG_ENDIAN__
356
+ #define CFINFO {0x00, 0x00, 0x07, 0xc8}
357
+ #elif __CF_LITTLE_ENDIAN__
358
+ #define CFINFO {0xc8, 0x07, 0x00, 0x00}
359
+ #endif
360
+
361
+
355
362
#ifdef __CONSTANT_CFSTRINGS__
356
363
357
364
#if DEPLOYMENT_RUNTIME_SWIFT
@@ -362,59 +369,53 @@ CF_EXPORT void *__CFConstantStringClassReference[];
362
369
#define CONST_STRING_SECTION
363
370
#endif
364
371
372
+
365
373
// TODO: Pinned retain count for constants?
366
374
#define CONST_STRING_DECL (S , V ) \
367
- 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}; \
375
+ const struct __CFConstStr __##S CONST_STRING_SECTION = {{(uintptr_t)&__CFConstantStringClassReference, _CF_CONSTANT_OBJECT_STRONG_RC, 0, CFINFO }, (uint8_t *)(V), sizeof(V) - 1}; \
368
376
const CFStringRef S = (CFStringRef)&__##S;
369
377
370
378
#define PE_CONST_STRING_DECL (S , V ) \
371
- 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}; \
379
+ const static struct __CFConstStr __##S CONST_STRING_SECTION = {{(uintptr_t)&__CFConstantStringClassReference, _CF_CONSTANT_OBJECT_STRONG_RC, 0, CFINFO }, (uint8_t *)(V), sizeof(V) - 1}; \
372
380
CF_PRIVATE const CFStringRef S = (CFStringRef)&__##S;
373
381
382
+
374
383
#else
375
384
376
385
#define CONST_STRING_DECL (S , V ) \
377
- const struct __CFConstStr __##S = {{(uintptr_t)&__CFConstantStringClassReference, _CFSWIFT_RC_INIT {0xc8, 0x07, 0x00, 0x00} }, (uint8_t *)(V), sizeof(V) - 1}; \
386
+ const struct __CFConstStr __##S = {{(uintptr_t)&__CFConstantStringClassReference, _CFSWIFT_RC_INIT CFINFO }, (uint8_t *)(V), sizeof(V) - 1}; \
378
387
const CFStringRef S = (CFStringRef)&__##S;
379
388
380
389
#define PE_CONST_STRING_DECL (S , V ) \
381
- const static struct __CFConstStr __##S = {{(uintptr_t)&__CFConstantStringClassReference, _CFSWIFT_RC_INIT {0xc8, 0x07, 0x00, 0x00} }, (uint8_t *)(V), sizeof(V) - 1}; \
390
+ const static struct __CFConstStr __##S = {{(uintptr_t)&__CFConstantStringClassReference, _CFSWIFT_RC_INIT CFINFO }, (uint8_t *)(V), sizeof(V) - 1}; \
382
391
CF_PRIVATE const CFStringRef S = (CFStringRef)&__##S;
383
392
393
+
384
394
#endif
385
395
386
396
#else
387
397
388
398
struct CF_CONST_STRING {
389
399
CFRuntimeBase _base ;
390
400
uint8_t * _ptr ;
401
+ #if defined(__LP64__ ) && defined(__BIG_ENDIAN__ )
402
+ uint64_t _length ;
403
+ #else
391
404
uint32_t _length ;
405
+ #endif
392
406
};
393
407
394
408
CF_EXPORT int __CFConstantStringClassReference [];
395
409
396
410
/* 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 */
397
411
398
- #if __CF_BIG_ENDIAN__
399
-
400
- #define CONST_STRING_DECL (S , V ) \
401
- static struct CF_CONST_STRING __ ## S ## __ = {{(uintptr_t)&__CFConstantStringClassReference, {0x00, 0x00, 0x07, 0xc8}}, (uint8_t *)V, sizeof(V) - 1}; \
402
- const CFStringRef S = (CFStringRef) & __ ## S ## __;
403
- #define PE_CONST_STRING_DECL (S , V ) \
404
- static struct CF_CONST_STRING __ ## S ## __ = {{(uintptr_t)&__CFConstantStringClassReference, {0x00, 0x00, 0x07, 0xc8}}, (uint8_t *)V, sizeof(V) - 1}; \
405
- CF_PRIVATE const CFStringRef S = (CFStringRef) & __ ## S ## __;
406
-
407
- #elif __CF_LITTLE_ENDIAN__
408
-
409
412
#define CONST_STRING_DECL (S , V ) \
410
- static struct CF_CONST_STRING __ ## S ## __ = {{(uintptr_t)&__CFConstantStringClassReference, {0xc8, 0x07, 0x00, 0x00} }, (uint8_t *)(V), sizeof(V) - 1}; \
413
+ static struct CF_CONST_STRING __ ## S ## __ = {{(uintptr_t)&__CFConstantStringClassReference, CFINFO }, (uint8_t *)(V), sizeof(V) - 1}; \
411
414
const CFStringRef S = (CFStringRef) & __ ## S ## __;
412
415
#define PE_CONST_STRING_DECL (S , V ) \
413
- static struct CF_CONST_STRING __ ## S ## __ = {{(uintptr_t)&__CFConstantStringClassReference, {0xc8, 0x07, 0x00, 0x00} }, (uint8_t *)(V), sizeof(V) - 1}; \
416
+ static struct CF_CONST_STRING __ ## S ## __ = {{(uintptr_t)&__CFConstantStringClassReference, CFINFO }, (uint8_t *)(V), sizeof(V) - 1}; \
414
417
CF_PRIVATE const CFStringRef S = (CFStringRef) & __ ## S ## __;
415
418
416
- #endif
417
-
418
419
#endif // __CONSTANT_CFSTRINGS__
419
420
420
421
CF_EXPORT bool __CFOASafe ;
0 commit comments