blob: 79af0abb2fbfd4e40f187fadee1e62b828453f6d [file] [log] [blame]
swissChilid8137922021-02-17 15:34:07 -08001#pragma once
2
3typedef unsigned char uchar;
4typedef unsigned short ushort;
5typedef unsigned int uint;
6typedef unsigned long ulong;
7
swissChili825d46b2021-02-21 10:14:16 -08008typedef unsigned long size_t;
swissChili0b35bf22021-02-18 12:49:40 -08009
swissChilicbd43632021-07-17 16:19:44 -070010typedef signed long ssize_t;
11
swissChilie4f01992021-02-25 15:38:12 -080012typedef _Bool bool;
swissChili0b35bf22021-02-18 12:49:40 -080013
14enum
15{
16 false = 0,
17 true,
18};
swissChili825d46b2021-02-21 10:14:16 -080019
swissChili19ef4182021-02-21 17:45:51 -080020#define NULL 0
swissChilic2e62ed2021-03-10 17:04:18 -080021#define MIN(a, b) ((a)>(b)?(b):(a))
22#define MAX(a, b) ((a)>(b)?(a):(b))
swissChilie20b79b2021-03-17 21:20:13 -070023
swissChilid98781b2021-07-25 21:04:17 -070024#define UNUSED(val) ((void)(val));
25
swissChili36ed5d72021-07-23 14:56:36 -070026/// Pads num to an integer size boundary
27#define PAD(num) ((num + 3) & (~0b11))
28
29/// Perform integer division and round up
30#define IDIV_CEIL(num, den) (((num) + ((den) - 1)) / (den))
31
swissChilie20b79b2021-03-17 21:20:13 -070032// Coerce into 1 or 0
33#define BOOL(a) (!(!(a)))