solanaceae_tox/solanaceae/tox_messages/msg_components_id.inl
Green Sky e2c9880a15
major msg -> obj file transfer refactor
mostly done, some things are hacky or not done
2024-07-29 20:03:24 +02:00

26 lines
539 B
C++

#pragma once
#include "./msg_components.hpp"
#include <entt/core/type_info.hpp>
// TODO: move more central
#define DEFINE_COMP_ID(x) \
template<> \
constexpr entt::id_type entt::type_hash<x>::value() noexcept { \
using namespace entt::literals; \
return #x##_hs; \
} \
template<> \
constexpr std::string_view entt::type_name<x>::value() noexcept { \
return #x; \
}
// cross compile(r) stable ids
DEFINE_COMP_ID(Message::Components::ToxFriendMessageID)
DEFINE_COMP_ID(Message::Components::ToxGroupMessageID)
#undef DEFINE_COMP_ID