From ebfb3702acf79a54ab3ce455ff6d0abfbcfd66e9 Mon Sep 17 00:00:00 2001 From: rdb Date: Mon, 15 Oct 2018 22:21:45 +0200 Subject: [PATCH] prc: work around macOS compiler error when making optimized build --- dtool/src/prc/notifyCategory.I | 20 -------------------- dtool/src/prc/notifyCategory.h | 4 ++-- dtool/src/prc/notifyCategoryProxy.I | 12 ------------ dtool/src/prc/notifyCategoryProxy.h | 4 ++-- 4 files changed, 4 insertions(+), 36 deletions(-) diff --git a/dtool/src/prc/notifyCategory.I b/dtool/src/prc/notifyCategory.I index 5793917d91..20678fbace 100644 --- a/dtool/src/prc/notifyCategory.I +++ b/dtool/src/prc/notifyCategory.I @@ -82,26 +82,6 @@ is_debug() const { // Instruct the compiler to optimize for the usual case. return UNLIKELY(is_on(NS_debug)); } -#else -/** - * 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. - */ -constexpr bool NotifyCategory:: -is_spam() { - return false; -} - -/** - * 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. - */ -constexpr bool NotifyCategory:: -is_debug() { - return false; -} #endif /** diff --git a/dtool/src/prc/notifyCategory.h b/dtool/src/prc/notifyCategory.h index f3e99b09ba..9a2a9fa4e2 100644 --- a/dtool/src/prc/notifyCategory.h +++ b/dtool/src/prc/notifyCategory.h @@ -55,8 +55,8 @@ PUBLISHED: INLINE bool is_spam() const; INLINE bool is_debug() const; #else - constexpr static bool is_spam(); - constexpr static bool is_debug(); + constexpr static bool is_spam() { return false; } + constexpr static bool is_debug() { return false; } #endif INLINE bool is_info() const; INLINE bool is_warning() const; diff --git a/dtool/src/prc/notifyCategoryProxy.I b/dtool/src/prc/notifyCategoryProxy.I index eaca9b6e33..fbdac1f0ca 100644 --- a/dtool/src/prc/notifyCategoryProxy.I +++ b/dtool/src/prc/notifyCategoryProxy.I @@ -72,12 +72,6 @@ is_spam() { // Instruct the compiler to optimize for the usual case. return UNLIKELY(get_unsafe_ptr()->is_spam()); } -#else -template -constexpr bool NotifyCategoryProxy:: -is_spam() { - return false; -} #endif /** @@ -90,12 +84,6 @@ is_debug() { // Instruct the compiler to optimize for the usual case. return UNLIKELY(get_unsafe_ptr()->is_debug()); } -#else -template -constexpr bool NotifyCategoryProxy:: -is_debug() { - return false; -} #endif /** diff --git a/dtool/src/prc/notifyCategoryProxy.h b/dtool/src/prc/notifyCategoryProxy.h index 06f38ec804..5465529583 100644 --- a/dtool/src/prc/notifyCategoryProxy.h +++ b/dtool/src/prc/notifyCategoryProxy.h @@ -75,8 +75,8 @@ public: INLINE bool is_spam(); INLINE bool is_debug(); #else - constexpr static bool is_spam(); - constexpr static bool is_debug(); + constexpr static bool is_spam() { return false; } + constexpr static bool is_debug() { return false; } #endif INLINE bool is_info(); INLINE bool is_warning();