Re: Can Xcode allow multiple definitions of a fn?
Re: Can Xcode allow multiple definitions of a fn?
- Subject: Re: Can Xcode allow multiple definitions of a fn?
- From: Shaun Wexler <email@hidden>
- Date: Fri, 16 Sep 2005 09:40:13 -0700
On Sep 16, 2005, at 7:08 AM, Matt Neuburg wrote:
Okay, I've got a related question (I think it's related). I get
"multiple
definitions" errors when I place a #define macro in the pre-
compiled header
file. For example I have a MyLog macro that expands to NSLog ifdef
DEBUG but
to nothing othewise, so that I log only in a debug build:
#ifdef DEBUG
#define MyLog(format, args...) \
<and so on>
This used to work fine, but now I'm getting these multiple definition
errors. Did something about the precompilation process change that
could be
causing this? How do I properly do this #define so that all of my
code can
see it? Thx - m.
Only define it once, in a common header:
#define MyLog(format, args...) \
#ifdef DEBUG \
NSLog(format, args...) \
#endif
It will be a NOP unless you are debugging, but always defined.
--
Shaun Wexler
MacFOH
http://www.macfoh.com
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden