diff options
author | Bad Diode <bd@badd10de.dev> | 2021-10-29 15:37:28 +0200 |
---|---|---|
committer | Bad Diode <bd@badd10de.dev> | 2021-10-29 15:37:28 +0200 |
commit | e73a4c16a2269cdb2f5e7d66fb9839e4c44e14de (patch) | |
tree | c44721b005b7a0623e7acc7103ca8e21a25ff422 /src/common.h | |
parent | fcc131afdd029c606ea39f3557bc3d33a075b1de (diff) | |
download | bdl-e73a4c16a2269cdb2f5e7d66fb9839e4c44e14de.tar.gz bdl-e73a4c16a2269cdb2f5e7d66fb9839e4c44e14de.zip |
Prepare third compiler implementation
Diffstat (limited to 'src/common.h')
-rw-r--r-- | src/common.h | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/src/common.h b/src/common.h new file mode 100644 index 0000000..08e78a8 --- /dev/null +++ b/src/common.h | |||
@@ -0,0 +1,31 @@ | |||
1 | #ifndef BDL_COMMON_H | ||
2 | #define BDL_COMMON_H | ||
3 | |||
4 | #include <assert.h> | ||
5 | #include <stdbool.h> | ||
6 | #include <stddef.h> | ||
7 | #include <stdint.h> | ||
8 | |||
9 | typedef uint8_t u8; | ||
10 | typedef uint16_t u16; | ||
11 | typedef uint32_t u32; | ||
12 | typedef uint64_t u64; | ||
13 | typedef int8_t s8; | ||
14 | typedef int16_t s16; | ||
15 | typedef int32_t s32; | ||
16 | typedef int64_t s64; | ||
17 | typedef volatile u8 vu8; | ||
18 | typedef volatile u16 vu16; | ||
19 | typedef volatile u32 vu32; | ||
20 | typedef volatile u64 vu64; | ||
21 | typedef volatile s8 vs8; | ||
22 | typedef volatile s16 vs16; | ||
23 | typedef volatile s32 vs32; | ||
24 | typedef volatile s64 vs64; | ||
25 | |||
26 | #define KB(N) ((u64)(N) * 1024) | ||
27 | #define MB(N) ((u64)KB(N) * 1024) | ||
28 | #define GB(N) ((u64)MB(N) * 1024) | ||
29 | #define TB(N) ((u64)GB(N) * 1024) | ||
30 | |||
31 | #endif // BDL_COMMON_H | ||