diff options
author | justanothercatgirl <sotov2070@gmail.com> | 2024-06-22 18:16:54 +0300 |
---|---|---|
committer | justanothercatgirl <sotov2070@gmail.com> | 2024-06-22 18:16:54 +0300 |
commit | 57033d0ef1810abf4edd9d8e57a95a5795e5a5a9 (patch) | |
tree | b736fc7f72a7d8d720d5c4b86e736a522e07c53e /include/rstypes.h | |
parent | 437c40d8bcd533c8af6804f299f5e0cb974f7a9d (diff) |
added `rstypes` header.
Diffstat (limited to 'include/rstypes.h')
-rw-r--r-- | include/rstypes.h | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/include/rstypes.h b/include/rstypes.h new file mode 100644 index 0000000..5af5ec5 --- /dev/null +++ b/include/rstypes.h @@ -0,0 +1,39 @@ +#ifndef JUSTANOTHERCATGITL_RSTYPES_H +#define JUSTANOTHERCATGITL_RSTYPES_H + +#include <stdint.h> + +typedef uint8_t u8; +typedef int8_t i8; +typedef uint16_t u16; +typedef int16_t i16; +typedef uint32_t u32; +typedef int32_t i32; +typedef uint64_t u64; +typedef int64_t i64; + +typedef float f32; +typedef double f64; + + +#if defined(__SIZEOF_LONG_DOUBLE__) && __SIZEOF_LONG_DOUBLE__ == 128/8 +typedef long double f128; +#else // __SIZEOF_LONG_DOUBLE__ + #if defined(__clang__) || defined(__GNUC__) + typedef __float128 f128; + #else + #define f128 "128-bit floats are not supported on this platform/compiler" + #endif // __clang__ || __GNUC__ +#endif // __SIZEOF_LONG_DOUBLE__ + +#ifdef RS_TYPES_USE_128 + #if defined(__clang__) || defined(__GNUC__) + typedef __int128 i128; + typedef unsigned __int128 u128; + #else // __clang__ || __GNUC__ + #define i128 "128-bit integers are not supported in this compiler" + #define u128 "128-bit integers are not supported in this compiler" + #endif // __clang__ || __GNUC__ +#endif // RS_TYPES_USE_128 + +#endif // JUSTANOTHERCATGITL_RSTYPES_H |