mirror of
https://github.com/panda3d/panda3d.git
synced 2025-09-29 00:06:44 -04:00
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.
This commit is contained in:
parent
d7681b23d3
commit
5a23821ac1
@ -64,14 +64,17 @@ is_on(NotifySeverity severity) const {
|
|||||||
return (int)severity >= (int)get_severity();
|
return (int)severity >= (int)get_severity();
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(NOTIFY_DEBUG) || defined(CPPPARSER)
|
|
||||||
/**
|
/**
|
||||||
* A shorthand way to write is_on(NS_spam).
|
* A shorthand way to write is_on(NS_spam).
|
||||||
*/
|
*/
|
||||||
INLINE bool NotifyCategory::
|
INLINE bool NotifyCategory::
|
||||||
is_spam() const {
|
is_spam() const {
|
||||||
|
#if defined(NOTIFY_DEBUG) || defined(CPPPARSER)
|
||||||
// Instruct the compiler to optimize for the usual case.
|
// Instruct the compiler to optimize for the usual case.
|
||||||
return UNLIKELY(is_on(NS_spam));
|
return UNLIKELY(is_on(NS_spam));
|
||||||
|
#else
|
||||||
|
return false;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -79,10 +82,13 @@ is_spam() const {
|
|||||||
*/
|
*/
|
||||||
INLINE bool NotifyCategory::
|
INLINE bool NotifyCategory::
|
||||||
is_debug() const {
|
is_debug() const {
|
||||||
|
#if defined(NOTIFY_DEBUG) || defined(CPPPARSER)
|
||||||
// Instruct the compiler to optimize for the usual case.
|
// Instruct the compiler to optimize for the usual case.
|
||||||
return UNLIKELY(is_on(NS_debug));
|
return UNLIKELY(is_on(NS_debug));
|
||||||
}
|
#else
|
||||||
|
return false;
|
||||||
#endif
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A shorthand way to write is_on(NS_info).
|
* A shorthand way to write is_on(NS_info).
|
||||||
|
@ -51,13 +51,8 @@ PUBLISHED:
|
|||||||
// to present a consistent interface to our scripting language, so during
|
// to present a consistent interface to our scripting language, so during
|
||||||
// the interrogate pass (that is, when CPPPARSER is defined), we still
|
// the interrogate pass (that is, when CPPPARSER is defined), we still
|
||||||
// pretend they're nonstatic.
|
// pretend they're nonstatic.
|
||||||
#if defined(NOTIFY_DEBUG) || defined(CPPPARSER)
|
|
||||||
INLINE bool is_spam() const;
|
INLINE bool is_spam() const;
|
||||||
INLINE bool is_debug() 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_info() const;
|
||||||
INLINE bool is_warning() const;
|
INLINE bool is_warning() const;
|
||||||
INLINE bool is_error() const;
|
INLINE bool is_error() const;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user