Browse Source

*** empty log message ***

David Rose 24 years ago
parent
commit
6e59eb3ac5

+ 6 - 0
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

+ 3 - 0
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]
 

+ 9 - 9
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() {

+ 1 - 1
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

+ 2 - 2
dtool/src/dconfig/notifyCategoryProxy.I

@@ -71,7 +71,7 @@ is_on(NotifySeverity severity) {
 template<class GetCategory>
 INLINE bool NotifyCategoryProxy<GetCategory>::
 is_spam() {
-#ifndef NDEBUG
+#ifdef NOTIFY_DEBUG
   return get_unsafe_ptr()->is_spam();
 #else
   return false;
@@ -86,7 +86,7 @@ is_spam() {
 template<class GetCategory>
 INLINE bool NotifyCategoryProxy<GetCategory>::
 is_debug() {
-#ifndef NDEBUG
+#ifdef NOTIFY_DEBUG
   return get_unsafe_ptr()->is_debug();
 #else
   return false;

+ 1 - 1
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

+ 0 - 4
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) {