xtd_c - Reference Guide 0.2.0
types.h
Go to the documentation of this file.
1 
6 #pragma once
7 #include <stddef.h>
8 #include <stdint.h>
9 #include <stdbool.h>
10 #include <stdlib.h>
11 
13 #ifdef NDEBUG
14 
15 #define __XTD_CHECK_TYPE_CAST__(object, global_type, current_type) \
16  ((current_type*)object)
17 #else
18 #define __XTD_CHECK_TYPE_CAST__(object, global_type, current_type) \
19  ((current_type*)object)
20 #endif
21 
22 #define XTD_TYPE_CAST(object, global_type, current_type) \
23  __XTD_CHECK_TYPE_CAST__(object, global_type, current_type)
24 
25 typedef uint8_t byte_t;
26 typedef char char_t;
27 typedef long double decimal_t;
28 typedef int8_t sbyte_t;
29 typedef float single_t;
30 typedef unsigned char uchar_t;
31 typedef unsigned short ushort_t;
32 typedef unsigned long ulong_t;
33 
34 #if defined(__linux__) && defined(_LP64)
35 typedef long long int llong_t;
36 typedef unsigned long long int ullong_t;
37 #else
38 typedef long llong_t;
39 typedef unsigned long ullong_t;
40 #endif
41 
49 typedef uint8_t byte;
50 
57 typedef char char8;
58 
65 typedef uint16_t char16;
66 
73 typedef uint32_t char32;
74 
81 typedef wchar_t wchar;
82 
89 typedef decimal_t decimal;
90 
97 typedef int16_t int16;
98 
105 typedef int32_t int32;
106 
113 typedef int64_t int64;
114 
121 typedef intptr_t intptr;
122 
129 typedef void* xtd_handle;
130 
131 #ifndef inline_
132 # if __GNUC__ // && !__GNUC_STDC_INLINE__
133 # define inline_ extern inline
134 # else
135 # define inline_ inline
136 # endif
137 #endif
uint16_t char16
Represents a 8-bit unicode character.
Definition: types.h:65
uint32_t char32
Represents a 32-bit unicode character.
Definition: types.h:73
decimal_t decimal
Represents a decimal-precision floating-point number.
Definition: types.h:89
wchar_t wchar
Represents a wide character.
Definition: types.h:81
char char8
Represents a 16-bit unicode character.
Definition: types.h:57
intptr_t intptr
Represent a pointer or a handle.
Definition: types.h:121
int64_t int64
Represents a 64-bit signed integer.
Definition: types.h:113
uint8_t byte
Represents a 8-bit unsigned integer.
Definition: types.h:49
int32_t int32
Represents a 32-bit signed integer.
Definition: types.h:105
int16_t int16
Represents a 16-bit signed integer.
Definition: types.h:97
void * xtd_handle
Represent a pointer or a handle.
Definition: types.h:129