Skip to content

Commit ce92ab3

Browse files
authored
Restore android workaround for CONST_STRING_DECL
Restore workaround for android initially introduced int #622 SwiftJava@6213cba Refix: https://bugs.swift.org/browse/SR-2587 https://bugs.swift.org/browse/SR-2588
1 parent 86eea52 commit ce92ab3

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 _TMC10Foundation19_NSCFConstantString
346+
#endif
337347

338348
CF_EXPORT void * __CFConstantStringClassReferencePtr;
339349

0 commit comments

Comments
 (0)