Forráskód Böngészése

*** empty log message ***

David Rose 24 éve
szülő
commit
d7ac937b37

+ 26 - 6
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
+////////////////////////////////////////////////////////////////////
+//     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
 }
+#endif
 
 ////////////////////////////////////////////////////////////////////
 //     Function: NotifyCategory::is_info

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

+ 6 - 0
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();