config: avoid using pretty function with gcc < 9 (see #396)
This commit is contained in:
@@ -56,6 +56,10 @@
|
||||
#ifndef ENTT_STANDARD_CPP
|
||||
# if defined _MSC_VER
|
||||
# define ENTT_PRETTY_FUNCTION __FUNCSIG__
|
||||
# define ENTT_PRETTY_FUNCTION_CONSTEXPR ENTT_PRETTY_FUNCTION
|
||||
# elif defined __clang__ || (defined __GNUC__ && __GNUC__ > 8)
|
||||
# define ENTT_PRETTY_FUNCTION __PRETTY_FUNCTION__
|
||||
# define ENTT_PRETTY_FUNCTION_CONSTEXPR ENTT_PRETTY_FUNCTION
|
||||
# elif defined __GNUC__
|
||||
# define ENTT_PRETTY_FUNCTION __PRETTY_FUNCTION__
|
||||
# endif
|
||||
|
||||
@@ -7,10 +7,10 @@
|
||||
#include "hashed_string.hpp"
|
||||
|
||||
|
||||
#ifdef ENTT_PRETTY_FUNCTION
|
||||
# define ENTT_TYPE_ID_API
|
||||
#else
|
||||
#ifndef ENTT_PRETTY_FUNCTION
|
||||
# define ENTT_TYPE_ID_API ENTT_API
|
||||
#else
|
||||
# define ENTT_TYPE_ID_API
|
||||
#endif
|
||||
|
||||
|
||||
@@ -55,9 +55,14 @@ struct ENTT_TYPE_ID_API type_info {
|
||||
* @brief Returns the numeric representation of a given type.
|
||||
* @return The numeric representation of the given type.
|
||||
*/
|
||||
#ifdef ENTT_PRETTY_FUNCTION
|
||||
#if defined ENTT_PRETTY_FUNCTION_CONSTEXPR
|
||||
static constexpr ENTT_ID_TYPE id() ENTT_NOEXCEPT {
|
||||
constexpr auto value = entt::hashed_string::value(ENTT_PRETTY_FUNCTION);
|
||||
constexpr auto value = entt::hashed_string::value(ENTT_PRETTY_FUNCTION_CONSTEXPR);
|
||||
return value;
|
||||
}
|
||||
#elif defined ENTT_PRETTY_FUNCTION
|
||||
static ENTT_ID_TYPE id() ENTT_NOEXCEPT {
|
||||
static const auto value = entt::hashed_string::value(ENTT_PRETTY_FUNCTION);
|
||||
return value;
|
||||
}
|
||||
#else
|
||||
|
||||
Reference in New Issue
Block a user