]> git.lizzy.rs Git - dragonblocks_alpha.git/blob - src/util.h
Fix UB/leaks in server
[dragonblocks_alpha.git] / src / util.h
1 #ifndef _UTIL_H_
2 #define _UTIL_H_
3
4 #define CMPBOUNDS(x) ((x) == 0 ? 0 : (x) > 0 ? 1 : -1)                       // resolves to 1 if x > 0, 0 if x == 0 and -1 if x < 0
5 #define fallthrough __attribute__ ((fallthrough))                            // prevent compiler warning about implicit fallthrough with style
6 #define unused __attribute__ ((unused))
7 #define U32(x) (((u32) 1 << 31) + (x))
8
9 char *format_string(const char *format, ...);
10
11 #endif