[Log4cplus-devel] LOG4CPLUS_DEBUG expansion fails when DEBUG macro is defined
Logging Framework for C++
Brought to you by:
wilx
|
From: Chernyshev V. <ast...@ro...> - 2012-09-05 20:13:15
|
Hello.
While testing log4cplus with default-generated Xcode project on OS X,
I've found out that any usage of LOG4CPLUS_DEBUG immediately produces
very strange compilation errors. After examing this problem I've noticed
that Xcode defines DEBUG macro to 1 for debug builds. As LOG4CPLUS_DEBUG
is defined like:
LOG4CPLUS_MACRO_BODY (logger, logEvent, DEBUG)
it is obvious that expanding this macro will fail later.
I have fixed it this way locally: https://gist.github.com/3643384 It
somewhat uglifies the code, but predefined DEBUG_LOG_LEVEL macro is much
less common than DEBUG/NDEBUG macro pairs.
|