diff --git a/.gitignore b/.gitignore index c5d71aa..06777ef 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,3 @@ .build .DS_Store -Strand.xcodeproj/project.xcworkspace/xcuserdata -Strand.xcodeproj/xcuserdata +*.xcodeproj diff --git a/.swift-version b/.swift-version new file mode 100644 index 0000000..f5633aa --- /dev/null +++ b/.swift-version @@ -0,0 +1 @@ +DEVELOPMENT-SNAPSHOT-2016-05-31-a diff --git a/Sources/Strand.swift b/Sources/Strand.swift index f2671c6..8e4a580 100644 --- a/Sources/Strand.swift +++ b/Sources/Strand.swift @@ -39,11 +39,7 @@ public class Strand { public init(closure: () -> Void) throws { let holder = Unmanaged.passRetained(StrandClosure(closure: closure)) - #if swift(>=3.0) - let pointer = UnsafeMutablePointer(OpaquePointer(bitPattern: holder)) - #else - let pointer = UnsafeMutablePointer(holder.toOpaque()) - #endif + let pointer = UnsafeMutablePointer(holder.toOpaque()) #if swift(>=3.0) #if os(Linux) @@ -96,7 +92,8 @@ public class Strand { #if swift(>=3.0) private func runner(arg: UnsafeMutablePointer?) -> UnsafeMutablePointer? { - let unmanaged = Unmanaged.fromOpaque(OpaquePointer(arg!)) + guard let arg = arg else { return nil } + let unmanaged = Unmanaged.fromOpaque(arg) unmanaged.takeUnretainedValue().closure() unmanaged.release() return nil diff --git a/Strand.xcodeproj/project.pbxproj b/Strand.xcodeproj/project.pbxproj deleted file mode 100644 index 5b7ca8b..0000000 --- a/Strand.xcodeproj/project.pbxproj +++ /dev/null @@ -1,205 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 46; - objects = { - -/* Begin PBXBuildFile section */ - __src_cc_ref_Sources/Strand.swift /* Strand.swift in Sources */ = {isa = PBXBuildFile; fileRef = __PBXFileRef_Sources/Strand.swift /* Strand.swift */; }; -/* End PBXBuildFile section */ - -/* Begin PBXFileReference section */ - __PBXFileRef_Package.swift /* Package.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = Package.swift; path = "/Users/james/Documents/vagrant-swift/Strand/Package.swift"; sourceTree = ""; }; - __PBXFileRef_Sources/Strand.swift /* Strand.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Strand.swift; sourceTree = ""; }; - "_____Product_Strand" /* libStrand.dylib */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.dylib"; path = libStrand.dylib; sourceTree = BUILT_PRODUCTS_DIR; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - "___LinkPhase_Strand" /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 0; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - Dependencies_ /* Dependencies */ = { - isa = PBXGroup; - children = ( - ); - name = Dependencies; - sourceTree = ""; - }; - "___RootGroup_" = { - isa = PBXGroup; - children = ( - __PBXFileRef_Package.swift /* Package.swift */, - "_____Sources_" /* Sources */, - Dependencies_ /* Dependencies */, - "_______Tests_" /* Tests */, - "____Products_" /* Products */, - ); - sourceTree = ""; - }; - "____Products_" /* Products */ = { - isa = PBXGroup; - children = ( - "_____Product_Strand" /* libStrand.dylib */, - ); - name = Products; - sourceTree = ""; - }; - "_____Sources_" /* Sources */ = { - isa = PBXGroup; - children = ( - "_______Group_Strand" /* Strand */, - ); - name = Sources; - sourceTree = ""; - }; - "_______Group_Strand" /* Strand */ = { - isa = PBXGroup; - children = ( - __PBXFileRef_Sources/Strand.swift /* Strand.swift */, - ); - name = Strand; - path = Sources; - sourceTree = ""; - }; - "_______Tests_" /* Tests */ = { - isa = PBXGroup; - children = ( - ); - name = Tests; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXNativeTarget section */ - "______Target_Strand" /* Strand */ = { - isa = PBXNativeTarget; - buildConfigurationList = "_______Confs_Strand" /* Build configuration list for PBXNativeTarget "Strand" */; - buildPhases = ( - CompilePhase_Strand /* Sources */, - "___LinkPhase_Strand" /* Frameworks */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = Strand; - productName = Strand; - productReference = "_____Product_Strand" /* libStrand.dylib */; - productType = "com.apple.product-type.library.dynamic"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - __RootObject_ /* Project object */ = { - isa = PBXProject; - attributes = { - LastUpgradeCheck = 9999; - }; - buildConfigurationList = "___RootConfs_" /* Build configuration list for PBXProject "Strand" */; - compatibilityVersion = "Xcode 3.2"; - developmentRegion = English; - hasScannedForEncodings = 0; - knownRegions = ( - en, - ); - mainGroup = "___RootGroup_"; - productRefGroup = "____Products_" /* Products */; - projectDirPath = ""; - projectRoot = ""; - targets = ( - "______Target_Strand" /* Strand */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXSourcesBuildPhase section */ - CompilePhase_Strand /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 0; - files = ( - __src_cc_ref_Sources/Strand.swift /* Strand.swift in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin XCBuildConfiguration section */ - _ReleaseConf_Strand /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - COMBINE_HIDPI_IMAGES = YES; - DYLIB_INSTALL_NAME_BASE = "$(CONFIGURATION_BUILD_DIR)"; - ENABLE_TESTABILITY = YES; - LD_RUNPATH_SEARCH_PATHS = "$(TOOLCHAIN_DIR)/usr/lib/swift/macosx"; - MACOSX_DEPLOYMENT_TARGET = 10.10; - OTHER_CFLAGS = ""; - OTHER_LDFLAGS = ""; - OTHER_SWIFT_FLAGS = "-DXcode"; - PRODUCT_MODULE_NAME = Strand; - PRODUCT_NAME = "lib$(TARGET_NAME)"; - }; - name = Release; - }; - "___DebugConf_Strand" /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - COMBINE_HIDPI_IMAGES = YES; - DYLIB_INSTALL_NAME_BASE = "$(CONFIGURATION_BUILD_DIR)"; - ENABLE_TESTABILITY = YES; - LD_RUNPATH_SEARCH_PATHS = "$(TOOLCHAIN_DIR)/usr/lib/swift/macosx"; - MACOSX_DEPLOYMENT_TARGET = 10.10; - OTHER_CFLAGS = ""; - OTHER_LDFLAGS = ""; - OTHER_SWIFT_FLAGS = "-DXcode"; - PRODUCT_MODULE_NAME = Strand; - PRODUCT_NAME = "lib$(TARGET_NAME)"; - SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - }; - name = Debug; - }; - "_____Release_" /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - }; - name = Release; - }; - "_______Debug_" /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - }; - name = Debug; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - "___RootConfs_" /* Build configuration list for PBXProject "Strand" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - "_______Debug_" /* Debug */, - "_____Release_" /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Debug; - }; - "_______Confs_Strand" /* Build configuration list for PBXNativeTarget "Strand" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - "___DebugConf_Strand" /* Debug */, - _ReleaseConf_Strand /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Debug; - }; -/* End XCConfigurationList section */ - }; - rootObject = __RootObject_ /* Project object */; -} diff --git a/Strand.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/Strand.xcodeproj/project.xcworkspace/contents.xcworkspacedata deleted file mode 100644 index 5cc8618..0000000 --- a/Strand.xcodeproj/project.xcworkspace/contents.xcworkspacedata +++ /dev/null @@ -1,7 +0,0 @@ - - - - - diff --git a/Strand.xcodeproj/xcshareddata/xcschemes/Strand.xcscheme b/Strand.xcodeproj/xcshareddata/xcschemes/Strand.xcscheme deleted file mode 100644 index cf6adfc..0000000 --- a/Strand.xcodeproj/xcshareddata/xcschemes/Strand.xcscheme +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - - - - - - - - - diff --git a/Strand.xcodeproj/xcshareddata/xcschemes/xcschememanagement.plist b/Strand.xcodeproj/xcshareddata/xcschemes/xcschememanagement.plist deleted file mode 100644 index 31837c2..0000000 --- a/Strand.xcodeproj/xcshareddata/xcschemes/xcschememanagement.plist +++ /dev/null @@ -1,12 +0,0 @@ - - - - SchemeUserState - - Strand.xcscheme - - - SuppressBuildableAutocreation - - -