Skip to content

Commit 1dddb4f

Browse files
authored
Merge pull request #957 from zayass/patch-2
2 parents 8e8dd9b + 0f306fa commit 1dddb4f

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

CoreFoundation/Base.subproj/CFInternal.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -334,6 +334,16 @@ CF_PRIVATE Boolean __CFProcessIsRestricted();
334334
#define STACK_BUFFER_DECL(T, N, C) T N[C]
335335
#endif
336336

337+
#ifdef __ANDROID__
338+
// Avoids crashes on Android
339+
// https://bugs.swift.org/browse/SR-2587
340+
// https://bugs.swift.org/browse/SR-2588
341+
// Seemed to be a linker/relocation? problem.
342+
// CFStrings using CONST_STRING_DECL() were not working
343+
// Applies reference to _NSCFConstantString's isa here
344+
// rather than using a linker option to create an alias.
345+
#define __CFConstantStringClassReference _T010Foundation19_NSCFConstantStringCN
346+
#endif
337347

338348
CF_EXPORT void * __CFConstantStringClassReferencePtr;
339349

0 commit comments

Comments
 (0)