Skip to content

Commit

Permalink
Change '#ifdef DEBUG' to '#if defined(DEBUG) || defined(NI_DEBUG)'
Browse files Browse the repository at this point in the history
  • Loading branch information
inamiy committed Dec 3, 2012
1 parent af86388 commit e053703
Show file tree
Hide file tree
Showing 9 changed files with 24 additions and 24 deletions.
12 changes: 6 additions & 6 deletions src/core/src/NIDebuggingTools.h
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@
* @{
*/

#ifdef DEBUG
#if defined(DEBUG) || defined(NI_DEBUG)

/**
* Assertions that only fire when DEBUG is defined.
Expand All @@ -109,7 +109,7 @@ if (NIDebugAssertionsShouldBreak && NIIsInDebugger()) { raise(SIGTRAP); } } \

#else
#define NIDASSERT(xx) ((void)0)
#endif // #ifdef DEBUG
#endif // #if defined(DEBUG) || defined(NI_DEBUG)


#define NILOGLEVEL_INFO 5
Expand Down Expand Up @@ -141,18 +141,18 @@ extern BOOL NIDebugAssertionsShouldBreak;
* This log method will always write to the log, regardless of log levels. It is used by all
* of the other logging methods in Nimbus' debugging library.
*/
#ifdef DEBUG
#if defined(DEBUG) || defined(NI_DEBUG)
#define NIDPRINT(xx, ...) NSLog(@"%s(%d): " xx, __PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__)
#else
#define NIDPRINT(xx, ...) ((void)0)
#endif // #ifdef DEBUG
#endif // #if defined(DEBUG) || defined(NI_DEBUG)

/**
* Write the containing method's name to the log using NIDPRINT.
*/
#define NIDPRINTMETHODNAME() NIDPRINT(@"%s", __PRETTY_FUNCTION__)

#ifdef DEBUG
#if defined(DEBUG) || defined(NI_DEBUG)
/**
* Only writes to the log if condition is satisified.
*
Expand All @@ -163,7 +163,7 @@ extern BOOL NIDebugAssertionsShouldBreak;
} ((void)0)
#else
#define NIDCONDITIONLOG(condition, xx, ...) ((void)0)
#endif // #ifdef DEBUG
#endif // #if defined(DEBUG) || defined(NI_DEBUG)


/**
Expand Down
4 changes: 2 additions & 2 deletions src/core/src/NIDebuggingTools.m
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
NSInteger NIMaxLogLevel = NILOGLEVEL_WARNING;
BOOL NIDebugAssertionsShouldBreak = YES;

#ifdef DEBUG
#if defined(DEBUG) || defined(NI_DEBUG)

#import <unistd.h>
#import <sys/sysctl.h>
Expand Down Expand Up @@ -58,4 +58,4 @@ int NIIsInDebugger(void) {
return (info.kp_proc.p_flag & P_TRACED) != 0;
}

#endif // #ifdef DEBUG
#endif // #if defined(DEBUG) || defined(NI_DEBUG)
6 changes: 3 additions & 3 deletions src/core/src/NINetworkActivity.m
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

#import "NIDebuggingTools.h"

#ifdef DEBUG
#if defined(DEBUG) || defined(NI_DEBUG)
#import "NIRuntimeClassModifications.h"
#endif

Expand Down Expand Up @@ -112,7 +112,7 @@ void NINetworkActivityTaskDidFinish(void) {
#pragma mark -
#pragma mark Network Activity Debugging

#ifdef DEBUG
#if defined(DEBUG) || defined(NI_DEBUG)

static BOOL gNetworkActivityDebuggingEnabled = NO;

Expand Down Expand Up @@ -191,4 +191,4 @@ void NIDisableNetworkActivityDebugging(void) {
}


#endif // #ifdef DEBUG
#endif // #if defined(DEBUG) || defined(NI_DEBUG)
16 changes: 8 additions & 8 deletions src/overview/src/NIOverview.m
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

#import "NIOverview.h"

#ifdef DEBUG
#if defined(DEBUG) || defined(NI_DEBUG)

#import "NIDeviceInfo.h"
#import "NIOverviewView.h"
Expand Down Expand Up @@ -108,7 +108,7 @@ @implementation NIOverview
#pragma mark -
#pragma mark Device Orientation Changes

#ifdef DEBUG
#if defined(DEBUG) || defined(NI_DEBUG)

///////////////////////////////////////////////////////////////////////////////////////////////////
+ (void)didChangeOrientation {
Expand Down Expand Up @@ -199,7 +199,7 @@ + (void)didReceiveMemoryWarning {

///////////////////////////////////////////////////////////////////////////////////////////////////
+ (void)applicationDidFinishLaunching {
#ifdef DEBUG
#if defined(DEBUG) || defined(NI_DEBUG)
if (!sOverviewIsAwake) {
sOverviewIsAwake = YES;

Expand Down Expand Up @@ -229,7 +229,7 @@ + (void)applicationDidFinishLaunching {

///////////////////////////////////////////////////////////////////////////////////////////////////
+ (void)addOverviewToWindow:(UIWindow *)window {
#ifdef DEBUG
#if defined(DEBUG) || defined(NI_DEBUG)
if (nil != sOverviewView) {
// Remove the old overview in case this gets called multiple times (not sure why you would
// though).
Expand Down Expand Up @@ -258,7 +258,7 @@ + (void)addOverviewToWindow:(UIWindow *)window {

///////////////////////////////////////////////////////////////////////////////////////////////////
+ (NIOverviewLogger *)logger {
#ifdef DEBUG
#if defined(DEBUG) || defined(NI_DEBUG)
return [NIOverviewLogger sharedLogger];
#else
return nil;
Expand All @@ -268,7 +268,7 @@ + (NIOverviewLogger *)logger {

///////////////////////////////////////////////////////////////////////////////////////////////////
+ (CGFloat)height {
#ifdef DEBUG
#if defined(DEBUG) || defined(NI_DEBUG)
return sOverviewHeight;
#else
return 0;
Expand All @@ -278,7 +278,7 @@ + (CGFloat)height {

///////////////////////////////////////////////////////////////////////////////////////////////////
+ (CGRect)frame {
#ifdef DEBUG
#if defined(DEBUG) || defined(NI_DEBUG)
UIInterfaceOrientation orient = NIInterfaceOrientation();
CGFloat overviewWidth;
CGRect frame;
Expand Down Expand Up @@ -342,7 +342,7 @@ + (CGRect)frame {

///////////////////////////////////////////////////////////////////////////////////////////////////
+ (UIView *)view {
#ifdef DEBUG
#if defined(DEBUG) || defined(NI_DEBUG)
return sOverviewView;
#else
return nil;
Expand Down
2 changes: 1 addition & 1 deletion src/overview/src/NIOverviewPageView.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

#import <UIKit/UIKit.h>

#ifdef DEBUG
#if defined(DEBUG) || defined(NI_DEBUG)

#import "NIOverviewGraphView.h"

Expand Down
2 changes: 1 addition & 1 deletion src/overview/src/NIOverviewPageView.m
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

#import "NIOverviewPageView.h"

#ifdef DEBUG
#if defined(DEBUG) || defined(NI_DEBUG)

#import "NIOverview.h"
#import "NIDeviceInfo.h"
Expand Down
2 changes: 1 addition & 1 deletion src/overview/src/NIOverviewSwizzling.m
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
#error "Nimbus requires ARC support."
#endif

#ifdef DEBUG
#if defined(DEBUG) || defined(NI_DEBUG)

@interface UIApplication (Private)
- (CGRect)_statusBarFrame;
Expand Down
2 changes: 1 addition & 1 deletion src/overview/src/NIOverviewView.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

#import <UIKit/UIKit.h>

#ifdef DEBUG
#if defined(DEBUG) || defined(NI_DEBUG)

@class NIOverviewPageView;

Expand Down
2 changes: 1 addition & 1 deletion src/overview/src/NIOverviewView.m
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

#import "NIOverviewView.h"

#ifdef DEBUG
#if defined(DEBUG) || defined(NI_DEBUG)

#import "NimbusCore.h"

Expand Down

0 comments on commit e053703

Please sign in to comment.