Skip to content

Commit e6a0cb9

Browse files
johnno1962parkera
authored andcommitted
Android changes for Swift 4.1 cherrypicked into 4.2 (#1631)
* Changes required for swift-4.1-branch port to Android * Remove contentious wokrarounds * Centralise test imports and add os(Android) * Leave imports in xdgTestHelper.swift
1 parent 9ac09f5 commit e6a0cb9

File tree

98 files changed

+86
-795
lines changed

Some content is hidden

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

98 files changed

+86
-795
lines changed

CoreFoundation/Base.subproj/CFInternal.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ extern void __CFGenericValidateType_(CFTypeRef cf, CFTypeID type, const char *fu
216216
#define __CFBitfield64GetValue(V, N1, N2) (((V) & __CFBitfield64Mask(N1, N2)) >> (N2))
217217
#define __CFBitfield64SetValue(V, N1, N2, X) ((V) = ((V) & ~__CFBitfield64Mask(N1, N2)) | ((((uint64_t)X) << (N2)) & __CFBitfield64Mask(N1, N2)))
218218

219-
#if __LP64__
219+
#if __LP64__ || DEPLOYMENT_TARGET_ANDROID
220220
typedef uint64_t __CFInfoType;
221221
#define __CFInfoMask(N1, N2) __CFBitfield64Mask(N1, N2)
222222
#else

CoreFoundation/Base.subproj/CFKnownLocations.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ CFURLRef _Nullable _CFKnownLocationCreatePreferencesURLForUser(CFKnownLocationUs
4545
}
4646

4747
}
48-
#elif !DEPLOYMENT_RUNTIME_OBJC && !DEPLOYMENT_TARGET_WINDOWS
48+
#elif !DEPLOYMENT_RUNTIME_OBJC && !DEPLOYMENT_TARGET_WINDOWS && !DEPLOYMENT_TARGET_ANDROID
4949

5050
/*
5151
Building for an OS that uses the FHS, BSD's hier(7), and/or the XDG specification for paths:

CoreFoundation/Base.subproj/CFPlatform.c

+3
Original file line numberDiff line numberDiff line change
@@ -297,6 +297,9 @@ CF_EXPORT CFStringRef CFCopyFullUserName(void) {
297297
uid_t euid;
298298
__CFGetUGIDs(&euid, NULL);
299299
struct passwd *upwd = getpwuid(euid ? euid : getuid());
300+
#if DEPLOYMENT_TARGET_ANDROID
301+
#define pw_gecos pw_name
302+
#endif
300303
if (upwd && upwd->pw_gecos) {
301304
result = CFStringCreateWithCString(kCFAllocatorSystemDefault, upwd->pw_gecos, kCFPlatformInterfaceStringEncoding);
302305
}

CoreFoundation/Base.subproj/CFUtilities.c

+1
Original file line numberDiff line numberDiff line change
@@ -1000,6 +1000,7 @@ void CFLog1(CFLogLevel lev, CFStringRef message) {
10001000
CFStringGetCString(message, buffer, maxLength, encoding);
10011001

10021002
__android_log_print(priority, tag, "%s", buffer);
1003+
fprintf(stderr, "%s\n", buffer);
10031004

10041005
if (buffer != &stack_buffer[0]) free(buffer);
10051006
#else

CoreFoundation/Base.subproj/ForSwiftFoundationOnly.h

+2
Original file line numberDiff line numberDiff line change
@@ -403,6 +403,8 @@ static inline _Bool _withStackOrHeapBuffer(size_t amount, void (__attribute__((n
403403
static inline int _direntNameLength(struct dirent *entry) {
404404
#ifdef _D_EXACT_NAMLEN // defined on Linux
405405
return _D_EXACT_NAMLEN(entry);
406+
#elif DEPLOYMENT_TARGET_ANDROID
407+
return strlen(entry->d_name);
406408
#else
407409
return entry->d_namlen;
408410
#endif

CoreFoundation/NumberDate.subproj/CFTimeZone.c

+9
Original file line numberDiff line numberDiff line change
@@ -813,6 +813,15 @@ static CFTimeZoneRef __CFTimeZoneCreateSystem(void) {
813813
CFRelease(name);
814814
if (result) return result;
815815
}
816+
#if DEPLOYMENT_TARGET_ANDROID
817+
// Timezone database by name not available on Android.
818+
// Approximate with gmtoff - could be general default.
819+
struct tm info;
820+
time_t now = time(NULL);
821+
if (NULL != localtime_r(&now, &info)) {
822+
return CFTimeZoneCreateWithTimeIntervalFromGMT(kCFAllocatorSystemDefault, info.tm_gmtoff);
823+
}
824+
#endif
816825
return CFTimeZoneCreateWithTimeIntervalFromGMT(kCFAllocatorSystemDefault, 0.0);
817826
}
818827

CoreFoundation/PlugIn.subproj/CFBundle.c

+4-4
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ static void _CFBundleEnsureBundlesExistForImagePaths(CFArrayRef imagePaths);
137137

138138
#pragma mark -
139139

140-
#if !DEPLOYMENT_RUNTIME_OBJC && !DEPLOYMENT_TARGET_WINDOWS
140+
#if !DEPLOYMENT_RUNTIME_OBJC && !DEPLOYMENT_TARGET_WINDOWS && !DEPLOYMENT_TARGET_ANDROID
141141

142142
// Functions and constants for FHS bundles:
143143
#define _CFBundleFHSDirectory_share CFSTR("share")
@@ -162,10 +162,10 @@ static Boolean _CFBundleURLIsForFHSInstalledBundle(CFURLRef bundleURL) {
162162

163163
return isFHSBundle;
164164
}
165-
#endif // !DEPLOYMENT_RUNTIME_OBJC && !DEPLOYMENT_TARGET_WINDOWS
165+
#endif // !DEPLOYMENT_RUNTIME_OBJC && !DEPLOYMENT_TARGET_WINDOWS && !DEPLOYMENT_TARGET_ANDROID
166166

167167
Boolean _CFBundleSupportsFHSBundles() {
168-
#if !DEPLOYMENT_RUNTIME_OBJC && !DEPLOYMENT_TARGET_WINDOWS
168+
#if !DEPLOYMENT_RUNTIME_OBJC && !DEPLOYMENT_TARGET_WINDOWS && !DEPLOYMENT_TARGET_ANDROID
169169
return true;
170170
#else
171171
return false;
@@ -714,7 +714,7 @@ static CFBundleRef _CFBundleCreate(CFAllocatorRef allocator, CFURLRef bundleURL,
714714

715715
bundle->_url = newURL;
716716

717-
#if !DEPLOYMENT_RUNTIME_OBJC && !DEPLOYMENT_TARGET_WINDOWS
717+
#if !DEPLOYMENT_RUNTIME_OBJC && !DEPLOYMENT_TARGET_WINDOWS && !DEPLOYMENT_TARGET_ANDROID
718718
bundle->_isFHSInstalledBundle = _CFBundleURLIsForFHSInstalledBundle(newURL);
719719
#endif
720720

CoreFoundation/PlugIn.subproj/CFBundle_Executable.c

+7-7
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
#include <dlfcn.h>
1616
#endif
1717

18-
#if !DEPLOYMENT_RUNTIME_OBJC && !DEPLOYMENT_TARGET_WINDOWS
18+
#if !DEPLOYMENT_RUNTIME_OBJC && !DEPLOYMENT_TARGET_WINDOWS && !DEPLOYMENT_TARGET_ANDROID
1919

2020
#if DEPLOYMENT_TARGET_LINUX
2121
#if __LP64__
@@ -48,7 +48,7 @@
4848
_kCFBundleFHSDirectory_lib
4949
#endif // DEPLOYMENT_TARGET_LINUX
5050

51-
#endif // !DEPLOYMENT_RUNTIME_OBJC && !DEPLOYMENT_TARGET_WINDOWS
51+
#endif // !DEPLOYMENT_RUNTIME_OBJC && !DEPLOYMENT_TARGET_WINDOWS && !DEPLOYMENT_TARGET_ANDROID
5252

5353
// This is here because on iPhoneOS with the dyld shared cache, we remove binaries from their
5454
// original locations on disk, so checking whether a binary's path exists is no longer sufficient.
@@ -73,7 +73,7 @@ static CFURLRef _CFBundleCopyExecutableURLRaw(CFURLRef urlPath, CFStringRef exeN
7373
CFURLRef executableURL = NULL;
7474
if (!urlPath || !exeName) return NULL;
7575

76-
#if !DEPLOYMENT_RUNTIME_OBJC && !DEPLOYMENT_TARGET_WINDOWS
76+
#if !DEPLOYMENT_RUNTIME_OBJC && !DEPLOYMENT_TARGET_WINDOWS && !DEPLOYMENT_TARGET_ANDROID
7777
if (!executableURL) {
7878
executableURL = CFURLCreateWithFileSystemPathRelativeToBase(kCFAllocatorSystemDefault, exeName, kCFURLPOSIXPathStyle, false, urlPath);
7979
if (!_binaryLoadable(executableURL)) {
@@ -203,7 +203,7 @@ static CFURLRef _CFBundleCopyExecutableURLInDirectory2(CFBundleRef bundle, CFURL
203203
Boolean doExecSearch = true;
204204
#endif
205205

206-
#if !DEPLOYMENT_RUNTIME_OBJC && !DEPLOYMENT_TARGET_WINDOWS
206+
#if !DEPLOYMENT_RUNTIME_OBJC && !DEPLOYMENT_TARGET_WINDOWS && !DEPLOYMENT_TARGET_ANDROID
207207
if (lookupMainExe && bundle && bundle->_isFHSInstalledBundle) {
208208
// For a FHS installed bundle, the URL points to share/Bundle.resources, and the binary is in:
209209

@@ -227,13 +227,13 @@ static CFURLRef _CFBundleCopyExecutableURLInDirectory2(CFBundleRef bundle, CFURL
227227

228228
CFRelease(prefixPath);
229229
}
230-
#endif // !DEPLOYMENT_RUNTIME_OBJC && !DEPLOYMENT_TARGET_WINDOWS
230+
#endif // !DEPLOYMENT_RUNTIME_OBJC && !DEPLOYMENT_TARGET_WINDOWS && !DEPLOYMENT_TARGET_ANDROID
231231

232232
// Now, look for the executable inside the bundle.
233233
if (!foundIt && doExecSearch && 0 != version) {
234234
CFURLRef exeDirURL = NULL;
235235

236-
#if !DEPLOYMENT_RUNTIME_OBJC && !DEPLOYMENT_TARGET_WINDOWS
236+
#if !DEPLOYMENT_RUNTIME_OBJC && !DEPLOYMENT_TARGET_WINDOWS && !DEPLOYMENT_TARGET_ANDROID
237237
if (bundle && bundle->_isFHSInstalledBundle) {
238238
CFURLRef withoutExtension = CFURLCreateCopyDeletingPathExtension(kCFAllocatorSystemDefault, url);
239239
CFStringRef lastPathComponent = CFURLCopyLastPathComponent(withoutExtension);
@@ -248,7 +248,7 @@ static CFURLRef _CFBundleCopyExecutableURLInDirectory2(CFBundleRef bundle, CFURL
248248
CFRelease(libexec);
249249
CFRelease(exeDirName);
250250
} else
251-
#endif // !DEPLOYMENT_RUNTIME_OBJC && !DEPLOYMENT_TARGET_WINDOWS
251+
#endif // !DEPLOYMENT_RUNTIME_OBJC && !DEPLOYMENT_TARGET_WINDOWS && !DEPLOYMENT_TARGET_ANDROID
252252
if (1 == version) {
253253
exeDirURL = CFURLCreateWithString(kCFAllocatorSystemDefault, _CFBundleExecutablesURLFromBase1, url);
254254
} else if (2 == version) {

CoreFoundation/PlugIn.subproj/CFBundle_Internal.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ CF_EXTERN_C_BEGIN
3131
#endif
3232

3333
// FHS bundles are supported on the Swift and C runtimes, except on Windows.
34-
#if !DEPLOYMENT_RUNTIME_OBJC && !DEPLOYMENT_TARGET_WINDOWS
34+
#if !DEPLOYMENT_RUNTIME_OBJC && !DEPLOYMENT_TARGET_WINDOWS && !DEPLOYMENT_TARGET_ANDROID
3535

3636
#if DEPLOYMENT_TARGET_LINUX || DEPLOYMENT_TARGET_FREEBSD
3737
#define _CFBundleFHSSharedLibraryFilenamePrefix CFSTR("lib")
@@ -43,7 +43,7 @@ CF_EXTERN_C_BEGIN
4343
#error Disable FHS bundles or specify shared library prefixes and suffixes for this platform.
4444
#endif // DEPLOYMENT_TARGET_…
4545

46-
#endif // !DEPLOYMENT_RUNTIME_OBJC && !DEPLOYMENT_TARGET_WINDOWS
46+
#endif // !DEPLOYMENT_RUNTIME_OBJC && !DEPLOYMENT_TARGET_WINDOWS && !DEPLOYMENT_TARGET_ANDROID
4747

4848
#define CFBundleExecutableNotFoundError 4
4949
#define CFBundleExecutableNotLoadableError 3584

CoreFoundation/URL.subproj/CFURL.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,10 @@
2525
#include <unistd.h>
2626
#include <sys/stat.h>
2727
#include <sys/types.h>
28-
#if __has_include(<sys/syslog.h>)
29-
#include <sys/syslog.h>
30-
#elif __has_include(<syslog.h>)
28+
#if __has_include(<syslog.h>)
3129
#include <syslog.h>
30+
#else
31+
#include <sys/syslog.h>
3232
#endif
3333
#include <CoreFoundation/CFURLPriv.h>
3434
#endif

Foundation.xcodeproj/project.pbxproj

+4
Original file line numberDiff line numberDiff line change
@@ -344,6 +344,7 @@
344344
B9974B9A1EDF4A22007F15B8 /* HTTPMessage.swift in Sources */ = {isa = PBXBuildFile; fileRef = B9974B931EDF4A22007F15B8 /* HTTPMessage.swift */; };
345345
B9974B9B1EDF4A22007F15B8 /* BodySource.swift in Sources */ = {isa = PBXBuildFile; fileRef = B9974B941EDF4A22007F15B8 /* BodySource.swift */; };
346346
B9974B9C1EDF4A22007F15B8 /* EasyHandle.swift in Sources */ = {isa = PBXBuildFile; fileRef = B9974B951EDF4A22007F15B8 /* EasyHandle.swift */; };
347+
BB3D7558208A1E500085CFDC /* TestImports.swift in Sources */ = {isa = PBXBuildFile; fileRef = BB3D7557208A1E500085CFDC /* TestImports.swift */; };
347348
BD8042161E09857800487EB8 /* TestLengthFormatter.swift in Sources */ = {isa = PBXBuildFile; fileRef = BD8042151E09857800487EB8 /* TestLengthFormatter.swift */; };
348349
BDBB65901E256BFA001A7286 /* TestEnergyFormatter.swift in Sources */ = {isa = PBXBuildFile; fileRef = BDBB658F1E256BFA001A7286 /* TestEnergyFormatter.swift */; };
349350
BDFDF0A71DFF5B3E00C04CC5 /* TestPersonNameComponents.swift in Sources */ = {isa = PBXBuildFile; fileRef = BDFDF0A61DFF5B3E00C04CC5 /* TestPersonNameComponents.swift */; };
@@ -825,6 +826,7 @@
825826
B9974B931EDF4A22007F15B8 /* HTTPMessage.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = HTTPMessage.swift; path = http/HTTPMessage.swift; sourceTree = "<group>"; };
826827
B9974B941EDF4A22007F15B8 /* BodySource.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = BodySource.swift; sourceTree = "<group>"; };
827828
B9974B951EDF4A22007F15B8 /* EasyHandle.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = EasyHandle.swift; sourceTree = "<group>"; };
829+
BB3D7557208A1E500085CFDC /* TestImports.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TestImports.swift; sourceTree = "<group>"; };
828830
BD8042151E09857800487EB8 /* TestLengthFormatter.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TestLengthFormatter.swift; sourceTree = "<group>"; };
829831
BDBB658F1E256BFA001A7286 /* TestEnergyFormatter.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TestEnergyFormatter.swift; sourceTree = "<group>"; };
830832
BDFDF0A61DFF5B3E00C04CC5 /* TestPersonNameComponents.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TestPersonNameComponents.swift; sourceTree = "<group>"; };
@@ -1431,6 +1433,7 @@
14311433
children = (
14321434
1520469A1D8AEABE00D02E36 /* HTTPServer.swift */,
14331435
EA66F6381BF1619600136161 /* main.swift */,
1436+
BB3D7557208A1E500085CFDC /* TestImports.swift */,
14341437
9F4ADBCF1ECD4F56001F0B3D /* xdgTestHelper */,
14351438
EA66F65A1BF1976100136161 /* Tests */,
14361439
EA66F6391BF1619600136161 /* Resources */,
@@ -2442,6 +2445,7 @@
24422445
90E645DF1E4C89A400D0D47C /* TestNSCache.swift in Sources */,
24432446
5B13B34A1C582D4C00651CE2 /* TestURL.swift in Sources */,
24442447
EA54A6FB1DB16D53009E0809 /* TestObjCRuntime.swift in Sources */,
2448+
BB3D7558208A1E500085CFDC /* TestImports.swift in Sources */,
24452449
5B13B34D1C582D4C00651CE2 /* TestNSUUID.swift in Sources */,
24462450
5B13B3281C582D4C00651CE2 /* TestBundle.swift in Sources */,
24472451
5B13B32A1C582D4C00651CE2 /* TestCharacterSet.swift in Sources */,

Foundation/Bundle.swift

+4-2
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,10 @@ open class Bundle: NSObject {
5353
self.init(path: url.path)
5454
}
5555

56-
public init(for aClass: AnyClass) { NSUnimplemented() }
57-
56+
public init(for aClass: AnyClass) {
57+
NSUnimplemented()
58+
}
59+
5860
public init?(identifier: String) {
5961
super.init()
6062

Foundation/FileManager.swift

+7-4
Original file line numberDiff line numberDiff line change
@@ -375,10 +375,13 @@ open class FileManager : NSObject {
375375

376376
This method replaces fileSystemAttributesAtPath:.
377377
*/
378+
#if os(Android)
379+
@available(*, unavailable, message: "Unsuppported on this platform")
380+
open func attributesOfFileSystem(forPath path: String) throws -> [FileAttributeKey : Any] {
381+
NSUnsupported()
382+
}
383+
#else
378384
open func attributesOfFileSystem(forPath path: String) throws -> [FileAttributeKey : Any] {
379-
#if os(Android)
380-
NSUnimplemented()
381-
#else
382385
// statvfs(2) doesn't support 64bit inode on Darwin (apfs), fallback to statfs(2)
383386
#if os(macOS) || os(iOS)
384387
var s = statfs()
@@ -407,8 +410,8 @@ open class FileManager : NSObject {
407410
result[.systemFreeNodes] = NSNumber(value: UInt64(s.f_ffree))
408411

409412
return result
410-
#endif
411413
}
414+
#endif
412415

413416
/* createSymbolicLinkAtPath:withDestination:error: returns YES if the symbolic link that point at 'destPath' was able to be created at the location specified by 'path'. If this method returns NO, the link was unable to be created and an NSError will be returned by reference in the 'error' parameter. This method does not traverse a terminal symlink.
414417

Foundation/NSCFString.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,8 @@ internal final class _NSCFConstantString : _NSCFString {
7171
// FIXME: Split expression as a work-around for slow type
7272
// checking (tracked by SR-5322).
7373
let offTemp1 = MemoryLayout<OpaquePointer>.size + MemoryLayout<uintptr_t>.size
74-
let offTemp2 = MemoryLayout<_CFInfo>.size
75-
return offTemp1 + offTemp2 + MemoryLayout<UnsafePointer<UInt8>>.size
74+
let offset = offTemp1 + MemoryLayout<_CFInfo>.size
75+
return offset + MemoryLayout<UnsafePointer<UInt8>>.size
7676
}
7777

7878
private var _lenPtr : UnsafeMutableRawPointer {

Foundation/NSTimeZone.swift

-8
Original file line numberDiff line numberDiff line change
@@ -179,14 +179,6 @@ open class NSTimeZone : NSObject, NSCopying, NSSecureCoding, NSCoding {
179179
extension NSTimeZone {
180180

181181
open class var system: TimeZone {
182-
#if os(Android)
183-
var now = time(nil), info = tm()
184-
if localtime_r(&now, &info) != nil {
185-
// NOTE: this is not a real time zone but a fixed offset from GMT.
186-
// It will be incorrect outside the current daylight saving period.
187-
return TimeZone(reference: NSTimeZone(forSecondsFromGMT: info.tm_gmtoff))
188-
}
189-
#endif
190182
return CFTimeZoneCopySystem()._swiftObject
191183
}
192184

TestFoundation/HTTPServer.swift

+2-10
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,9 @@
1414

1515
import Dispatch
1616

17-
#if DEPLOYMENT_RUNTIME_OBJC || os(Linux)
18-
import Foundation
19-
import XCTest
20-
#else
21-
import SwiftFoundation
22-
import SwiftXCTest
23-
#endif
24-
25-
#if os(macOS) || os(iOS)
17+
#if canImport(Darwin)
2618
import Darwin
27-
#elseif os(Linux)
19+
#elseif canImport(Glibc)
2820
import Glibc
2921
#endif
3022

TestFoundation/TestAffineTransform.swift

-11
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,6 @@
77
// See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
88
//
99

10-
11-
12-
#if DEPLOYMENT_RUNTIME_OBJC || os(Linux)
13-
import Foundation
14-
import XCTest
15-
#else
16-
import SwiftFoundation
17-
import SwiftXCTest
18-
#endif
19-
20-
2110
class TestAffineTransform : XCTestCase {
2211
private let accuracyThreshold = 0.001
2312

TestFoundation/TestBundle.swift

-9
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,6 @@
77
// See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
88
//
99

10-
11-
#if DEPLOYMENT_RUNTIME_OBJC || os(Linux)
12-
import Foundation
13-
import XCTest
14-
#else
15-
import SwiftFoundation
16-
import SwiftXCTest
17-
#endif
18-
1910
import CoreFoundation
2011

2112
internal func testBundle() -> Bundle {

TestFoundation/TestByteCountFormatter.swift

-12
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,6 @@
77
// See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
88
//
99

10-
11-
12-
#if DEPLOYMENT_RUNTIME_OBJC || os(Linux)
13-
import Foundation
14-
import XCTest
15-
#else
16-
import SwiftFoundation
17-
import SwiftXCTest
18-
#endif
19-
20-
21-
2210
class TestByteCountFormatter : XCTestCase {
2311

2412
static var allTests: [(String, (TestByteCountFormatter) -> () throws -> Void)] {

TestFoundation/TestCalendar.swift

-8
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,6 @@
77
// See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
88
//
99

10-
#if DEPLOYMENT_RUNTIME_OBJC || os(Linux)
11-
import Foundation
12-
import XCTest
13-
#else
14-
import SwiftFoundation
15-
import SwiftXCTest
16-
#endif
17-
1810
class TestCalendar: XCTestCase {
1911

2012
static var allTests: [(String, (TestCalendar) -> () throws -> Void)] {

TestFoundation/TestCharacterSet.swift

-8
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,6 @@
77
// See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
88
//
99

10-
#if DEPLOYMENT_RUNTIME_OBJC || os(Linux)
11-
import Foundation
12-
import XCTest
13-
#else
14-
import SwiftFoundation
15-
import SwiftXCTest
16-
#endif
17-
1810
private struct Box: Equatable {
1911
private let ns: NSCharacterSet
2012
private let swift: CharacterSet

0 commit comments

Comments
 (0)