diff options
| author | Nakidai <nakidai@disroot.org> | 2025-07-31 17:12:27 +0300 |
|---|---|---|
| committer | Nakidai <nakidai@disroot.org> | 2025-07-31 17:12:27 +0300 |
| commit | b4709429ed88563982412a5a027b92143c37e268 (patch) | |
| tree | cd56dfeac7cafcfcb69925b12376d79b8776d3fd /shorttypes.h | |
| download | fatvpn-b4709429ed88563982412a5a027b92143c37e268.tar.gz fatvpn-b4709429ed88563982412a5a027b92143c37e268.zip | |
Add files v1.0.0
Diffstat (limited to 'shorttypes.h')
| -rw-r--r-- | shorttypes.h | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/shorttypes.h b/shorttypes.h new file mode 100644 index 0000000..7b2df58 --- /dev/null +++ b/shorttypes.h @@ -0,0 +1,36 @@ +#ifndef SHORTTYPES_H +#define SHORTTYPES_H +#include <limits.h> + +#if CHAR_BIT != 8 + #error "CHAR_BIT != 8" +#endif + +#if USHRT_MAX != 65535 + #error "USHRT_MAX != 65535" +#endif + +#if UINT_MAX != 4294967295U + #error "UINT_MAX != 4294967295U" +#endif + +typedef signed char s8; +typedef signed short s16; +typedef signed int s32; +typedef unsigned char u8; +typedef unsigned short u16; +typedef unsigned int u32; + +#ifdef ULLONG_MAX + #if ULLONG_MAX == 18446744073709551615ULL + typedef signed long long s64; + typedef unsigned long long u64; + #else + #error "ULLONG_MAX != 18446744073709551615ULL" + #endif +#else + #error "no long long type" +#endif + + +#endif /* SHORTTYPES_H */ |