initial commit
This commit is contained in:
13
core/include/blue/core/misc.h
Normal file
13
core/include/blue/core/misc.h
Normal file
@@ -0,0 +1,13 @@
|
||||
#ifndef BLUELIB_MISC_H_
|
||||
#define BLUELIB_MISC_H_
|
||||
|
||||
#define b_unbox(type, box, member) \
|
||||
((type *_Nonnull)((box) ? (uintptr_t)(box) - (offsetof(type, member)) : 0))
|
||||
|
||||
#define z__b_merge_(a, b) a##b
|
||||
#define z__b_label_(a) z__b_merge_(__unique_name_, a)
|
||||
#define z__b_unique_name() z__b_label_(__LINE__)
|
||||
#define z__b_numargs(arg_type, ...) \
|
||||
(sizeof((arg_type[]) {__VA_ARGS__}) / sizeof(arg_type))
|
||||
|
||||
#endif // C_MISC_H_
|
||||
Reference in New Issue
Block a user