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