feat: added tc_is_null and tc_null to typeclass_helpers.h
This commit is contained in:
		
							parent
							
								
									09bb08dc79
								
							
						
					
					
						commit
						a72494b52a
					
				|  | @ -7,7 +7,9 @@ __Return (*const __Name##_)(__VA_ARGS__) = __Name; (void)__Name##_ | |||
| #define decl_typeclass_impl(__Typeclass, __Type)\ | ||||
| extern __Typeclass __Type##_as_##__Typeclass(__Type*); | ||||
| 
 | ||||
| #define new(T) malloc(sizeof(T)) | ||||
| #define new_as(T, TC) T##_as_##TC(new(T)) | ||||
| #define new(T) (malloc(sizeof(T))) | ||||
| #define new_as(T, TC) (T##_as_##TC(new(T))) | ||||
| #define tc_is_null(SELF) (SELF.data == NULL && SELF.tc == NULL) | ||||
| #define tc_null(TC) (TC){.data=NULL, .tc=NULL} | ||||
| 
 | ||||
| #endif // !CUTES_TYPECLASS_HELPERS_H
 | ||||
|  |  | |||
		Loading…
	
		Reference in a new issue
	
	 Sara
						Sara