Skip to content

Commit

Permalink
Merge pull request #1719 from compnerd/CF-build
Browse files Browse the repository at this point in the history
CoreFoundation build clean ups
  • Loading branch information
compnerd committed Oct 19, 2018
2 parents 3995b2c + 4c88c6f commit 4157d9b
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 4 deletions.
14 changes: 13 additions & 1 deletion CoreFoundation/CMakeLists.txt
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
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
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

0 comments on commit 4157d9b

Please sign in to comment.