Переглянути джерело

Changed Lock to "NSLock" for Swift 2.2.x.

Damian Kołakowski 10 роки тому
батько
коміт
f42a37e7d5

+ 1 - 4
Package.swift

@@ -1,8 +1,5 @@
 import PackageDescription
 
 let package = Package(
-    name: "Swifter",
-    dependencies: [
-        .Package(url: "https://github.com/johnno1962/NSLinux.git", majorVersion: 1),
-    ]
+    name: "Swifter"
 )

+ 1 - 1
Sources/HttpResponse.swift

@@ -38,7 +38,7 @@ public enum HttpResponseBody {
                         $0.write(data)
                     })
                 #else
-                    guard JSONSerialization.isValidJSONObject(object) else {
+                    guard NSJSONSerialization.isValidJSONObject(object) else {
                         throw SerializationError.InvalidObject
                     }
                     let json = try NSJSONSerialization.dataWithJSONObject(object, options: NSJSONWritingOptions.PrettyPrinted)

+ 3 - 3
Sources/HttpServerIO.swift

@@ -15,7 +15,7 @@ public class HttpServerIO {
     
     private var listenSocket: Socket = Socket(socketFileDescriptor: -1)
     private var clientSockets: Set<Socket> = []
-    private let clientSocketsLock = Lock()
+    private let clientSocketsLock = NSLock()
     
     public func start(listenPort: in_port_t = 8080, forceIPv4: Bool = false) throws {
         stop()
@@ -75,7 +75,7 @@ public class HttpServerIO {
         socket.release()
     }
     
-    private func lock(handle: Lock, closure: () -> ()) {
+    private func lock(handle: NSLock, closure: () -> ()) {
         handle.lock()
         closure()
         handle.unlock();
@@ -127,7 +127,7 @@ public class HttpServerIO {
     
     import Glibc
 
-    public class Lock {
+    public class NSLock {
     
         private var mutex = pthread_mutex_t()
 	    

+ 3 - 1
Swifter.xcodeproj/project.pbxproj

@@ -472,7 +472,7 @@
 			isa = PBXProject;
 			attributes = {
 				LastSwiftUpdateCheck = 0720;
-				LastUpgradeCheck = 0700;
+				LastUpgradeCheck = 0730;
 				ORGANIZATIONNAME = "Damian Kołakowski";
 				TargetAttributes = {
 					7AE893E61C05127900A29F63 = {
@@ -943,6 +943,7 @@
 		7CCD87651C66099B0068099B /* Debug */ = {
 			isa = XCBuildConfiguration;
 			buildSettings = {
+				COMBINE_HIDPI_IMAGES = YES;
 				DEBUG_INFORMATION_FORMAT = dwarf;
 				GCC_NO_COMMON_BLOCKS = YES;
 				INFOPLIST_FILE = SwifteriOSTests/Info.plist;
@@ -957,6 +958,7 @@
 		7CCD87661C66099B0068099B /* Release */ = {
 			isa = XCBuildConfiguration;
 			buildSettings = {
+				COMBINE_HIDPI_IMAGES = YES;
 				COPY_PHASE_STRIP = NO;
 				DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
 				GCC_NO_COMMON_BLOCKS = YES;

+ 1 - 1
Swifter.xcodeproj/xcshareddata/xcschemes/SwifterMac.xcscheme

@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <Scheme
-   LastUpgradeVersion = "0710"
+   LastUpgradeVersion = "0730"
    version = "1.3">
    <BuildAction
       parallelizeBuildables = "YES"

+ 1 - 1
Swifter.xcodeproj/xcshareddata/xcschemes/SwifteriOS.xcscheme

@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <Scheme
-   LastUpgradeVersion = "0710"
+   LastUpgradeVersion = "0730"
    version = "1.3">
    <BuildAction
       parallelizeBuildables = "YES"