From 0d39215b033aacde429d85a2efb70f93e5aa420c Mon Sep 17 00:00:00 2001 From: Jin Wang Date: Sun, 28 Feb 2016 21:38:16 +1100 Subject: [PATCH] Changed the module.map to module.modulemap in order to support the latest clang compiler. Removed several constants to support the latest ZeroMQ library. Change the import path to recursive in order to find the zmq.h file. --- .../module.map => zeromq/module.modulemap} | 0 SwiftZMQ.xcodeproj/project.pbxproj | 8 +++--- SwiftZMQ/Socket.swift | 28 +++++++++---------- 3 files changed, 18 insertions(+), 18 deletions(-) rename Dependencies/{ZeroMQ/module.map => zeromq/module.modulemap} (100%) diff --git a/Dependencies/ZeroMQ/module.map b/Dependencies/zeromq/module.modulemap similarity index 100% rename from Dependencies/ZeroMQ/module.map rename to Dependencies/zeromq/module.modulemap diff --git a/SwiftZMQ.xcodeproj/project.pbxproj b/SwiftZMQ.xcodeproj/project.pbxproj index 460776c..80f762d 100644 --- a/SwiftZMQ.xcodeproj/project.pbxproj +++ b/SwiftZMQ.xcodeproj/project.pbxproj @@ -53,7 +53,7 @@ 53C76A2F1C4EE1FE00F0357B /* libc++.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = "libc++.tbd"; path = "usr/lib/libc++.tbd"; sourceTree = SDKROOT; }; B00ED9E01BD8A2CD00BBBBAE /* SwiftZMQ.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = SwiftZMQ.framework; sourceTree = BUILT_PRODUCTS_DIR; }; B00ED9EA1BD8A2CD00BBBBAE /* SwiftZMQTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = SwiftZMQTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; - B00EDA021BD8A34B00BBBBAE /* module.map */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = "sourcecode.module-map"; path = module.map; sourceTree = ""; }; + B00EDA021BD8A34B00BBBBAE /* module.modulemap */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = "sourcecode.module-map"; path = module.modulemap; sourceTree = ""; }; B00EDA131BD9FE3C00BBBBAE /* zmq_swift.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = zmq_swift.h; sourceTree = ""; }; B00EDA361BDDD1FB00BBBBAE /* Context.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Context.swift; sourceTree = ""; }; B00EDA371BDDD1FB00BBBBAE /* CURVE.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CURVE.swift; sourceTree = ""; }; @@ -143,7 +143,7 @@ B00EDA001BD8A34B00BBBBAE /* ZeroMQ */ = { isa = PBXGroup; children = ( - B00EDA021BD8A34B00BBBBAE /* module.map */, + B00EDA021BD8A34B00BBBBAE /* module.modulemap */, B00EDA131BD9FE3C00BBBBAE /* zmq_swift.h */, ); name = ZeroMQ; @@ -580,7 +580,7 @@ PRODUCT_NAME = SwiftZMQ; SDKROOT = macosx; SKIP_INSTALL = YES; - SWIFT_INCLUDE_PATHS = "$(SRCROOT)/Dependencies"; + SWIFT_INCLUDE_PATHS = "$(SRCROOT)/Dependencies/**"; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; }; name = Debug; @@ -613,7 +613,7 @@ PRODUCT_NAME = SwiftZMQ; SDKROOT = macosx; SKIP_INSTALL = YES; - SWIFT_INCLUDE_PATHS = "$(SRCROOT)/Dependencies"; + SWIFT_INCLUDE_PATHS = "$(SRCROOT)/Dependencies/**"; }; name = Release; }; diff --git a/SwiftZMQ/Socket.swift b/SwiftZMQ/Socket.swift index 9aa7202..28a6326 100644 --- a/SwiftZMQ/Socket.swift +++ b/SwiftZMQ/Socket.swift @@ -137,7 +137,7 @@ public final class Socket { return message } - public func receive(bufferSize bufferSize: Int = 256, mode: ReceiveMode = []) throws -> [Int8]? { + public func receive(bufferSize bufferSize: Int = 1024, mode: ReceiveMode = []) throws -> [Int8]? { var buffer = [Int8](count: bufferSize, repeatedValue: 0) let result = zmq_recv(socket, &buffer, bufferSize, Int32(mode.rawValue)) @@ -439,9 +439,9 @@ extension Socket { try setOption(ZMQ_TCP_KEEPALIVE_INTVL, value: &value, length: strideof(Int32)) } - public func setTCPRetransmitTimeout(var value: Int32) throws { - try setOption(ZMQ_TCP_RETRANSMIT_TIMEOUT, value: &value, length: strideof(Int32)) - } +// public func setTCPRetransmitTimeout(var value: Int32) throws { +// try setOption(ZMQ_TCP_RETRANSMIT_TIMEOUT, value: &value, length: strideof(Int32)) +// } public func setTypeOfService(var value: Int32) throws { try setOption(ZMQ_TOS, value: &value, length: strideof(Int32)) @@ -458,10 +458,10 @@ extension Socket { try setOption(ZMQ_XPUB_VERBOSE, value: &v, length: strideof(Int32)) } - public func setXPubVerboseUnsubscribe(value: Bool) throws { - var v = value ? 1 : 0 - try setOption(ZMQ_XPUB_VERBOSE_UNSUBSCRIBE, value: &v, length: strideof(Int32)) - } +// public func setXPubVerboseUnsubscribe(value: Bool) throws { +// var v = value ? 1 : 0 +// try setOption(ZMQ_XPUB_VERBOSE_UNSUBSCRIBE, value: &v, length: strideof(Int32)) +// } public func setXPubManual(value: Bool) throws { var v = value ? 1 : 0 @@ -778,12 +778,12 @@ extension Socket { return value } - public func getTCPRetransmitTimeout() throws -> Int32 { - var value: Int32 = 0 - var length = strideof(Int32) - try getOption(ZMQ_TCP_RETRANSMIT_TIMEOUT, value: &value, length: &length) - return value - } +// public func getTCPRetransmitTimeout() throws -> Int32 { +// var value: Int32 = 0 +// var length = strideof(Int32) +// try getOption(ZMQ_TCP_RETRANSMIT_TIMEOUT, value: &value, length: &length) +// return value +// } public func getThreadSafe() throws -> Bool { var value: Int32 = 0