Pārlūkot izejas kodu

notify: work around GCC 4.7 compilation issue with constexpr

This can be reverted on master if we can verify that it does work with GCC 4.8.
rdb 6 gadi atpakaļ
vecāks
revīzija
5a23821ac1
2 mainītis faili ar 8 papildinājumiem un 7 dzēšanām
  1. 8 2
      dtool/src/prc/notifyCategory.I
  2. 0 5
      dtool/src/prc/notifyCategory.h

+ 8 - 2
dtool/src/prc/notifyCategory.I

@@ -64,14 +64,17 @@ is_on(NotifySeverity severity) const {
   return (int)severity >= (int)get_severity();
 }
 
-#if defined(NOTIFY_DEBUG) || defined(CPPPARSER)
 /**
  * A shorthand way to write is_on(NS_spam).
  */
 INLINE bool NotifyCategory::
 is_spam() const {
+#if defined(NOTIFY_DEBUG) || defined(CPPPARSER)
   // Instruct the compiler to optimize for the usual case.
   return UNLIKELY(is_on(NS_spam));
+#else
+  return false;
+#endif
 }
 
 /**
@@ -79,10 +82,13 @@ is_spam() const {
  */
 INLINE bool NotifyCategory::
 is_debug() const {
+#if defined(NOTIFY_DEBUG) || defined(CPPPARSER)
   // Instruct the compiler to optimize for the usual case.
   return UNLIKELY(is_on(NS_debug));
-}
+#else
+  return false;
 #endif
+}
 
 /**
  * A shorthand way to write is_on(NS_info).

+ 0 - 5
dtool/src/prc/notifyCategory.h

@@ -51,13 +51,8 @@ PUBLISHED:
   // to present a consistent interface to our scripting language, so during
   // the interrogate pass (that is, when CPPPARSER is defined), we still
   // pretend they're nonstatic.
-#if defined(NOTIFY_DEBUG) || defined(CPPPARSER)
   INLINE bool is_spam() const;
   INLINE bool is_debug() const;
-#else
-  constexpr bool is_spam() const { return false; }
-  constexpr bool is_debug() const { return false; }
-#endif
   INLINE bool is_info() const;
   INLINE bool is_warning() const;
   INLINE bool is_error() const;