kiba-engine
|
Global typedefs and macros. More...
#include <kiba/core/config.h>
#include <kiba/core/log.h>
#include <kiba/core/types.h>
#include <kiba/core/version.h>
Go to the source code of this file.
Macros | |
#define | KB_NULL NULL |
Value of an invalid ptr (nullptr). | |
#define | UNUSED(x) (void) x |
Mark parameter as unused. | |
#define | TYPE_OF(x) __typeof__(x) |
Call to typeof operator. | |
#define | ALIGN_OF(x) _Alignof(x) |
Get alignment of type. | |
#define | KB_MIN(x, y) ((x) < (y) ? (x) : (y)) |
Ternary to get the minimum of two numbers. More... | |
#define | KB_MAX(x, y) ((x) > (y) ? (x) : (y)) |
Ternary to get the maximum of two numbers. More... | |
#define | KB_CLAMP(x, min, max) ((x) < (min) ? (min) : (x) > (max) ? (max) : (x)) |
Clamp an input value to a certain range. More... | |
#define | KB_FLAGS_ALL_SET(value, flags) (((value) & (flags)) == (flags)) |
Check if all flags are set inside value. More... | |
#define | KB_FLAGS_ANY_SET(value, flags) (((value) & (flags)) != 0) |
Check if any of the flags are set inside value. | |
#define | KB_UBIT(n) ((u64) 1 << n) |
Get unsigned value with the n-th bit set to 1. All other bits are 0. | |
#define | KB_IBIT(n) ((i64) 1 << n) |
Get signed value with the n-th bit set to 1. All other bits are 0. | |
Global typedefs and macros.
Contains includes for logging and more concise typedefs for all datatypes. Additionally includes platform and build type specific macros.
Definition in file defines.h.
#define KB_CLAMP | ( | x, | |
min, | |||
max | |||
) | ((x) < (min) ? (min) : (x) > (max) ? (max) : (x)) |
Clamp an input value to a certain range.
#define KB_FLAGS_ALL_SET | ( | value, | |
flags | |||
) | (((value) & (flags)) == (flags)) |
#define KB_MAX | ( | x, | |
y | |||
) | ((x) > (y) ? (x) : (y)) |