summaryrefslogtreecommitdiff
path: root/src/common.h
blob: 1add4dbc9aa38aee520cdc3af45ad27db574de95 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#pragma once

#include <stdint.h>
#include <stddef.h>

#define KiB(n) ((u64)n<<10)
#define MiB(n) ((u64)n<<20)
#define GiB(n) ((u64)n<<30)

#define MAX(n, m) ((n > m) ? (n) : (m))
#define MIN(n, m) ((n < m) ? (n) : (m))
#define ALIGN_UP_POW2(n, m) (((u64)(n) + (u64)(m) - 1) & (~((u64)(m) - 1)))

typedef   int8_t  i8;
typedef  int16_t i16;
typedef  int32_t i32;
typedef  int64_t i64;
typedef  uint8_t  u8;
typedef uint16_t u16;
typedef uint32_t u32;
typedef uint64_t u64;

typedef       i8  b8;
typedef      i32 b32;

typedef    float f32;
typedef   double f64;

#define ARENA_ALIGN (sizeof(void*))