main
 1#ifndef KC_HEADER_PLATFORM_TYPES_INCLUDED
 2#define KC_HEADER_PLATFORM_TYPES_INCLUDED
 3
 4#include "./info.h"
 5#include "../macros/macros.h"
 6
 7#if defined(KC_USE_PLATFORM_LIBC)
 8	#include <stdint.h>
 9
10	typedef uint8_t  u8;
11	typedef uint16_t u16;
12	typedef uint32_t u32;
13	typedef uint64_t u64;
14
15	typedef int8_t i8;
16	typedef int16_t i16;
17	typedef int32_t i32;
18	typedef int64_t i64;
19
20	typedef _Float16 f16;
21	typedef float  f32;
22	typedef double f64;
23
24#else
25
26	#if defined(KC_PLATFORM_LINUX) || defined(KC_PLATFORM_WINDOWS)
27
28	typedef unsigned char      u8;
29	typedef unsigned short     u16;
30	typedef unsigned int       u32;
31	typedef unsigned long long u64;
32
33	typedef signed char      i8;
34	typedef signed short     i16;
35	typedef signed int       i32;
36	typedef signed long long i64;
37
38	typedef _Float16 f16;
39	typedef float  f32;
40	typedef double f64;
41
42	typedef void ( *funcptr )( void );
43
44	#endif
45
46#endif
47
48ASSERT( sizeof( u8 ) == 1 );
49ASSERT( sizeof( u16 ) == 2 );
50ASSERT( sizeof( u32 ) == 4 );
51ASSERT( sizeof( u64 ) == 8 );
52
53ASSERT( sizeof( i8 ) == 1 );
54ASSERT( sizeof( i16 ) == 2 );
55ASSERT( sizeof( i32 ) == 4 );
56ASSERT( sizeof( i64 ) == 8 );
57
58ASSERT( sizeof(f16) == 2 );
59ASSERT( sizeof( f32 ) == 4 );
60ASSERT( sizeof( f64 ) == 8 );
61
62#endif