feat: T##_as_Mirror is no longer defined static

This commit is contained in:
Sara 2024-01-12 09:33:21 +01:00
parent 0c6f1dd8cf
commit e13f9fc63a
2 changed files with 4 additions and 5 deletions

View file

@ -46,7 +46,7 @@ extern const void* mirror_get_typeclass(void* data, IMirror const* tc, const cha
}
#define impl_Mirror_for(T, get_typestring_f, get_typeid_f, get_typeclasses_f)\
static inline Mirror T##_as_Mirror(T* x) {\
Mirror T##_as_Mirror(T* x) {\
TC_FN_TYPECHECK(const char*, get_typestring_f, T*);\
TC_FN_TYPECHECK(typeid, get_typeid_f, T*);\
TC_FN_TYPECHECK(List*, get_typeclasses_f, T*);\
@ -62,8 +62,7 @@ static inline Mirror T##_as_Mirror(T* x) {\
extern const char* T##_get_typestring(T* self);\
extern typeid T##_get_typeid(T* self);\
extern List* T##_get_typeclasses(T* self);\
impl_Mirror_for(T, T##_get_typestring, T##_get_typeid, T##_get_typeclasses)
decl_typeclass_impl(Mirror, T)
#define START_REFLECT(T)\
const char* T##_get_typestring(T* self) {\
@ -85,7 +84,7 @@ List* T##_get_typeclasses(T* self) {\
if(!init_flag) {\
init_flag = 1,\
typeclasses = list_init(sizeof(MirroredTypeclass));\
MirroredTypeclass tc;\
MirroredTypeclass tc;
#define REFLECT_TYPECLASS(T, TypeClass_)\
tc = (MirroredTypeclass){\
@ -99,5 +98,6 @@ List* T##_get_typeclasses(T* self) {\
}\
return &typeclasses;\
}\
impl_Mirror_for(T, T##_get_typestring, T##_get_typeid, T##_get_typeclasses)
#endif // !_fencer_mirror_h

View file

@ -61,7 +61,6 @@ void PlayerOnOverlap(Player* self, Collider* other);
static long PlayerGetDepth(Player* self) { return (int)(-10-self->transform.position.y * 1000); }
DECL_REFLECT(Player);
decl_typeclass_impl(BehaviourEntity, Player)
decl_typeclass_impl(Drop, Player)
decl_typeclass_impl(Transformable, Player)