From b4709429ed88563982412a5a027b92143c37e268 Mon Sep 17 00:00:00 2001 From: Nakidai Date: Thu, 31 Jul 2025 17:12:27 +0300 Subject: Add files --- shorttypes.h | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 shorttypes.h (limited to 'shorttypes.h') 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 + +#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 */ -- cgit 1.4.1