Skip to content

Commit

Permalink
Moved around #define macros
Browse files Browse the repository at this point in the history
  • Loading branch information
mzarra committed Jan 6, 2010
1 parent d89a45f commit 45e9104
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 33 deletions.
1 change: 0 additions & 1 deletion Daemon/Classes/AppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
//

#import "AppDelegate.h"
#import "ZSync.h"

@implementation AppDelegate

Expand Down
12 changes: 1 addition & 11 deletions Daemon/Prefix.pch
Original file line number Diff line number Diff line change
@@ -1,15 +1,5 @@
#ifdef DEBUG
#define DLog(...) NSLog(__VA_ARGS__)
#define ALog(...) [[NSAssertionHandler currentHandler] handleFailureInFunction:[NSString stringWithCString:__PRETTY_FUNCTION__ encoding:NSUTF8StringEncoding] file:[NSString stringWithCString:__FILE__ encoding:NSUTF8StringEncoding] lineNumber:__LINE__ description:__VA_ARGS__]
#else
#define DLog(...) do { } while (0)
#define NS_BLOCK_ASSERTIONS
#define ALog(...) NSLog(__VA_ARGS__)
#endif

#define ZAssert(condition, ...) do { if (!(condition)) { ALog(__VA_ARGS__); }} while(0)

#ifdef __OBJC__
#import <Cocoa/Cocoa.h>
#import <CoreData/CoreData.h>
#import "ZSync.h"
#endif
10 changes: 6 additions & 4 deletions Daemon/ZSyncDaemon.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@
B691FB8D10ED875800207210 /* NSSocket+ZSExtensions.m in Sources */ = {isa = PBXBuildFile; fileRef = B691FB8610ED875800207210 /* NSSocket+ZSExtensions.m */; };
B691FB8E10ED875800207210 /* PairingCodeWindowController.m in Sources */ = {isa = PBXBuildFile; fileRef = B691FB8810ED875800207210 /* PairingCodeWindowController.m */; };
B691FB8F10ED875800207210 /* ZSyncHandler.m in Sources */ = {isa = PBXBuildFile; fileRef = B691FB8B10ED875800207210 /* ZSyncHandler.m */; };
B691FBAB10ED879D00207210 /* libMYNetwork-Desktop.a in Frameworks */ = {isa = PBXBuildFile; fileRef = B691FBA010ED879D00207210 /* libMYNetwork-Desktop.a */; };
B691FBBD10ED884000207210 /* SyncServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B691FBBC10ED884000207210 /* SyncServices.framework */; };
B6EC175D10F5033E0051FD2E /* GTMNSData+zlib.m in Sources */ = {isa = PBXBuildFile; fileRef = B6EC175C10F5033E0051FD2E /* GTMNSData+zlib.m */; };
B6EC179F10F509010051FD2E /* libMYNetwork-Desktop.a in Frameworks */ = {isa = PBXBuildFile; fileRef = B6EC179E10F509010051FD2E /* libMYNetwork-Desktop.a */; };
/* End PBXBuildFile section */

/* Begin PBXFileReference section */
Expand Down Expand Up @@ -56,7 +56,6 @@
B691FB9D10ED879D00207210 /* BLIPProperties.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BLIPProperties.h; sourceTree = "<group>"; };
B691FB9E10ED879D00207210 /* BLIPRequest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BLIPRequest.h; sourceTree = "<group>"; };
B691FB9F10ED879D00207210 /* IPAddress.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IPAddress.h; sourceTree = "<group>"; };
B691FBA010ED879D00207210 /* libMYNetwork-Desktop.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = "libMYNetwork-Desktop.a"; sourceTree = "<group>"; };
B691FBA210ED879D00207210 /* MYBonjourBrowser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MYBonjourBrowser.h; sourceTree = "<group>"; };
B691FBA310ED879D00207210 /* MYBonjourService.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MYBonjourService.h; sourceTree = "<group>"; };
B691FBA410ED879D00207210 /* MYDNSService.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MYDNSService.h; sourceTree = "<group>"; };
Expand All @@ -70,6 +69,7 @@
B6EC175A10F5033E0051FD2E /* GTMDefines.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GTMDefines.h; sourceTree = "<group>"; };
B6EC175B10F5033E0051FD2E /* GTMNSData+zlib.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "GTMNSData+zlib.h"; sourceTree = "<group>"; };
B6EC175C10F5033E0051FD2E /* GTMNSData+zlib.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "GTMNSData+zlib.m"; sourceTree = "<group>"; };
B6EC179E10F509010051FD2E /* libMYNetwork-Desktop.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = "libMYNetwork-Desktop.a"; sourceTree = "<group>"; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
Expand All @@ -79,9 +79,9 @@
files = (
8D11072F0486CEB800E47090 /* Cocoa.framework in Frameworks */,
B691FB5F10ED867C00207210 /* CoreData.framework in Frameworks */,
B691FBAB10ED879D00207210 /* libMYNetwork-Desktop.a in Frameworks */,
B691FBBD10ED884000207210 /* SyncServices.framework in Frameworks */,
B64FE94010EF35DF00B15A8F /* libz.dylib in Frameworks */,
B6EC179F10F509010051FD2E /* libMYNetwork-Desktop.a in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -182,6 +182,7 @@
B691FB8210ED875800207210 /* DesktopCode */ = {
isa = PBXGroup;
children = (
B6EC179E10F509010051FD2E /* libMYNetwork-Desktop.a */,
B691FB8310ED875800207210 /* PairingWindow.xib */,
B691FB8510ED875800207210 /* NSSocket+ZSExtensions.h */,
B691FB8610ED875800207210 /* NSSocket+ZSExtensions.m */,
Expand All @@ -205,7 +206,6 @@
B691FB9D10ED879D00207210 /* BLIPProperties.h */,
B691FB9E10ED879D00207210 /* BLIPRequest.h */,
B691FB9F10ED879D00207210 /* IPAddress.h */,
B691FBA010ED879D00207210 /* libMYNetwork-Desktop.a */,
B691FBA210ED879D00207210 /* MYBonjourBrowser.h */,
B691FBA310ED879D00207210 /* MYBonjourService.h */,
B691FBA410ED879D00207210 /* MYDNSService.h */,
Expand Down Expand Up @@ -353,6 +353,7 @@
LIBRARY_SEARCH_PATHS = (
"$(inherited)",
"\"$(SRCROOT)/../SharedCode\"",
"\"$(SRCROOT)/../DesktopCode\"",
);
OTHER_CFLAGS = "-DDEBUG";
PRODUCT_NAME = ZSyncDaemon;
Expand All @@ -372,6 +373,7 @@
LIBRARY_SEARCH_PATHS = (
"$(inherited)",
"\"$(SRCROOT)/../SharedCode\"",
"\"$(SRCROOT)/../DesktopCode\"",
);
PRODUCT_NAME = ZSyncDaemon;
};
Expand Down
1 change: 0 additions & 1 deletion SampleTouch/Classes/AppDelegate.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#import "ZSyncTouch.h"

@interface AppDelegate : NSObject <UIApplicationDelegate, ZSyncDelegate>
{
Expand Down
11 changes: 1 addition & 10 deletions SampleTouch/Prefix.pch
Original file line number Diff line number Diff line change
@@ -1,13 +1,3 @@
#ifdef DEBUG
#define DLog(...) NSLog(__VA_ARGS__)
#define ALog(...) [[NSAssertionHandler currentHandler] handleFailureInFunction:[NSString stringWithCString:__PRETTY_FUNCTION__ encoding:NSUTF8StringEncoding] file:[NSString stringWithCString:__FILE__ encoding:NSUTF8StringEncoding] lineNumber:__LINE__ description:__VA_ARGS__]
#else
#define DLog(...) do { } while (0)
#define NS_BLOCK_ASSERTIONS
#define ALog(...) NSLog(__VA_ARGS__)
#endif

#define ZAssert(condition, ...) do { if (!(condition)) { ALog(__VA_ARGS__); }} while(0)

#import <Availability.h>

Expand All @@ -20,6 +10,7 @@
#import <UIKit/UIKit.h>
#import <CoreData/CoreData.h>
#import <QuartzCore/QuartzCore.h>
#import "ZSyncTouch.h"
#endif

#define kCellIdentifier @"kCellIdentifier"
Expand Down
10 changes: 6 additions & 4 deletions SampleTouch/SampleTouch.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@
B631391C10AB4E9900E27635 /* ZSyncTouchHandler.m in Sources */ = {isa = PBXBuildFile; fileRef = B631391B10AB4E9900E27635 /* ZSyncTouchHandler.m */; };
B642864010BEA11700470E43 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B642863F10BEA11700470E43 /* QuartzCore.framework */; };
B64FE94710EF35EF00B15A8F /* libz.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = B64FE94610EF35EF00B15A8F /* libz.dylib */; };
B68F1A3010C223C5008CCD93 /* libMYNetwork.a in Frameworks */ = {isa = PBXBuildFile; fileRef = B68F1A2F10C223C5008CCD93 /* libMYNetwork.a */; };
B69CD13D10EA9EC4006C50C9 /* DataModel.xcdatamodel in Sources */ = {isa = PBXBuildFile; fileRef = B69CD13C10EA9EC4006C50C9 /* DataModel.xcdatamodel */; };
B6C2E13610A748B50063E436 /* MainWindow.xib in Resources */ = {isa = PBXBuildFile; fileRef = B6C2E13110A748B50063E436 /* MainWindow.xib */; };
B6C2E13710A748B50063E436 /* RootViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = B6C2E13310A748B50063E436 /* RootViewController.xib */; };
B6DA32B410ED55C3008724A6 /* ChildViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = B6DA32B310ED55C3008724A6 /* ChildViewController.m */; };
B6EC175810F503360051FD2E /* GTMNSData+zlib.m in Sources */ = {isa = PBXBuildFile; fileRef = B6EC175710F503360051FD2E /* GTMNSData+zlib.m */; };
B6EC179B10F508C10051FD2E /* libMYNetwork.a in Frameworks */ = {isa = PBXBuildFile; fileRef = B6EC179A10F508C10051FD2E /* libMYNetwork.a */; };
B6FF2CDE10B5106D007AB6D4 /* CFNetwork.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B6FF2CDD10B5106D007AB6D4 /* CFNetwork.framework */; };
/* End PBXBuildFile section */

Expand Down Expand Up @@ -55,7 +55,6 @@
B642863F10BEA11700470E43 /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; };
B6457FED10B0A94E00A96714 /* ZSyncShared.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ZSyncShared.h; sourceTree = "<group>"; };
B64FE94610EF35EF00B15A8F /* libz.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libz.dylib; path = usr/lib/libz.dylib; sourceTree = SDKROOT; };
B68F1A2F10C223C5008CCD93 /* libMYNetwork.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libMYNetwork.a; sourceTree = "<group>"; };
B69CD13C10EA9EC4006C50C9 /* DataModel.xcdatamodel */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = wrapper.xcdatamodel; path = DataModel.xcdatamodel; sourceTree = "<group>"; };
B6C2E13210A748B50063E436 /* en */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = en; path = en.lproj/MainWindow.xib; sourceTree = "<group>"; };
B6C2E13410A748B50063E436 /* en */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = en; path = en.lproj/RootViewController.xib; sourceTree = "<group>"; };
Expand All @@ -64,6 +63,7 @@
B6EC175510F503360051FD2E /* GTMDefines.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GTMDefines.h; sourceTree = "<group>"; };
B6EC175610F503360051FD2E /* GTMNSData+zlib.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "GTMNSData+zlib.h"; sourceTree = "<group>"; };
B6EC175710F503360051FD2E /* GTMNSData+zlib.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "GTMNSData+zlib.m"; sourceTree = "<group>"; };
B6EC179A10F508C10051FD2E /* libMYNetwork.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libMYNetwork.a; sourceTree = "<group>"; };
B6FF2CDD10B5106D007AB6D4 /* CFNetwork.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CFNetwork.framework; path = System/Library/Frameworks/CFNetwork.framework; sourceTree = SDKROOT; };
/* End PBXFileReference section */

Expand All @@ -78,8 +78,8 @@
28860BE50F44EE6400985440 /* CoreData.framework in Frameworks */,
B6FF2CDE10B5106D007AB6D4 /* CFNetwork.framework in Frameworks */,
B642864010BEA11700470E43 /* QuartzCore.framework in Frameworks */,
B68F1A3010C223C5008CCD93 /* libMYNetwork.a in Frameworks */,
B64FE94710EF35EF00B15A8F /* libz.dylib in Frameworks */,
B6EC179B10F508C10051FD2E /* libMYNetwork.a in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -165,6 +165,7 @@
B631391810AB4E5700E27635 /* DeviceCode */ = {
isa = PBXGroup;
children = (
B6EC179A10F508C10051FD2E /* libMYNetwork.a */,
B631391910AB4E7F00E27635 /* ZSyncTouch.h */,
B631391A10AB4E9900E27635 /* ZSyncTouchHandler.h */,
B631391B10AB4E9900E27635 /* ZSyncTouchHandler.m */,
Expand All @@ -176,7 +177,6 @@
B6457FEB10B0A93D00A96714 /* SharedCode */ = {
isa = PBXGroup;
children = (
B68F1A2F10C223C5008CCD93 /* libMYNetwork.a */,
B6457FED10B0A94E00A96714 /* ZSyncShared.h */,
);
name = SharedCode;
Expand Down Expand Up @@ -322,6 +322,7 @@
"$(inherited)",
"\"$(SRCROOT)/../Libraries/MyNetwork\"",
"\"$(SRCROOT)/../SharedCode\"",
"\"$(SRCROOT)/../DeviceCode\"",
);
OTHER_CFLAGS = "-DDEBUG";
PRODUCT_NAME = SampleTouch;
Expand All @@ -340,6 +341,7 @@
"$(inherited)",
"\"$(SRCROOT)/../Libraries/MyNetwork\"",
"\"$(SRCROOT)/../SharedCode\"",
"\"$(SRCROOT)/../DeviceCode\"",
);
"OTHER_LDFLAGS[sdk=iphoneos*][arch=*]" = "-lMYNetwork-iPhone";
"OTHER_LDFLAGS[sdk=iphonesimulator*][arch=*]" = "-lMYNetwork-Simulator";
Expand Down
14 changes: 12 additions & 2 deletions SharedCode/ZSyncShared.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
#ifdef DEBUG
#define DLog(...) NSLog(__VA_ARGS__)
#define ALog(...) [[NSAssertionHandler currentHandler] handleFailureInFunction:[NSString stringWithCString:__PRETTY_FUNCTION__ encoding:NSUTF8StringEncoding] file:[NSString stringWithCString:__FILE__ encoding:NSUTF8StringEncoding] lineNumber:__LINE__ description:__VA_ARGS__]
#else
#define DLog(...) do { } while (0)
#define NS_BLOCK_ASSERTIONS
#define ALog(...) NSLog(__VA_ARGS__)
#endif

#define ZAssert(condition, ...) do { if (!(condition)) { ALog(__VA_ARGS__); }} while(0)

#define zsDomainName @"local."
#define zsServiceName @"_zsync._tcp"
#define zsServerUUID @"zsyncServerUUID"
Expand Down Expand Up @@ -42,5 +53,4 @@ typedef enum {
zsErrorNoSyncClientRegistered
} ZSErrorCode;

#import "MYNetwork.h"

#import "MYNetwork.h"

0 comments on commit 45e9104

Please sign in to comment.