Skip to content

Commit 2900ad9

Browse files
committed
CoreFoundation: remove private headers from public directory
Clean up the long standing issue with private headers being pushed into the public headers directory. Add a private modulemap so that we can still access the private headers.
1 parent 93a24b3 commit 2900ad9

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+205
-60
lines changed

CMakeLists.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -287,6 +287,7 @@ add_swift_library(Foundation
287287
SWIFT_FLAGS
288288
-Xcc -F${CMAKE_CURRENT_BINARY_DIR}
289289
-DDEPLOYMENT_RUNTIME_SWIFT
290+
-Xcc -DDEPLOYMENT_RUNTIME_SWIFT
290291
$<$<BOOL:FOUNDATION_ENABLE_LIBDISPATCH>:-DDEPLOYMENT_ENABLE_LIBDISPATCH>
291292
-I;${ICU_INCLUDE_DIR}
292293
${libdispatch_cflags}
@@ -350,6 +351,7 @@ add_swift_library(FoundationNetworking
350351
${WORKAROUND_SR9995}
351352
SWIFT_FLAGS
352353
-DDEPLOYMENT_RUNTIME_SWIFT
354+
-Xcc -DDEPLOYMENT_RUNTIME_SWIFT
353355
-DNS_BUILDING_FOUNDATION_NETWORKING
354356
-Xcc -F${CMAKE_CURRENT_BINARY_DIR}
355357
${deployment_enable_libdispatch}
@@ -391,6 +393,7 @@ add_swift_executable(plutil
391393
SWIFT_FLAGS
392394
-Xcc -F${CMAKE_CURRENT_BINARY_DIR}
393395
-DDEPLOYMENT_RUNTIME_SWIFT
396+
-Xcc -DDEPLOYMENT_RUNTIME_SWIFT
394397
-I;${CMAKE_CURRENT_BINARY_DIR}/swift
395398
-I;${ICU_INCLUDE_DIR}
396399
${libdispatch_cflags}
@@ -416,6 +419,7 @@ if(ENABLE_TESTING)
416419
TestFoundation/xdgTestHelper/main.swift
417420
SWIFT_FLAGS
418421
-Xcc -F${CMAKE_CURRENT_BINARY_DIR}
422+
-Xcc -DDEPLOYMENT_RUNTIME_SWIFT
419423
-I;${CMAKE_CURRENT_BINARY_DIR}/swift
420424
-I;${ICU_INCLUDE_DIR}
421425
${libdispatch_cflags}
@@ -561,6 +565,7 @@ if(ENABLE_TESTING)
561565
${CMAKE_SOURCE_DIR}/TestFoundation/Fixtures
562566
SWIFT_FLAGS
563567
-Xcc -F${CMAKE_CURRENT_BINARY_DIR}
568+
-Xcc -DDEPLOYMENT_RUNTIME_SWIFT
564569
-I;${CMAKE_CURRENT_BINARY_DIR}/swift
565570
-I;${FOUNDATION_PATH_TO_XCTEST_BUILD}/swift
566571
-I;${ICU_INCLUDE_DIR}

CoreFoundation/Base.subproj/CFLocking.h

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,16 +37,17 @@ static inline CFLock_t __CFLockInit(void) { return CFLockInit; }
3737
#elif TARGET_OS_WIN32
3838

3939
#define NOMINMAX
40+
#define VC_EXTRALEAN
4041
#define WIN32_LEAN_AND_MEAN
41-
#define VCEXTRALEAN
4242
#include <Windows.h>
43+
#include <synchapi.h>
4344

4445
typedef int32_t CFLock_t;
4546
#define CFLockInit 0
4647
#define CF_LOCK_INIT_FOR_STRUCTS(X) (X = CFLockInit)
4748

4849
CF_INLINE void __CFLock(volatile CFLock_t *lock) {
49-
while (InterlockedCompareExchange((LONG volatile *)lock, ~0, 0) != 0) {
50+
while (InterlockedCompareExchange((long volatile *)lock, ~0, 0) != 0) {
5051
Sleep(0);
5152
}
5253
}
@@ -57,7 +58,7 @@ CF_INLINE void __CFUnlock(volatile CFLock_t *lock) {
5758
}
5859

5960
CF_INLINE Boolean __CFLockTry(volatile CFLock_t *lock) {
60-
return (InterlockedCompareExchange((LONG volatile *)lock, ~0, 0) == 0);
61+
return (InterlockedCompareExchange((long volatile *)lock, ~0, 0) == 0);
6162
}
6263

6364
// SPI to permit initialization of values in Swift
@@ -66,6 +67,7 @@ static inline CFLock_t __CFLockInit(void) { return CFLockInit; }
6667
#elif TARGET_OS_LINUX || TARGET_OS_BSD
6768

6869
#include <stdint.h>
70+
#include <unistd.h>
6971

7072
typedef int32_t CFLock_t;
7173
#define CFLockInit 0

CoreFoundation/Base.subproj/CFPriv.h

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,8 @@ CF_EXPORT const char **_CFGetProcessPath(void);
5959
CF_EXPORT const char **_CFGetProgname(void);
6060

6161
#if !TARGET_OS_WIN32
62+
#include <sys/types.h>
63+
6264
CF_EXPORT void _CFGetUGIDs(uid_t *euid, gid_t *egid);
6365
CF_EXPORT uid_t _CFGetEUID(void);
6466
CF_EXPORT uid_t _CFGetEGID(void);
@@ -492,8 +494,8 @@ void CFCharacterSetInitInlineBuffer(CFCharacterSetRef cset, CFCharacterSetInline
492494
@result true, if the value is in the character set, otherwise false.
493495
*/
494496
#if defined(CF_INLINE)
495-
CF_INLINE bool CFCharacterSetInlineBufferIsLongCharacterMember(const CFCharacterSetInlineBuffer *buffer, UTF32Char character) {
496-
bool isInverted = ((0 == (buffer->flags & kCFCharacterSetIsInverted)) ? false : true);
497+
CF_INLINE Boolean CFCharacterSetInlineBufferIsLongCharacterMember(const CFCharacterSetInlineBuffer *buffer, UTF32Char character) {
498+
Boolean isInverted = ((0 == (buffer->flags & kCFCharacterSetIsInverted)) ? FALSE : TRUE);
497499

498500
if ((character >= buffer->rangeStart) && (character < buffer->rangeLimit)) {
499501
if ((character > 0xFFFF) || (0 != (buffer->flags & kCFCharacterSetNoBitmapAvailable))) return (CFCharacterSetIsLongCharacterMember(buffer->cset, character) != 0);
@@ -569,6 +571,7 @@ CF_EXPORT CFMessagePortRef _CFMessagePortCreateLocalEx(CFAllocatorRef allocator,
569571
#if _POSIX_THREADS
570572
#include <pthread.h>
571573
#endif
574+
#include <time.h>
572575

573576
CF_INLINE CFAbsoluteTime _CFAbsoluteTimeFromFileTimeSpec(struct timespec ts) {
574577
return (CFAbsoluteTime)((CFTimeInterval)ts.tv_sec - kCFAbsoluteTimeIntervalSince1970) + (1.0e-9 * (CFTimeInterval)ts.tv_nsec);
@@ -592,10 +595,10 @@ CF_INLINE struct timespec _CFFileTimeSpecFromAbsoluteTime(CFAbsoluteTime at) {
592595
}
593596

594597
// The 'filtered' function below is preferred to this older one
595-
CF_EXPORT bool _CFPropertyListCreateSingleValue(CFAllocatorRef allocator, CFDataRef data, CFOptionFlags option, CFStringRef keyPath, CFPropertyListRef *value, CFErrorRef *error);
598+
CF_EXPORT Boolean _CFPropertyListCreateSingleValue(CFAllocatorRef allocator, CFDataRef data, CFOptionFlags option, CFStringRef keyPath, CFPropertyListRef *value, CFErrorRef *error);
596599

597600
// Returns a subset of the property list, only including the keyPaths in the CFSet. If the top level object is not a dictionary, you will get back an empty dictionary as the result.
598-
CF_EXPORT bool _CFPropertyListCreateFiltered(CFAllocatorRef allocator, CFDataRef data, CFOptionFlags option, CFSetRef keyPaths, CFPropertyListRef *value, CFErrorRef *error) API_AVAILABLE(macos(10.8), ios(6.0), watchos(2.0), tvos(9.0));
601+
CF_EXPORT Boolean _CFPropertyListCreateFiltered(CFAllocatorRef allocator, CFDataRef data, CFOptionFlags option, CFSetRef keyPaths, CFPropertyListRef *value, CFErrorRef *error) API_AVAILABLE(macos(10.8), ios(6.0), watchos(2.0), tvos(9.0));
599602

600603
// Returns a set of the keys of the top-level dictionary of a plist. Optimized for bplist (though it works with XML too). Only supports string keys.
601604
CF_EXPORT CFSetRef _CFPropertyListCopyTopLevelKeys(CFAllocatorRef allocator, CFDataRef data, CFOptionFlags option, CFErrorRef *outError) API_AVAILABLE(macos(10.13), ios(11.0), watchos(4.0), tvos(11.0));

CoreFoundation/Base.subproj/CoreFoundation.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@
5151
#include <CoreFoundation/CFData.h>
5252
#include <CoreFoundation/CFDate.h>
5353
#include <CoreFoundation/CFDateFormatter.h>
54+
#include <CoreFoundation/CFDateIntervalFormatter.h>
5455
#include <CoreFoundation/CFDictionary.h>
5556
#include <CoreFoundation/CFError.h>
5657
#include <CoreFoundation/CFLocale.h>

CoreFoundation/Base.subproj/ForSwiftFoundationOnly.h

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
#include <CoreFoundation/CFXMLInterface.h>
2525
#include <CoreFoundation/CFRegularExpression.h>
2626
#include <CoreFoundation/CFLogUtilities.h>
27-
#include <CoreFoundation/CFDateIntervalFormatter.h>
2827
#include <CoreFoundation/ForFoundationOnly.h>
2928
#include <CoreFoundation/CFCharacterSetPriv.h>
3029
#include <CoreFoundation/CFURLPriv.h>
@@ -77,6 +76,8 @@
7776
#endif //__GLIBC_PREREQ(2. 28)
7877
#endif // TARGET_OS_LINUX
7978

79+
#include <stdlib.h>
80+
8081

8182
_CF_EXPORT_SCOPE_BEGIN
8283

@@ -385,12 +386,12 @@ CF_EXPORT char *_Nullable *_Nonnull _CFEnviron(void);
385386
CF_EXPORT void CFLog1(CFLogLevel lev, CFStringRef message);
386387

387388
#if TARGET_OS_WIN32
388-
typedef HANDLE _CFThreadRef;
389+
typedef void *_CFThreadRef;
389390
typedef struct _CFThreadAttributes {
390-
DWORD dwSizeOfAttributes;
391-
DWORD dwThreadStackReservation;
391+
unsigned long dwSizeOfAttributes;
392+
unsigned long dwThreadStackReservation;
392393
} _CFThreadAttributes;
393-
typedef DWORD _CFThreadSpecificKey;
394+
typedef unsigned long _CFThreadSpecificKey;
394395
#elif _POSIX_THREADS
395396
typedef pthread_t _CFThreadRef;
396397
typedef pthread_attr_t _CFThreadAttributes;

CoreFoundation/Base.subproj/SwiftRuntime/CoreFoundation.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@
6868
#include <CoreFoundation/CFData.h>
6969
#include <CoreFoundation/CFDate.h>
7070
#include <CoreFoundation/CFDateFormatter.h>
71+
#include <CoreFoundation/CFDateIntervalFormatter.h>
7172
#include <CoreFoundation/CFDictionary.h>
7273
#include <CoreFoundation/CFError.h>
7374
#include <CoreFoundation/CFLocale.h>
@@ -96,7 +97,5 @@
9697
#include <CoreFoundation/CFAttributedString.h>
9798
#include <CoreFoundation/CFNotificationCenter.h>
9899

99-
#include <CoreFoundation/ForSwiftFoundationOnly.h>
100-
101100
#endif /* ! __COREFOUNDATION_COREFOUNDATION__ */
102101

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
framework module CoreFoundation_Private [extern_c] [system] {
2+
umbrella header "ForSwiftFoundationOnly.h"
3+
export *
4+
module * {
5+
export *
6+
}
7+
}
8+

CoreFoundation/CMakeLists.txt

Lines changed: 2 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,13 @@ add_framework(CoreFoundation
5555
CoreFoundation_FRAMEWORK_DIRECTORY
5656
MODULE_MAP
5757
Base.subproj/module.modulemap
58+
Base.subproj/module.private.modulemap
5859
PRIVATE_HEADERS
5960
# Base
6061
Base.subproj/CFAsmMacros.h
6162
Base.subproj/CFInternal.h
6263
Base.subproj/CFKnownLocations.h
64+
Base.subproj/CFLocking.h
6365
Base.subproj/CFLogUtilities.h
6466
Base.subproj/CFPriv.h
6567
Base.subproj/CFOverflow.h
@@ -124,30 +126,6 @@ add_framework(CoreFoundation
124126
URL.subproj/CFURLPriv.h
125127
URL.subproj/CFURLSessionInterface.h
126128
PUBLIC_HEADERS
127-
# FIXME: PrivateHeaders referenced by public headers
128-
Base.subproj/CFKnownLocations.h
129-
Base.subproj/CFLocking.h
130-
Base.subproj/CFLogUtilities.h
131-
Base.subproj/CFPriv.h
132-
Base.subproj/CFRuntime.h
133-
Base.subproj/ForFoundationOnly.h
134-
Base.subproj/ForSwiftFoundationOnly.h
135-
Locale.subproj/CFCalendar_Internal.h
136-
Locale.subproj/CFDateComponents.h
137-
Locale.subproj/CFDateInterval.h
138-
Locale.subproj/CFLocaleInternal.h
139-
Parsing.subproj/CFXMLInterface.h
140-
PlugIn.subproj/CFBundlePriv.h
141-
Stream.subproj/CFStreamPriv.h
142-
String.subproj/CFCharacterSetPriv.h
143-
String.subproj/CFRegularExpression.h
144-
String.subproj/CFRunArray.h
145-
StringEncodings.subproj/CFStringEncodingConverter.h
146-
StringEncodings.subproj/CFStringEncodingConverterExt.h
147-
URL.subproj/CFURLPriv.h
148-
URL.subproj/CFURLSessionInterface.h
149-
Locale.subproj/CFDateIntervalFormatter.h
150-
151129
# AppServices
152130
AppServices.subproj/CFNotificationCenter.h
153131
AppServices.subproj/CFUserNotification.h

CoreFoundation/Locale.subproj/CFDateIntervalFormatter.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,8 @@ CF_EXPORT void _CFDateIntervalFormatterInitializeFromCoderValues(CFDateIntervalF
7171
int64_t timeStyle,
7272
CFStringRef _Nullable dateTemplate,
7373
CFStringRef _Nullable dateTemplateFromStyles,
74-
bool modified,
75-
bool useTemplate,
74+
Boolean modified,
75+
Boolean useTemplate,
7676
CFLocaleRef _Nullable locale,
7777
CFCalendarRef _Nullable calendar,
7878
CFTimeZoneRef _Nullable timeZone);
@@ -82,8 +82,8 @@ CF_EXPORT void _CFDateIntervalFormatterCopyCoderValues(CFDateIntervalFormatterRe
8282
int64_t *timeStyle,
8383
CFStringRef _Nullable *_Nonnull dateTemplate,
8484
CFStringRef _Nullable *_Nonnull dateTemplateFromStyles,
85-
bool *modified,
86-
bool *useTemplate,
85+
Boolean *modified,
86+
Boolean *useTemplate,
8787
CFLocaleRef _Nullable *_Nonnull locale,
8888
CFCalendarRef _Nullable *_Nonnull calendar,
8989
CFTimeZoneRef _Nullable *_Nonnull timeZone);

CoreFoundation/Parsing.subproj/CFXMLInterface.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ typedef void* _CFXMLDTDPtr;
141141
typedef void* _CFXMLDTDNodePtr;
142142

143143
_CFXMLNodePtr _CFXMLNewNode(_CFXMLNamespacePtr _Nullable name_space, const char* name);
144-
_CFXMLNodePtr _CFXMLCopyNode(_CFXMLNodePtr node, bool recursive);
144+
_CFXMLNodePtr _CFXMLCopyNode(_CFXMLNodePtr node, Boolean recursive);
145145

146146
_CFXMLDocPtr _CFXMLNewDoc(const unsigned char* version);
147147
_CFXMLNodePtr _CFXMLNewProcessingInstruction(const unsigned char* name, const unsigned char* value);
@@ -175,8 +175,8 @@ void _CFXMLNodeReplaceNode(_CFXMLNodePtr node, _CFXMLNodePtr replacement);
175175

176176
_CFXMLDocPtr _Nullable _CFXMLNodeGetDocument(_CFXMLNodePtr node);
177177

178-
bool _CFXMLDocStandalone(_CFXMLDocPtr doc);
179-
void _CFXMLDocSetStandalone(_CFXMLDocPtr doc, bool standalone);
178+
Boolean _CFXMLDocStandalone(_CFXMLDocPtr doc);
179+
void _CFXMLDocSetStandalone(_CFXMLDocPtr doc, Boolean standalone);
180180
_CFXMLNodePtr _Nullable _CFXMLDocRootElement(_CFXMLDocPtr doc);
181181
void _CFXMLDocSetRootElement(_CFXMLDocPtr doc, _CFXMLNodePtr node);
182182
CFStringRef _Nullable _CFXMLDocCopyCharacterEncoding(_CFXMLDocPtr doc);
@@ -208,7 +208,7 @@ _CFXMLDocPtr _CFXMLDocPtrFromDataWithOptions(CFDataRef data, unsigned int option
208208
CFStringRef _Nullable _CFXMLNodeCopyLocalName(_CFXMLNodePtr node);
209209
CFStringRef _Nullable _CFXMLNodeCopyPrefix(_CFXMLNodePtr node);
210210

211-
bool _CFXMLDocValidate(_CFXMLDocPtr doc, CFErrorRef _Nullable * error);
211+
Boolean _CFXMLDocValidate(_CFXMLDocPtr doc, CFErrorRef _Nullable * error);
212212

213213
_CFXMLDTDPtr _CFXMLNewDTD(_CFXMLDocPtr _Nullable doc, const unsigned char* name, const unsigned char* publicID, const unsigned char* systemID);
214214
_CFXMLDTDNodePtr _Nullable _CFXMLParseDTDNode(const unsigned char* xmlString);

CoreFoundation/PlugIn.subproj/CFPlugInCOM.h

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,12 @@ CF_EXTERN_C_BEGIN
2020
/* The _reserved field is part of the Microsoft COM binary standard on Macintosh. */
2121
/* You can declare new C struct interfaces by defining a new struct that includes "IUNKNOWN_C_GUTS;" before the first field of the struct. */
2222

23-
#if !TARGET_OS_WIN32
23+
#if TARGET_OS_WIN32
24+
#define NOMINMAX
25+
#define VC_EXTRALEAN
26+
#define WIN32_LEAN_AND_MEAN
27+
#include <Windows.h>
28+
#else
2429
typedef SInt32 HRESULT;
2530
typedef UInt32 ULONG;
2631
typedef void *LPVOID;

CoreFoundation/cmake/modules/CoreFoundationAddFramework.cmake

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ include(CMakeParseArguments)
33

44
function(add_framework NAME)
55
set(options STATIC SHARED)
6-
set(single_value_args MODULE_MAP FRAMEWORK_DIRECTORY)
7-
set(multiple_value_args PRIVATE_HEADERS PUBLIC_HEADERS SOURCES)
6+
set(single_value_args FRAMEWORK_DIRECTORY)
7+
set(multiple_value_args MODULE_MAP PRIVATE_HEADERS PUBLIC_HEADERS SOURCES)
88
cmake_parse_arguments(AF "${options}" "${single_value_args}" "${multiple_value_args}" ${ARGN})
99

1010
set(AF_TYPE)
@@ -60,17 +60,9 @@ function(add_framework NAME)
6060
PROPERTIES
6161
LIBRARY_OUTPUT_DIRECTORY
6262
${CMAKE_BINARY_DIR}/${NAME}.framework)
63-
if("${CMAKE_C_SIMULATE_ID}" STREQUAL "MSVC")
64-
target_compile_options(${NAME}
65-
PRIVATE
66-
-Xclang;-F${CMAKE_BINARY_DIR})
67-
else()
68-
target_compile_options(${NAME}
69-
PRIVATE
70-
-F;${CMAKE_BINARY_DIR})
71-
endif()
7263
target_compile_options(${NAME}
7364
PRIVATE
65+
$<$<STREQUAL:${CMAKE_C_SIMULATE_ID},MSVC>:/clang:>-F${CMAKE_BINARY_DIR}
7466
$<$<OR:$<COMPILE_LANGUAGE:ASM>,$<COMPILE_LANGUAGE:C>>:-I;${CMAKE_BINARY_DIR}/${NAME}.framework/PrivateHeaders>)
7567
add_dependencies(${NAME} ${NAME}_POPULATE_HEADERS)
7668

Foundation/Bundle.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@
99

1010
import CoreFoundation
1111

12+
@_implementationOnly
13+
import CoreFoundation_Private
14+
1215
@_silgen_name("swift_getTypeContextDescriptor")
1316
private func _getTypeContextDescriptor(of cls: AnyClass) -> UnsafeRawPointer
1417

Foundation/Data.swift

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,13 @@ internal func malloc_good_size(_ size: Int) -> Int {
2121

2222
import CoreFoundation
2323

24+
@_implementationOnly
25+
import CoreFoundation_Private
26+
27+
#if os(Windows)
28+
import WinSDK
29+
#endif
30+
2431
internal func __NSDataInvokeDeallocatorUnmap(_ mem: UnsafeMutableRawPointer, _ length: Int) {
2532
#if os(Windows)
2633
UnmapViewOfFile(mem)

Foundation/DateIntervalFormatter.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@
99

1010
import CoreFoundation
1111

12+
@_implementationOnly
13+
import CoreFoundation_Private
14+
1215
#if _runtime(_ObjC)
1316
internal let kCFDateIntervalFormatterNoStyle = CFDateIntervalFormatterStyle.noStyle
1417
internal let kCFDateIntervalFormatterShortStyle = CFDateIntervalFormatterStyle.shortStyle

Foundation/FileHandle.swift

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,12 @@
99

1010
import CoreFoundation
1111
import Dispatch
12+
#if os(Windows)
13+
import WinSDK
14+
#endif
15+
16+
@_implementationOnly
17+
import CoreFoundation_Private
1218

1319
// FileHandle has a .read(upToCount:) method. Just invoking read() will cause an ambiguity warning. Use _read instead.
1420
// Same with close()/.close().

Foundation/FileManager+POSIX.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ internal func &(left: UInt32, right: mode_t) -> mode_t {
1515

1616
import CoreFoundation
1717

18+
@_implementationOnly
19+
import CoreFoundation_Private
20+
1821
extension FileManager {
1922
internal func _mountedVolumeURLs(includingResourceValuesForKeys propertyKeys: [URLResourceKey]?, options: VolumeEnumerationOptions = []) -> [URL]? {
2023
var urls: [URL] = []

Foundation/FileManager+Win32.swift

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,12 @@
99

1010
import CoreFoundation
1111

12+
@_implementationOnly
13+
import CoreFoundation_Private
14+
1215
#if os(Windows)
16+
import WinSDK
17+
1318
internal func joinPath(prefix: String, suffix: String) -> String {
1419
var pszPath: PWSTR?
1520
_ = prefix.withCString(encodedAs: UTF16.self) { prefix in

0 commit comments

Comments
 (0)