mirror of
https://github.com/panda3d/panda3d.git
synced 2025-09-28 15:53:55 -04:00
notify: fix ABI incompatibility with NDEBUG on Windows
On MSVC (not with GCC/clang), adding `static` changes the mangled symbol name, so we shouldn't add that when building with NDEBUG. On GCC/clang, it doesn't, but adding `const` does, and C++11 rules make `constexpr` methods implicitly `const`, so I've removed the `constexpr` variants from NotifyCategoryProxy for now. Hopefully the compiler is still smart enough to compile out any references when compiling with NDEBUG.
This commit is contained in:
parent
72b1814331
commit
d7681b23d3
@ -55,8 +55,8 @@ PUBLISHED:
|
||||
INLINE bool is_spam() const;
|
||||
INLINE bool is_debug() const;
|
||||
#else
|
||||
constexpr static bool is_spam() { return false; }
|
||||
constexpr static bool is_debug() { return false; }
|
||||
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;
|
||||
|
@ -65,26 +65,30 @@ is_on(NotifySeverity severity) {
|
||||
/**
|
||||
*
|
||||
*/
|
||||
#ifdef NOTIFY_DEBUG
|
||||
template<class GetCategory>
|
||||
INLINE bool NotifyCategoryProxy<GetCategory>::
|
||||
is_spam() {
|
||||
#ifdef NOTIFY_DEBUG
|
||||
// Instruct the compiler to optimize for the usual case.
|
||||
return UNLIKELY(get_unsafe_ptr()->is_spam());
|
||||
}
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
#ifdef NOTIFY_DEBUG
|
||||
template<class GetCategory>
|
||||
INLINE bool NotifyCategoryProxy<GetCategory>::
|
||||
is_debug() {
|
||||
#ifdef NOTIFY_DEBUG
|
||||
// Instruct the compiler to optimize for the usual case.
|
||||
return UNLIKELY(get_unsafe_ptr()->is_debug());
|
||||
}
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
|
@ -71,13 +71,8 @@ public:
|
||||
|
||||
INLINE bool is_on(NotifySeverity severity);
|
||||
|
||||
#if defined(NOTIFY_DEBUG) || defined(CPPPARSER)
|
||||
INLINE bool is_spam();
|
||||
INLINE bool is_debug();
|
||||
#else
|
||||
constexpr static bool is_spam() { return false; }
|
||||
constexpr static bool is_debug() { return false; }
|
||||
#endif
|
||||
INLINE bool is_info();
|
||||
INLINE bool is_warning();
|
||||
INLINE bool is_error();
|
||||
|
Loading…
x
Reference in New Issue
Block a user