odyssey/sources/mm_macro.h

17 lines
257 B
C

#ifndef MM_MACRO_H
#define MM_MACRO_H
/*
* machinarium.
*
* cooperative multitasking engine.
*/
#define mm_container_of(ptr, t, f) \
((t*)((char*)(ptr) - __builtin_offsetof(t, f)))
#define mm_cast(type, ptr) \
((type)(ptr))
#endif /* MM_MACRO_H */