diff options
author | Bad Diode <bd@badd10de.dev> | 2021-10-08 10:25:59 +0200 |
---|---|---|
committer | Bad Diode <bd@badd10de.dev> | 2021-10-08 10:25:59 +0200 |
commit | 96d27c2a3e1a0fa0878beb3f9cd02f4b4ed8fdbb (patch) | |
tree | 9ec40c0c37630d1b6a7546cc8c9f09fe65809861 /src/bootstrap/shorthand.h | |
download | bdl-96d27c2a3e1a0fa0878beb3f9cd02f4b4ed8fdbb.tar.gz bdl-96d27c2a3e1a0fa0878beb3f9cd02f4b4ed8fdbb.zip |
Initial commit w/ small readline echo function
Diffstat (limited to 'src/bootstrap/shorthand.h')
-rwxr-xr-x | src/bootstrap/shorthand.h | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/src/bootstrap/shorthand.h b/src/bootstrap/shorthand.h new file mode 100755 index 0000000..6fcb82c --- /dev/null +++ b/src/bootstrap/shorthand.h | |||
@@ -0,0 +1,37 @@ | |||
1 | #ifndef SHORTHAND_H | ||
2 | #define SHORTHAND_H | ||
3 | |||
4 | #include <assert.h> | ||
5 | #include <stdbool.h> | ||
6 | #include <stddef.h> | ||
7 | #include <stdint.h> | ||
8 | |||
9 | // | ||
10 | // This simple header just typedefs the basic C define types to a shorter name, | ||
11 | // loads the quality of life bool macro for _Bool and defines shorthand macros | ||
12 | // for byte sizes. | ||
13 | // | ||
14 | |||
15 | typedef uint8_t u8; | ||
16 | typedef uint16_t u16; | ||
17 | typedef uint32_t u32; | ||
18 | typedef uint64_t u64; | ||
19 | typedef int8_t s8; | ||
20 | typedef int16_t s16; | ||
21 | typedef int32_t s32; | ||
22 | typedef int64_t s64; | ||
23 | typedef volatile u8 vu8; | ||
24 | typedef volatile u16 vu16; | ||
25 | typedef volatile u32 vu32; | ||
26 | typedef volatile u64 vu64; | ||
27 | typedef volatile s8 vs8; | ||
28 | typedef volatile s16 vs16; | ||
29 | typedef volatile s32 vs32; | ||
30 | typedef volatile s64 vs64; | ||
31 | |||
32 | #define KB(N) ((u64)(N) * 1024) | ||
33 | #define MB(N) ((u64)KB(N) * 1024) | ||
34 | #define GB(N) ((u64)MB(N) * 1024) | ||
35 | #define TB(N) ((u64)GB(N) * 1024) | ||
36 | |||
37 | #endif // SHORTHAND_H | ||