Raito 0.1
Loading...
Searching...
No Matches
BasicTypes.h
Go to the documentation of this file.
1/*
2MIT License
3
4Copyright (c) 2023 Víctor Falcón Zaro
5
6Permission is hereby granted, free of charge, to any person obtaining a copy
7of this software and associated documentation files (the "Software"), to deal
8in the Software without restriction, including without limitation the rights
9to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10copies of the Software, and to permit persons to whom the Software is
11furnished to do so, subject to the following conditions:
12
13The above copyright notice and this permission notice shall be included in all
14copies or substantial portions of the Software.
15
16THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22SOFTWARE.
23*/
24
25#pragma once
26#include <stdint.h>
27
29typedef signed char ibyte;
31typedef unsigned char ubyte;
32
33// Signed types
34
36typedef signed __int8 i8;
38typedef signed __int16 i16;
40typedef signed __int32 i32;
42typedef signed __int64 i64;
43
44constexpr i8 I8_MAX = INT8_MAX;
45constexpr i16 I16_MAX = INT16_MAX;
46constexpr i32 I32_MAX = INT32_MAX;
47constexpr i64 I64_MAX = INT64_MAX;
49// Unsigned
51typedef unsigned __int8 u8;
53typedef unsigned __int16 u16;
55typedef unsigned __int32 u32;
57typedef unsigned __int64 u64;
58
59constexpr u8 U8_MAX = UINT8_MAX;
60constexpr u16 U16_MAX = UINT16_MAX;
61constexpr u32 U32_MAX = UINT32_MAX;
62constexpr u64 U64_MAX = UINT64_MAX;
64// Floating pointer type
65
67typedef float f32;
68
70typedef double f64;
constexpr i16 I16_MAX
Definition BasicTypes.h:45
constexpr u8 U8_MAX
Definition BasicTypes.h:59
constexpr i32 I32_MAX
Definition BasicTypes.h:46
signed __int16 i16
Singed integer 16 bit type.
Definition BasicTypes.h:38
constexpr i8 I8_MAX
Definition BasicTypes.h:44
unsigned char ubyte
Unsigned byte type.
Definition BasicTypes.h:31
float f32
Singed floating pointer 32 bit type.
Definition BasicTypes.h:67
unsigned __int32 u32
Unsigned integer 32 bit type.
Definition BasicTypes.h:55
constexpr u32 U32_MAX
Definition BasicTypes.h:61
double f64
Singed floating pointer 64 bit type.
Definition BasicTypes.h:70
signed char ibyte
Signed byte type.
Definition BasicTypes.h:29
constexpr i64 I64_MAX
Definition BasicTypes.h:47
unsigned __int64 u64
Unsigned integer 64 bit type.
Definition BasicTypes.h:57
unsigned __int8 u8
Unsigned integer 8 bit type.
Definition BasicTypes.h:51
constexpr u64 U64_MAX
Definition BasicTypes.h:62
unsigned __int16 u16
Unsigned integer 16 bit type.
Definition BasicTypes.h:53
signed __int64 i64
Singed integer 64 bit type.
Definition BasicTypes.h:42
signed __int8 i8
Singed integer 8 bit type.
Definition BasicTypes.h:36
constexpr u16 U16_MAX
Definition BasicTypes.h:60
signed __int32 i32
Singed integer 32 bit type.
Definition BasicTypes.h:40