kiba-engine
defines.h
Go to the documentation of this file.
1 
10 #pragma once
11 
12 #include <kiba/core/config.h>
13 #include <kiba/core/log.h>
14 #include <kiba/core/types.h>
15 #include <kiba/core/version.h>
16 
18 #define KB_NULL NULL
19 
21 #define UNUSED(x) (void) x
22 
24 #define TYPE_OF(x) __typeof__(x)
25 
27 #define ALIGN_OF(x) _Alignof(x)
28 
35 #define KB_MIN(x, y) ((x) < (y) ? (x) : (y))
36 
43 #define KB_MAX(x, y) ((x) > (y) ? (x) : (y))
44 
55 #define KB_CLAMP(x, min, max) ((x) < (min) ? (min) : (x) > (max) ? (max) : (x))
56 
62 #define KB_FLAGS_ALL_SET(value, flags) (((value) & (flags)) == (flags))
63 
67 #define KB_FLAGS_ANY_SET(value, flags) (((value) & (flags)) != 0)
68 
72 #define KB_UBIT(n) ((u64) 1 << n)
73 
77 #define KB_IBIT(n) ((i64) 1 << n)
Logging system.