Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor fixes and GNUstep subproject files #1

Open
wants to merge 13 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Classes/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
obj
40 changes: 40 additions & 0 deletions Classes/GNUmakefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# ObjectiveZMQ

ifeq ($(GNUSTEP_MAKEFILES),)
GNUSTEP_MAKEFILES := $(shell gnustep-config --variable=GNUSTEP_MAKEFILES 2>/dev/null)
endif

ifeq ($(GNUSTEP_MAKEFILES),)
$(error You need to set GNUSTEP_MAKEFILES before compiling!)
endif

include $(GNUSTEP_MAKEFILES)/common.make

GNUSTEP_HOST_OS := $(shell gnustep-config --variable=GNUSTEP_HOST_OS 2>/dev/null)


SUBPROJECT_NAME = ObjectiveZMQ

ADDITIONAL_CPPFLAGS += -std=c99 -fobjc-arc
ADDITIONAL_OBJC_LIBS += -ldispatch
ADDITIONAL_CXX_LIBS += -lstdc++

ObjectiveZMQ_OBJC_FILES += \
NSData+ZMQMessage.m \
OZContext.m \
OZMessage.m \
OZSocket+Private.m \
OZSocket+Receive.m \
OZSocket+Send.m \
OZSocket+Subclass.m \
OZSocket.m \
OZSocketPub.m \
OZSocketRep.m \
OZSocketReq.m \
OZSocketSub.m \
OZSocketPull.m \
OZSocketPush.m \

-include GNUmakefile.preamble
include $(GNUSTEP_MAKEFILES)/subproject.make
-include GNUmakefile.postamble
1 change: 1 addition & 0 deletions Classes/OZContext.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
//

#import <Foundation/Foundation.h>
#import <dispatch/dispatch.h>

@interface OZContext : NSObject

Expand Down
6 changes: 3 additions & 3 deletions Classes/OZMessage.m
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ - (id)initWithJSONObject:(id)object
return nil;
}

NSData *data = [NSJSONSerialization dataWithJSONObject:object options:0 error:nil];
NSData *data = [NSJSONSerialization dataWithJSONObject:object options:0 error:NULL];
if (!data) {
return nil;
}
Expand Down Expand Up @@ -91,7 +91,7 @@ - (NSData *)dataAtIndex:(NSUInteger)index
- (id)JSONObjectAtIndex:(NSUInteger)index
{
NSData *data = [self dataAtIndex:index];
id result = [NSJSONSerialization JSONObjectWithData:data options:0 error:nil];
id result = [NSJSONSerialization JSONObjectWithData:data options:0 error:NULL];
return result;
}

Expand All @@ -104,7 +104,7 @@ - (void)appendPart:(NSData *)part
- (void)appendJSONObject:(id)object
{
assert(object);
NSData *objectData = [NSJSONSerialization dataWithJSONObject:object options:0 error:nil];
NSData *objectData = [NSJSONSerialization dataWithJSONObject:object options:0 error:NULL];
[self appendPart:objectData];
}

Expand Down
2 changes: 1 addition & 1 deletion Classes/OZSocket+Subclass.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

@interface OZSocket ()
@property (nonatomic, assign) void *zmqSocket;
@property (nonatomic, strong) dispatch_queue_t socketQueue;
@property (nonatomic) dispatch_queue_t socketQueue;
@end

@interface OZSocket (Subclass)
Expand Down
11 changes: 10 additions & 1 deletion Classes/OZSocket+Subclass.m
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,15 @@

#import "zmq.h"

#if TARGET_OS_IPHONE || TARGET_IPHONE_SIMULATOR
@interface OZSocket ()

@property (nonatomic, strong) NSMutableSet *boundEndpoints;
@property (nonatomic, strong) NSMutableSet *connectedEndpoints;

@end
#endif

@implementation OZSocket (Subclass)

- (id)initWithType:(int)socketType context:(OZContext *)context
Expand Down Expand Up @@ -42,7 +51,7 @@ - (void)closeSocket
{
dispatch_sync(self.socketQueue, ^{
zmq_close(self.zmqSocket);
self.zmqSocket = nil;
self.zmqSocket = NULL;
});
}

Expand Down
3 changes: 2 additions & 1 deletion Classes/OZSocket.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,15 @@
//

#import <Foundation/Foundation.h>
#import <dispatch/dispatch.h>

@class OZContext;
@class OZMessage;

@interface OZSocket : NSObject

@property (nonatomic, assign, readonly) void *zmqSocket;
@property (nonatomic, strong, readonly) dispatch_queue_t socketQueue;
@property (nonatomic, readonly) dispatch_queue_t socketQueue;

- (id)init UNAVAILABLE_ATTRIBUTE;

Expand Down
5 changes: 4 additions & 1 deletion Classes/OZSocketReq.m
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,18 @@

@implementation OZSocketReq

#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wobjc-designated-initializers"
- (id)init
{
self = [super initWithType:ZMQ_REQ context:[OZContext defaultContext]];
self = [self initWithType:ZMQ_REQ context:[OZContext defaultContext]];
if (!self) {
return nil;
}

return self;
}
#pragma clang diagnostic pop

- (void)request:(OZMessage*)message handler:(void (^)(OZMessage *response))callback
{
Expand Down
5 changes: 4 additions & 1 deletion Classes/OZSocketSub.m
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,11 @@

@implementation OZSocketSub

#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wobjc-designated-initializers"
- (id)init
{
self = [super initWithType:ZMQ_SUB context:[OZContext defaultContext]];
self = [self initWithType:ZMQ_SUB context:[OZContext defaultContext]];
if (!self) {
return nil;
}
Expand All @@ -31,6 +33,7 @@ - (id)init

return self;
}
#pragma clang diagnostic pop

- (void)subscribe:(NSData *)prefix
{
Expand Down
24 changes: 11 additions & 13 deletions ObjectiveZMQTests.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@
objects = {

/* Begin PBXBuildFile section */
4A8186D117DB3985009C2708 /* SenTestingKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4A8186D017DB3985009C2708 /* SenTestingKit.framework */; };
4A8186DB17DB3985009C2708 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 4A8186D917DB3985009C2708 /* InfoPlist.strings */; };
4A9B1CAD17DB429D003F61B8 /* OZSocket+Subclass.m in Sources */ = {isa = PBXBuildFile; fileRef = 4A9B1CAC17DB429D003F61B8 /* OZSocket+Subclass.m */; };
4A9B1CB317DB44E0003F61B8 /* NSData+ZMQMessage.m in Sources */ = {isa = PBXBuildFile; fileRef = 4A9B1CB217DB44E0003F61B8 /* NSData+ZMQMessage.m */; };
4A9B1CB717DB482B003F61B8 /* OZSocket+Receive.m in Sources */ = {isa = PBXBuildFile; fileRef = 4A9B1CB617DB482B003F61B8 /* OZSocket+Receive.m */; };
4A9B1CBA17DB6502003F61B8 /* OZSocketPubSpec.m in Sources */ = {isa = PBXBuildFile; fileRef = 4A9B1CB917DB6502003F61B8 /* OZSocketPubSpec.m */; };
4A9B1CBF17DB6AE4003F61B8 /* OZSocketSubclassSpec.m in Sources */ = {isa = PBXBuildFile; fileRef = 4A9B1CBE17DB6AE4003F61B8 /* OZSocketSubclassSpec.m */; };
4A9B1CC417DB6F16003F61B8 /* EXPMatchers+conformToProtocol.m in Sources */ = {isa = PBXBuildFile; fileRef = 4A9B1CC317DB6F16003F61B8 /* EXPMatchers+conformToProtocol.m */; };
4ACD44F218D29E3F005CB861 /* libc++.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 4ACD44F118D29E3F005CB861 /* libc++.dylib */; };
4AD0816217E9328B0050C60C /* OZSocketRepSpec.m in Sources */ = {isa = PBXBuildFile; fileRef = 4AD0816117E9328B0050C60C /* OZSocketRepSpec.m */; };
4AFB9B5717DB3AB700C8014D /* OZSocketSpec.m in Sources */ = {isa = PBXBuildFile; fileRef = 4AFB9B5617DB3AB700C8014D /* OZSocketSpec.m */; };
4AFB9B5817DB3B5D00C8014D /* OZContext.m in Sources */ = {isa = PBXBuildFile; fileRef = 4A8186A117DA1039009C2708 /* OZContext.m */; };
Expand All @@ -26,7 +26,6 @@
4AFB9B5E17DB3B5D00C8014D /* OZSocketRep.m in Sources */ = {isa = PBXBuildFile; fileRef = 4A8186AC17DA1039009C2708 /* OZSocketRep.m */; };
4AFB9B5F17DB3B5D00C8014D /* OZSocketReq.m in Sources */ = {isa = PBXBuildFile; fileRef = 4A8186AE17DA1039009C2708 /* OZSocketReq.m */; };
4AFB9B6017DB3B5D00C8014D /* OZSocketSub.m in Sources */ = {isa = PBXBuildFile; fileRef = 4A8186B017DA1039009C2708 /* OZSocketSub.m */; };
4AFB9B6617DB3BE200C8014D /* libstdc++.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 4AFB9B6517DB3BE200C8014D /* libstdc++.dylib */; };
CF452B63FD6849859647698E /* libPods.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 8C7037CB6FBB4D89BF32D825 /* libPods.a */; };
/* End PBXBuildFile section */

Expand All @@ -51,8 +50,7 @@
4A8186C417DB381D009C2708 /* OZSocketSend.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OZSocketSend.h; sourceTree = "<group>"; };
4A8186C517DB385E009C2708 /* OZSocket+Send.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "OZSocket+Send.h"; sourceTree = "<group>"; };
4A8186C617DB385E009C2708 /* OZSocket+Send.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "OZSocket+Send.m"; sourceTree = "<group>"; };
4A8186CF17DB3985009C2708 /* ObjectiveZMQTests.octest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = ObjectiveZMQTests.octest; sourceTree = BUILT_PRODUCTS_DIR; };
4A8186D017DB3985009C2708 /* SenTestingKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SenTestingKit.framework; path = Library/Frameworks/SenTestingKit.framework; sourceTree = DEVELOPER_DIR; };
4A8186CF17DB3985009C2708 /* ObjectiveZMQTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = ObjectiveZMQTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
4A8186D817DB3985009C2708 /* ObjectiveZMQTests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "ObjectiveZMQTests-Info.plist"; sourceTree = "<group>"; };
4A8186DA17DB3985009C2708 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = "<group>"; };
4A8186DF17DB3985009C2708 /* ObjectiveZMQTests-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "ObjectiveZMQTests-Prefix.pch"; sourceTree = "<group>"; };
Expand All @@ -67,6 +65,7 @@
4A9B1CBE17DB6AE4003F61B8 /* OZSocketSubclassSpec.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = OZSocketSubclassSpec.m; sourceTree = "<group>"; };
4A9B1CC217DB6F16003F61B8 /* EXPMatchers+conformToProtocol.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "EXPMatchers+conformToProtocol.h"; sourceTree = "<group>"; };
4A9B1CC317DB6F16003F61B8 /* EXPMatchers+conformToProtocol.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "EXPMatchers+conformToProtocol.m"; sourceTree = "<group>"; };
4ACD44F118D29E3F005CB861 /* libc++.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = "libc++.dylib"; path = "usr/lib/libc++.dylib"; sourceTree = SDKROOT; };
4AD0816117E9328B0050C60C /* OZSocketRepSpec.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = OZSocketRepSpec.m; sourceTree = "<group>"; };
4AFB9B5617DB3AB700C8014D /* OZSocketSpec.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = OZSocketSpec.m; sourceTree = "<group>"; };
4AFB9B6517DB3BE200C8014D /* libstdc++.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = "libstdc++.dylib"; path = "/usr/lib/libstdc++.dylib"; sourceTree = "<absolute>"; };
Expand All @@ -79,8 +78,7 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
4AFB9B6617DB3BE200C8014D /* libstdc++.dylib in Frameworks */,
4A8186D117DB3985009C2708 /* SenTestingKit.framework in Frameworks */,
4ACD44F218D29E3F005CB861 /* libc++.dylib in Frameworks */,
CF452B63FD6849859647698E /* libPods.a in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
Expand All @@ -102,7 +100,7 @@
4A6516C817D9E143002E9C19 /* Products */ = {
isa = PBXGroup;
children = (
4A8186CF17DB3985009C2708 /* ObjectiveZMQTests.octest */,
4A8186CF17DB3985009C2708 /* ObjectiveZMQTests.xctest */,
);
name = Products;
sourceTree = "<group>";
Expand Down Expand Up @@ -168,9 +166,9 @@
A805E925BA754C52995A278A /* Frameworks */ = {
isa = PBXGroup;
children = (
4ACD44F118D29E3F005CB861 /* libc++.dylib */,
4AFB9B6517DB3BE200C8014D /* libstdc++.dylib */,
8C7037CB6FBB4D89BF32D825 /* libPods.a */,
4A8186D017DB3985009C2708 /* SenTestingKit.framework */,
);
name = Frameworks;
sourceTree = "<group>";
Expand All @@ -195,16 +193,17 @@
);
name = ObjectiveZMQTests;
productName = ObjectiveZMQTests;
productReference = 4A8186CF17DB3985009C2708 /* ObjectiveZMQTests.octest */;
productType = "com.apple.product-type.bundle";
productReference = 4A8186CF17DB3985009C2708 /* ObjectiveZMQTests.xctest */;
productType = "com.apple.product-type.bundle.unit-test";
};
/* End PBXNativeTarget section */

/* Begin PBXProject section */
4A6516BF17D9E143002E9C19 /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 0460;
LastTestingUpgradeCheck = 0510;
LastUpgradeCheck = 0510;
ORGANIZATIONNAME = "Savage Interactive";
};
buildConfigurationList = 4A6516C217D9E143002E9C19 /* Build configuration list for PBXProject "ObjectiveZMQTests" */;
Expand Down Expand Up @@ -324,7 +323,6 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
ARCHS = "$(ARCHS_STANDARD_64_BIT)";
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
Expand Down Expand Up @@ -355,13 +353,13 @@
isa = XCBuildConfiguration;
baseConfigurationReference = 8DDFB44972DC4F349D80430D /* Pods.xcconfig */;
buildSettings = {
COMBINE_HIDPI_IMAGES = YES;
FRAMEWORK_SEARCH_PATHS = "$(inherited)";
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "ObjectiveZMQTests/ObjectiveZMQTests-Prefix.pch";
INFOPLIST_FILE = "ObjectiveZMQTests/ObjectiveZMQTests-Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 6.1;
PRODUCT_NAME = "$(TARGET_NAME)";
WRAPPER_EXTENSION = octest;
};
name = Debug;
};
Expand Down