Skip to content

Fix linkage for Linux and BSD symbol declarations that use CF_PRIVATE #1740

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Oct 30, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CoreFoundation/Base.subproj/CFRuntime.c
Original file line number Diff line number Diff line change
Expand Up @@ -229,10 +229,10 @@ static CFRuntimeClass const * __CFRuntimeClassTable[__CFRuntimeClassTableSize] _

#if TARGET_OS_MAC
[_kCFRuntimeIDCFMachPort] = &__CFMachPortClass,
[_kCFRuntimeIDCFMessagePort] = &__CFMessagePortClass,
#endif


[_kCFRuntimeIDCFMessagePort] = &__CFMessagePortClass,
[_kCFRuntimeIDCFRunLoopMode] = &__CFRunLoopModeClass,
[_kCFRuntimeIDCFRunLoop] = &__CFRunLoopClass,
[_kCFRuntimeIDCFRunLoopSource] = &__CFRunLoopSourceClass,
Expand Down
6 changes: 3 additions & 3 deletions CoreFoundation/Base.subproj/CoreFoundation_Prefix.h
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ typedef int boolean_t;

#if DEPLOYMENT_TARGET_LINUX

#define CF_PRIVATE __attribute__((visibility("hidden")))
#define CF_PRIVATE extern __attribute__((visibility("hidden")))
#define __weak

#define strtod_l(a,b,locale) strtod(a,b)
Expand Down Expand Up @@ -235,7 +235,7 @@ CF_INLINE uint64_t mach_absolute_time() {
#if DEPLOYMENT_TARGET_FREEBSD
#define HAVE_STRUCT_TIMESPEC 1

#define CF_PRIVATE __attribute__((visibility("hidden")))
#define CF_PRIVATE extern __attribute__((visibility("hidden")))
#define __strong
#define __weak

Expand Down Expand Up @@ -455,7 +455,7 @@ CF_EXPORT int64_t OSAtomicAdd64Barrier( int64_t __theAmount, volatile int64_t *_
#endif

#if !defined(CF_PRIVATE)
#define CF_PRIVATE __attribute__((__visibility__("hidden"))) extern
#define CF_PRIVATE extern __attribute__((__visibility__("hidden")))
#endif

// [FIXED_35517899] We can't currently support this, but would like to leave things annotated
Expand Down
2 changes: 1 addition & 1 deletion CoreFoundation/Base.subproj/ForSwiftFoundationOnly.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#define __COREFOUNDATION_FORSWIFTFOUNDATIONONLY__ 1

#if !defined(CF_PRIVATE)
#define CF_PRIVATE __attribute__((__visibility__("hidden")))
#define CF_PRIVATE extern __attribute__((__visibility__("hidden")))
#endif

#include <CoreFoundation/CFBase.h>
Expand Down
3 changes: 2 additions & 1 deletion CoreFoundation/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,8 @@ target_compile_options(CoreFoundation
-fblocks
-fconstant-cfstrings
-fdollars-in-identifiers
-fexceptions)
-fexceptions
-fno-common)
if(CF_DEPLOYMENT_SWIFT)
target_compile_options(CoreFoundation
PRIVATE
Expand Down
2 changes: 1 addition & 1 deletion CoreFoundation/Stream.subproj/CFStreamPriv.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ struct _CFStream;
CF_EXPORT void* _CFStreamGetInfoPointer(struct _CFStream* stream);

#if !defined(CF_PRIVATE)
#define CF_PRIVATE __attribute__((__visibility__("hidden")))
#define CF_PRIVATE extern __attribute__((__visibility__("hidden")))
#endif

// cb version must be > 0
Expand Down
1 change: 1 addition & 0 deletions build.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@
'-Wno-int-conversion',
'-Wno-unused-function',
'-I./',
'-fno-common',
'-fcf-runtime-abi=swift',
])

Expand Down