Skip to content

CoreFoundation build clean ups #1719

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 4 commits into from
Oct 19, 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
14 changes: 13 additions & 1 deletion CoreFoundation/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -54,14 +54,17 @@ add_framework(CoreFoundation
Base.subproj/CFKnownLocations.h
Base.subproj/CFLogUtilities.h
Base.subproj/CFPriv.h
Base.subproj/CFOverflow.h
Base.subproj/CFRuntime.h
Base.subproj/CFRuntime_Internal.h
Base.subproj/ForFoundationOnly.h
Base.subproj/ForSwiftFoundationOnly.h
# Collections
Collections.subproj/CFBasicHash.h
Collections.subproj/CFStorage.h
Collections.subproj/CFCollections_Internal.h
# Error
Error.subproj//CFError_Private.h
Error.subproj/CFError_Private.h
# Locale
Locale.subproj/CFDateFormatter_Private.h
Locale.subproj/CFICULogging.h
Expand All @@ -78,15 +81,20 @@ add_framework(CoreFoundation
PlugIn.subproj/CFBundle_BinaryTypes.h
PlugIn.subproj/CFBundle_Internal.h
PlugIn.subproj/CFPlugIn_Factory.h
# RunLoop
RunLoop.subproj/CFMachPort_Internal.h
RunLoop.subproj/CFMachPort_Lifetime.h
# Stream
Stream.subproj/CFStreamAbstract.h
Stream.subproj/CFStreamInternal.h
Stream.subproj/CFStreamPriv.h
# String
String.subproj/CFAttributedStringPriv.h
String.subproj/CFBurstTrie.h
String.subproj/CFCharacterSetPriv.h
String.subproj/CFRegularExpression.h
String.subproj/CFRunArray.h
String.subproj/CFString_Internal.h
String.subproj/CFStringDefaultEncoding.h
String.subproj/CFStringLocalizedFormattingInternal.h
# StringEncodings
Expand Down Expand Up @@ -117,6 +125,8 @@ add_framework(CoreFoundation
Stream.subproj/CFStreamPriv.h
String.subproj/CFRegularExpression.h
String.subproj/CFRunArray.h
StringEncodings.subproj/CFStringEncodingConverter.h
StringEncodings.subproj/CFStringEncodingConverterExt.h
URL.subproj/CFURLPriv.h
URL.subproj/CFURLSessionInterface.h

Expand Down Expand Up @@ -243,6 +253,8 @@ add_framework(CoreFoundation
Preferences.subproj/CFPreferences.c
Preferences.subproj/CFXMLPreferencesDomain.c
# RunLoop
# TODO(compnerd) make this empty on non-Mach targets
# RunLoop.subproj/CFMachPort_Lifetime.c
RunLoop.subproj/CFRunLoop.c
RunLoop.subproj/CFSocket.c
# Stream
Expand Down
15 changes: 13 additions & 2 deletions CoreFoundation/RunLoop.subproj/CFRunLoop.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,24 @@ CF_INLINE uint64_t check_uint64_add(uint64_t x, uint64_t y, int32_t* err) {
};
#endif

#if __HAS_DISPATCH__ && __has_include(<dispatch/private.h>)
#if __HAS_DISPATCH__
#if __has_include(<dispatch/private.h>)
#include <dispatch/private.h>
#elif __HAS_DISPATCH__
#else
extern dispatch_queue_t _dispatch_runloop_root_queue_create_4CF(const char *_Nullable label, unsigned long flags);
#if USE_DISPATCH_SOURCE_FOR_TIMERS
extern mach_port_t _dispatch_runloop_root_queue_get_port_4CF(dispatch_queue_t queue);
#endif
extern void _dispatch_source_set_runloop_timer_4CF(dispatch_source_t source, dispatch_time_t start, uint64_t interval, uint64_t leeway);
extern bool _dispatch_runloop_root_queue_perform_4CF(dispatch_queue_t queue);

#if TARGET_OS_MAC
typedef mach_port_t dispatch_runloop_handle_t;
#elif defined(__linux__) || defined(__FreeBSD__)
typedef int dispatch_runloop_handle_t;
#endif

#endif
#endif

#if DEPLOYMENT_TARGET_MACOSX || DEPLOYMENT_TARGET_EMBEDDED || DEPLOYMENT_TARGET_EMBEDDED_MINI || DEPLOYMENT_TARGET_SIMULATOR
Expand Down
2 changes: 1 addition & 1 deletion CoreFoundation/String.subproj/CFBurstTrie.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#include "CFInternal.h"
#include "CFBurstTrie.h"
#include <CoreFoundation/CFByteOrder.h>
#include "CFNumber.h"
#include <CoreFoundation/CFNumber.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
Expand Down