feat: T##_as_Mirror is no longer defined static
This commit is contained in:
		
							parent
							
								
									0c6f1dd8cf
								
							
						
					
					
						commit
						e13f9fc63a
					
				| 
						 | 
					@ -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)\
 | 
					#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(const char*, get_typestring_f, T*);\
 | 
				
			||||||
    TC_FN_TYPECHECK(typeid, get_typeid_f, T*);\
 | 
					    TC_FN_TYPECHECK(typeid, get_typeid_f, T*);\
 | 
				
			||||||
    TC_FN_TYPECHECK(List*, get_typeclasses_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 const char* T##_get_typestring(T* self);\
 | 
				
			||||||
extern typeid T##_get_typeid(T* self);\
 | 
					extern typeid T##_get_typeid(T* self);\
 | 
				
			||||||
extern List* T##_get_typeclasses(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)\
 | 
					#define START_REFLECT(T)\
 | 
				
			||||||
const char* T##_get_typestring(T* self) {\
 | 
					const char* T##_get_typestring(T* self) {\
 | 
				
			||||||
| 
						 | 
					@ -85,7 +84,7 @@ List* T##_get_typeclasses(T* self) {\
 | 
				
			||||||
    if(!init_flag) {\
 | 
					    if(!init_flag) {\
 | 
				
			||||||
        init_flag = 1,\
 | 
					        init_flag = 1,\
 | 
				
			||||||
        typeclasses = list_init(sizeof(MirroredTypeclass));\
 | 
					        typeclasses = list_init(sizeof(MirroredTypeclass));\
 | 
				
			||||||
        MirroredTypeclass tc;\
 | 
					        MirroredTypeclass tc;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#define REFLECT_TYPECLASS(T, TypeClass_)\
 | 
					#define REFLECT_TYPECLASS(T, TypeClass_)\
 | 
				
			||||||
        tc = (MirroredTypeclass){\
 | 
					        tc = (MirroredTypeclass){\
 | 
				
			||||||
| 
						 | 
					@ -99,5 +98,6 @@ List* T##_get_typeclasses(T* self) {\
 | 
				
			||||||
    }\
 | 
					    }\
 | 
				
			||||||
    return &typeclasses;\
 | 
					    return &typeclasses;\
 | 
				
			||||||
}\
 | 
					}\
 | 
				
			||||||
 | 
					impl_Mirror_for(T, T##_get_typestring, T##_get_typeid, T##_get_typeclasses)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#endif // !_fencer_mirror_h
 | 
					#endif // !_fencer_mirror_h
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -61,7 +61,6 @@ void PlayerOnOverlap(Player* self, Collider* other);
 | 
				
			||||||
static long PlayerGetDepth(Player* self) { return (int)(-10-self->transform.position.y * 1000); }
 | 
					static long PlayerGetDepth(Player* self) { return (int)(-10-self->transform.position.y * 1000); }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
DECL_REFLECT(Player);
 | 
					DECL_REFLECT(Player);
 | 
				
			||||||
 | 
					 | 
				
			||||||
decl_typeclass_impl(BehaviourEntity, Player)
 | 
					decl_typeclass_impl(BehaviourEntity, Player)
 | 
				
			||||||
decl_typeclass_impl(Drop, Player)
 | 
					decl_typeclass_impl(Drop, Player)
 | 
				
			||||||
decl_typeclass_impl(Transformable, Player)
 | 
					decl_typeclass_impl(Transformable, Player)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in a new issue