diff options
author | Marvin Borner | 2021-07-04 21:31:28 +0200 |
---|---|---|
committer | Marvin Borner | 2021-07-04 21:34:15 +0200 |
commit | 9b8698769535846d029c44247956eed9a21f1185 (patch) | |
tree | 294a17af4102805ab9863274339e8e030897804e /src/loader/inc/def.h |
Initial commit
Diffstat (limited to 'src/loader/inc/def.h')
-rw-r--r-- | src/loader/inc/def.h | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/src/loader/inc/def.h b/src/loader/inc/def.h new file mode 100644 index 0000000..8c2f9aa --- /dev/null +++ b/src/loader/inc/def.h @@ -0,0 +1,28 @@ +// MIT License, Copyright (c) 2021 Marvin Borner +// Useful macros/types + +#ifndef DEF_H +#define DEF_H + +typedef signed char s8; +typedef unsigned char u8; + +typedef signed short s16; +typedef unsigned short u16; + +typedef signed int s32; +typedef unsigned int u32; + +typedef __builtin_va_list va_list; +#define va_start __builtin_va_start +#define va_end __builtin_va_end +#define va_arg __builtin_va_arg + +#define NULL ((void *)0) +#define MIN(a, b) (((a) < (b)) ? (a) : (b)) +#define MAX(a, b) (((a) > (b)) ? (a) : (b)) +#define ABS(a) (((a) < 0) ? -(a) : (a)) + +#define PACKED __attribute__((packed)) + +#endif |