Skip to content

Commit

Permalink
remove static for link time fix (cxx-20 modules)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexv-ds authored and SanderMertens committed May 2, 2024
1 parent 51a7f8f commit e752c8e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions include/flecs/addons/cpp/component.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ namespace _ {

#if defined(__GNUC__) || defined(_WIN32)
template <typename T>
inline static const char* type_name() {
inline const char* type_name() {
static const size_t len = ECS_FUNC_TYPE_LEN(const char*, type_name, ECS_FUNC_NAME);
static char result[len + 1] = {};
static const size_t front_len = ECS_FUNC_NAME_FRONT(const char*, type_name);
Expand All @@ -43,7 +43,7 @@ inline static const char* type_name() {
// Translate a typename into a language-agnostic identifier. This allows for
// registration of components/modules across language boundaries.
template <typename T>
inline static const char* symbol_name() {
inline const char* symbol_name() {
static const size_t len = ECS_FUNC_TYPE_LEN(const char*, symbol_name, ECS_FUNC_NAME);
static char result[len + 1] = {};
return ecs_cpp_get_symbol_name(result, type_name<T>(), len);
Expand Down
10 changes: 5 additions & 5 deletions include/flecs/addons/cpp/utils/signature.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,28 +11,28 @@ namespace flecs {
namespace _ {

template <typename T, if_t< is_const_p<T>::value > = 0>
static constexpr flecs::inout_kind_t type_to_inout() {
constexpr flecs::inout_kind_t type_to_inout() {
return flecs::In;
}

template <typename T, if_t< is_reference<T>::value > = 0>
static constexpr flecs::inout_kind_t type_to_inout() {
constexpr flecs::inout_kind_t type_to_inout() {
return flecs::Out;
}

template <typename T, if_not_t<
is_const_p<T>::value || is_reference<T>::value > = 0>
static constexpr flecs::inout_kind_t type_to_inout() {
constexpr flecs::inout_kind_t type_to_inout() {
return flecs::InOutDefault;
}

template <typename T, if_t< is_pointer<T>::value > = 0>
static constexpr flecs::oper_kind_t type_to_oper() {
constexpr flecs::oper_kind_t type_to_oper() {
return flecs::Optional;
}

template <typename T, if_not_t< is_pointer<T>::value > = 0>
static constexpr flecs::oper_kind_t type_to_oper() {
constexpr flecs::oper_kind_t type_to_oper() {
return flecs::And;
}

Expand Down

0 comments on commit e752c8e

Please sign in to comment.