prc: work around macOS compiler error when making optimized build

This commit is contained in:
rdb 2018-10-15 22:21:45 +02:00
parent bcc2e3e404
commit ebfb3702ac
4 changed files with 4 additions and 36 deletions

View File

@ -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
/**

View File

@ -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;

View File

@ -72,12 +72,6 @@ is_spam() {
// Instruct the compiler to optimize for the usual case.
return UNLIKELY(get_unsafe_ptr()->is_spam());
}
#else
template<class GetCategory>
constexpr bool NotifyCategoryProxy<GetCategory>::
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<class GetCategory>
constexpr bool NotifyCategoryProxy<GetCategory>::
is_debug() {
return false;
}
#endif
/**

View File

@ -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();