aboutsummaryrefslogtreecommitdiff
path: root/src/util_ct.h
blob: c8068c7600b5d97082f23de9d6c4f2b5149c6c2a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
#pragma once
#include <assert.h>


#define PRNE_LIMIT_ENUM(t,x,l) _Static_assert(x<=l,"enum overflow: "#t)

#define prne_op_min(a, b) (a < b ? a : b)
#define prne_op_max(a, b) (a > b ? a : b)
#define prne_op_spaceship(a, b) (a == b ? 0 : a < b ? -1 : 1)

#if !defined(memzero)
#define memzero(addr, len) memset(addr, 0, len)
#endif