config/type_id: minor changes

This commit is contained in:
Michele Caini
2020-04-29 01:05:17 +02:00
parent 89dc7f817f
commit 090a2595e1
2 changed files with 6 additions and 10 deletions

View File

@@ -55,12 +55,13 @@
#ifndef ENTT_STANDARD_CPP
# if defined _MSC_VER
# define ENTT_PRETTY_FUNCTION __FUNCSIG__
# define ENTT_PRETTY_FUNCTION_CONSTEXPR ENTT_PRETTY_FUNCTION
# define ENTT_PRETTY_FUNCTION_CONSTEXPR(...) constexpr
# elif defined __clang__ || (defined __GNUC__ && __GNUC__ > 8)
# define ENTT_PRETTY_FUNCTION __PRETTY_FUNCTION__
# define ENTT_PRETTY_FUNCTION_CONSTEXPR ENTT_PRETTY_FUNCTION
# define ENTT_PRETTY_FUNCTION_CONSTEXPR(...) constexpr
# elif defined __GNUC__
# define ENTT_PRETTY_FUNCTION __PRETTY_FUNCTION__
# define ENTT_PRETTY_FUNCTION_CONSTEXPR(...) __VA_ARGS__
# endif
#endif

View File

@@ -86,14 +86,9 @@ struct ENTT_API type_info {
* @brief Returns the numeric representation of a given type.
* @return The numeric representation of the given type.
*/
#if defined ENTT_PRETTY_FUNCTION_CONSTEXPR
static constexpr id_type id() ENTT_NOEXCEPT {
constexpr auto value = entt::hashed_string::value(ENTT_PRETTY_FUNCTION_CONSTEXPR);
return value;
}
#elif defined ENTT_PRETTY_FUNCTION
static id_type id() ENTT_NOEXCEPT {
static const auto value = entt::hashed_string::value(ENTT_PRETTY_FUNCTION);
#if defined ENTT_PRETTY_FUNCTION
static ENTT_PRETTY_FUNCTION_CONSTEXPR() id_type id() ENTT_NOEXCEPT {
ENTT_PRETTY_FUNCTION_CONSTEXPR(static const) auto value = entt::hashed_string::value(ENTT_PRETTY_FUNCTION);
return value;
}
#else