#ifndef DIGITAL_CABIN_INTS_H #define DIGITAL_CABIN_INTS_H /* * Copyright (C) 2023 dweller@cabin.digital * SPDX-License-Identifier: BSD-3-Clause-Clear */ /* TODO: different platforms */ #if defined(__GNUC__) #include typedef uint8_t u8; typedef uint16_t u16; typedef uint32_t u32; typedef uint64_t u64; typedef int8_t s8; typedef int16_t s16; typedef int32_t s32; typedef int64_t s64; #else typedef unsigned char u8; typedef unsigned short u16; typedef unsigned int u32; typedef unsigned long u64; /* XXX: ANSI C doesn't have 64bit int, this is a stub */ typedef signed char s8; typedef signed short s16; typedef signed int s32; typedef signed long s64; /* XXX: ANSI C doesn't have 64bit int, this is a stub */ #error "Unsupported compiler" #endif /* GCC */ typedef float f32; typedef double f64; /* TODO: maybe check if already defined? */ typedef u8 bool; #define true 1 #define false 0 #endif /* DIGITAL_CABIN_INTS_H */