From 0f306fa9bb9ed88012037bb6d941f71ccc45844b Mon Sep 17 00:00:00 2001 From: Anton Pogonets Date: Fri, 21 Apr 2017 14:43:13 +0300 Subject: [PATCH] Restore android workaround for CONST_STRING_DECL Restore workaround for android initially introduced int https://github.com/apple/swift-corelibs-foundation/pull/622 https://github.com/SwiftJava/swift-corelibs-foundation/commit/6213cbabce1a4c3d9ac1573aef4aaaa8b102953b Refix: https://bugs.swift.org/browse/SR-2587 https://bugs.swift.org/browse/SR-2588 --- CoreFoundation/Base.subproj/CFInternal.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/CoreFoundation/Base.subproj/CFInternal.h b/CoreFoundation/Base.subproj/CFInternal.h index 59106bd13c..cd52846857 100644 --- a/CoreFoundation/Base.subproj/CFInternal.h +++ b/CoreFoundation/Base.subproj/CFInternal.h @@ -334,6 +334,16 @@ CF_PRIVATE Boolean __CFProcessIsRestricted(); #define STACK_BUFFER_DECL(T, N, C) T N[C] #endif +#ifdef __ANDROID__ +// Avoids crashes on Android +// https://bugs.swift.org/browse/SR-2587 +// https://bugs.swift.org/browse/SR-2588 +// Seemed to be a linker/relocation? problem. +// CFStrings using CONST_STRING_DECL() were not working +// Applies reference to _NSCFConstantString's isa here +// rather than using a linker option to create an alias. +#define __CFConstantStringClassReference _T010Foundation19_NSCFConstantStringCN +#endif CF_EXPORT void * __CFConstantStringClassReferencePtr;