Re: #define not working
Re: #define not working
- Subject: Re: #define not working
- From: Tommy Nordgren <email@hidden>
- Date: Sun, 2 Oct 2005 00:36:55 +0200
Oct 2, 2005 kl. 12:11 AM skrev Scott Ribe:
The cause of the OP's problem must be something else, probably that
the header file defining the preproccessor symbol is not included.
Yes, so replace:
#define DEBUG_LOG
With:
#define DEBUG_LOG 1
And also replace:
#ifdef DEBUG_LOG
With:
#if DEBUG_LOG
And that will provide a nice compile-time error wherever the proper
header
is not included.
--
Scott Ribe
email@hidden
http://www.killerbytes.com/
(303) 665-7007 voice
here is one alternate solution:
/* Header Debuglog.h */
#define DB_LOG 1
extern BOOL debug_log;
#define DEBUG_LOG(message) do { if (DB_LOG && debug_log) {\
NSLog message ; } } while (0)
To be used like this:
DEBUG_LOG((@"The value %d is not in range %d..%d",current,min,max));
"Home is not where you are born, but where your heart finds peace" -
Tommy Nordgren, "The dying old crone"
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden