diff --git a/dtool/src/dconfig/notifyCategory.I b/dtool/src/dconfig/notifyCategory.I index 23ff93efb5..c678c81a72 100644 --- a/dtool/src/dconfig/notifyCategory.I +++ b/dtool/src/dconfig/notifyCategory.I @@ -57,6 +57,7 @@ is_on(NotifySeverity severity) const { return (int)severity >= (int)_severity; } +#ifndef NDEBUG //////////////////////////////////////////////////////////////////// // Function: NotifyCategory::is_spam // Access: Public @@ -64,11 +65,7 @@ is_on(NotifySeverity severity) const { //////////////////////////////////////////////////////////////////// INLINE bool NotifyCategory:: is_spam() const { -#ifndef NDEBUG return is_on(NS_spam); -#else - return false; -#endif } //////////////////////////////////////////////////////////////////// @@ -78,12 +75,35 @@ is_spam() const { //////////////////////////////////////////////////////////////////// INLINE bool NotifyCategory:: is_debug() const { -#ifndef NDEBUG return is_on(NS_debug); -#else - return false; -#endif } +#else +//////////////////////////////////////////////////////////////////// +// 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. +//////////////////////////////////////////////////////////////////// +INLINE bool NotifyCategory:: +is_spam() { + return false; +} + +//////////////////////////////////////////////////////////////////// +// 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. +//////////////////////////////////////////////////////////////////// +INLINE bool NotifyCategory:: +is_debug() { + return false; +} +#endif //////////////////////////////////////////////////////////////////// // Function: NotifyCategory::is_info diff --git a/dtool/src/dconfig/notifyCategory.h b/dtool/src/dconfig/notifyCategory.h index b341e11084..2ea137afea 100644 --- a/dtool/src/dconfig/notifyCategory.h +++ b/dtool/src/dconfig/notifyCategory.h @@ -34,8 +34,14 @@ PUBLISHED: INLINE void set_severity(NotifySeverity severity); INLINE bool is_on(NotifySeverity severity) const; + +#ifndef NDEBUG INLINE bool is_spam() const; INLINE bool is_debug() const; +#else + INLINE static bool is_spam(); + INLINE static bool is_debug(); +#endif INLINE bool is_info() const; INLINE bool is_warning() const; INLINE bool is_error() const; diff --git a/dtool/src/dconfig/notifyCategoryProxy.h b/dtool/src/dconfig/notifyCategoryProxy.h index 23abe4fbaf..56000f81ab 100644 --- a/dtool/src/dconfig/notifyCategoryProxy.h +++ b/dtool/src/dconfig/notifyCategoryProxy.h @@ -71,8 +71,14 @@ public: // used only in non-static-init functions. INLINE bool is_on(NotifySeverity severity); + +#ifndef NDEBUG INLINE bool is_spam(); INLINE bool is_debug(); +#else + INLINE static bool is_spam(); + INLINE static bool is_debug(); +#endif INLINE bool is_info(); INLINE bool is_warning(); INLINE bool is_error();