From 6e59eb3ac5961b7d27a2f224f7ad5191c823a9e2 Mon Sep 17 00:00:00 2001 From: David Rose Date: Thu, 17 May 2001 01:16:30 +0000 Subject: [PATCH] *** empty log message *** --- dtool/Config.pp | 6 ++++++ dtool/LocalSetup.pp | 3 +++ dtool/src/dconfig/notifyCategory.I | 18 +++++++++--------- dtool/src/dconfig/notifyCategory.h | 2 +- dtool/src/dconfig/notifyCategoryProxy.I | 4 ++-- dtool/src/dconfig/notifyCategoryProxy.h | 2 +- .../src/interrogatedb/interrogateDatabase.cxx | 4 ---- 7 files changed, 22 insertions(+), 17 deletions(-) diff --git a/dtool/Config.pp b/dtool/Config.pp index b69229d4ef..bd95711393 100644 --- a/dtool/Config.pp +++ b/dtool/Config.pp @@ -294,6 +294,12 @@ // possible. #defer DO_PSTATS $[and $[HAVE_NET],$[< $[OPTIMIZE], 4]] +// Do you want to include the "debug" and "spam" Notify messages? +// Normally, these are stripped out when we build with OPTIMIZE = 4, but +// sometimes it's useful to keep them around. Redefine this in your +// own Config.pp to achieve that. +#defer NOTIFY_DEBUG $[< $[OPTIMIZE], 4] + // Do you want to build the audio interface? What additional // libraries are required? #define AUDIO_IPATH /mspsdk/Include diff --git a/dtool/LocalSetup.pp b/dtool/LocalSetup.pp index ea59499593..d36f6bb4f4 100644 --- a/dtool/LocalSetup.pp +++ b/dtool/LocalSetup.pp @@ -91,6 +91,9 @@ $[cdefine HAVE_NET] /* Define if we want to use PStats. */ $[cdefine DO_PSTATS] +/* Define if we want to use keep Notify debug messages. */ +$[cdefine NOTIFY_DEBUG] + /* Define if we want to compile the audio code. */ $[cdefine HAVE_AUDIO] diff --git a/dtool/src/dconfig/notifyCategory.I b/dtool/src/dconfig/notifyCategory.I index c678c81a72..d92a885797 100644 --- a/dtool/src/dconfig/notifyCategory.I +++ b/dtool/src/dconfig/notifyCategory.I @@ -57,7 +57,7 @@ is_on(NotifySeverity severity) const { return (int)severity >= (int)_severity; } -#ifndef NDEBUG +#ifdef NOTIFY_DEBUG //////////////////////////////////////////////////////////////////// // Function: NotifyCategory::is_spam // Access: Public @@ -81,10 +81,10 @@ is_debug() const { //////////////////////////////////////////////////////////////////// // Function: NotifyCategory::is_spam // Access: Public, Static -// Description: In NDEBUG mode, the categories are never set to -// "spam" or "debug" severities, and these methods are -// redefined to be static to make the more obvious to -// the compiler. +// Description: When NOTIFY_DEBUG is not defined, the categories are +// never set to "spam" or "debug" severities, and these +// methods are redefined to be static to make it more +// obvious to the compiler. //////////////////////////////////////////////////////////////////// INLINE bool NotifyCategory:: is_spam() { @@ -94,10 +94,10 @@ is_spam() { //////////////////////////////////////////////////////////////////// // Function: NotifyCategory::is_debug // Access: Public -// Description: In NDEBUG mode, the categories are never set to -// "spam" or "debug" severities, and these methods are -// redefined to be static to make the more obvious to -// the compiler. +// Description: When NOTIFY_DEBUG is not defined, the categories are +// never set to "spam" or "debug" severities, and these +// methods are redefined to be static to make it more +// obvious to the compiler. //////////////////////////////////////////////////////////////////// INLINE bool NotifyCategory:: is_debug() { diff --git a/dtool/src/dconfig/notifyCategory.h b/dtool/src/dconfig/notifyCategory.h index 2ea137afea..182116d1dd 100644 --- a/dtool/src/dconfig/notifyCategory.h +++ b/dtool/src/dconfig/notifyCategory.h @@ -35,7 +35,7 @@ PUBLISHED: INLINE bool is_on(NotifySeverity severity) const; -#ifndef NDEBUG +#ifdef NOTIFY_DEBUG INLINE bool is_spam() const; INLINE bool is_debug() const; #else diff --git a/dtool/src/dconfig/notifyCategoryProxy.I b/dtool/src/dconfig/notifyCategoryProxy.I index f98562d7e2..43fb6ba686 100644 --- a/dtool/src/dconfig/notifyCategoryProxy.I +++ b/dtool/src/dconfig/notifyCategoryProxy.I @@ -71,7 +71,7 @@ is_on(NotifySeverity severity) { template INLINE bool NotifyCategoryProxy:: is_spam() { -#ifndef NDEBUG +#ifdef NOTIFY_DEBUG return get_unsafe_ptr()->is_spam(); #else return false; @@ -86,7 +86,7 @@ is_spam() { template INLINE bool NotifyCategoryProxy:: is_debug() { -#ifndef NDEBUG +#ifdef NOTIFY_DEBUG return get_unsafe_ptr()->is_debug(); #else return false; diff --git a/dtool/src/dconfig/notifyCategoryProxy.h b/dtool/src/dconfig/notifyCategoryProxy.h index 56000f81ab..f202d840e8 100644 --- a/dtool/src/dconfig/notifyCategoryProxy.h +++ b/dtool/src/dconfig/notifyCategoryProxy.h @@ -72,7 +72,7 @@ public: INLINE bool is_on(NotifySeverity severity); -#ifndef NDEBUG +#ifdef NOTIFY_DEBUG INLINE bool is_spam(); INLINE bool is_debug(); #else diff --git a/dtool/src/interrogatedb/interrogateDatabase.cxx b/dtool/src/interrogatedb/interrogateDatabase.cxx index 9668ab31ee..2bca5a0e2e 100644 --- a/dtool/src/interrogatedb/interrogateDatabase.cxx +++ b/dtool/src/interrogatedb/interrogateDatabase.cxx @@ -34,12 +34,10 @@ InterrogateDatabase() { InterrogateDatabase *InterrogateDatabase:: get_ptr() { if (_global_ptr == (InterrogateDatabase *)NULL) { -#ifndef NDEBUG if (interrogatedb_cat->is_debug()) { interrogatedb_cat->debug() << "Creating interrogate database\n"; } -#endif _global_ptr = new InterrogateDatabase; } return _global_ptr; @@ -56,7 +54,6 @@ get_ptr() { //////////////////////////////////////////////////////////////////// void InterrogateDatabase:: request_module(InterrogateModuleDef *def) { -#ifndef NDEBUG if (interrogatedb_cat->is_debug()) { if (def->library_name == (const char *)NULL) { interrogatedb_cat->debug() @@ -66,7 +63,6 @@ request_module(InterrogateModuleDef *def) { << "Got interrogate data for module " << def->library_name << "\n"; } } -#endif int num_indices = def->next_index - def->first_index; if (num_indices > 0) {