From ce542887c4e549929f38724acdd4bdf3a4322e0e Mon Sep 17 00:00:00 2001 From: Nik Date: Sun, 11 Sep 2022 21:53:18 +0200 Subject: [PATCH] includes/type: Added aliases for builtin types --- includes/type/types/010.pat | 62 +++++++++++++++++++++++++++++++++++ includes/type/types/c.pat | 39 ++++++++++++++++++++++ includes/type/types/linux.pat | 13 ++++++++ includes/type/types/rust.pat | 24 ++++++++++++++ includes/type/types/win32.pat | 53 ++++++++++++++++++++++++++++++ 5 files changed, 191 insertions(+) create mode 100644 includes/type/types/010.pat create mode 100644 includes/type/types/c.pat create mode 100644 includes/type/types/linux.pat create mode 100644 includes/type/types/rust.pat create mode 100644 includes/type/types/win32.pat diff --git a/includes/type/types/010.pat b/includes/type/types/010.pat new file mode 100644 index 0000000..f29ee3d --- /dev/null +++ b/includes/type/types/010.pat @@ -0,0 +1,62 @@ +#pragma once + +// Explicitly don't add these types to the `type` namespace for usability +// namespace type { + + // using char = s8; + using byte = s8; + using CHAR = s8; + using BYTE = s8; + + using uchar = u8; + using ubyte = u8; + using UCHAR = u8; + using ubyte = u8; + + + using short = s16; + using int16 = s16; + using SHORT = s16; + using INT16 = s16; + + using ushort = u16; + using uint16 = u16; + using USHORT = u16; + using UINT16 = u16; + using WORD = u16; + + using int = s32; + using int32 = s32; + using long = s32; + using INT = s32; + using INT32 = s32; + using LONG = s32; + + using uint = u32; + using uint32 = u32; + using ulong = u32; + using UINT = u32; + using UINT32 = u32; + using ULONG = u32; + using DWORD = u32; + + using int64 = s64; + using quad = s64; + using QUAD = s64; + using INT64 = s64; + using __int64 = s64; + + using uint64 = u64; + using uquad = u64; + using UQUAD = u64; + using UINT64 = u64; + using QWORD = u64; + using __uint64 = u64; + + // using float = float; + using FLOAT = float; + + // using double = double; + using DOUBLE = double; + +// } \ No newline at end of file diff --git a/includes/type/types/c.pat b/includes/type/types/c.pat new file mode 100644 index 0000000..4197200 --- /dev/null +++ b/includes/type/types/c.pat @@ -0,0 +1,39 @@ +#pragma once + +// Explicitly don't add these types to the `type` namespace for usability +// namespace type { + + using uint8_t = u8; + using uint16_t = u16; + using uint32_t = u32; + using uint64_t = u64; + using __uint64_t = u64; + using uint128_t = u128; + using __uint128_t = u128; + + using int8_t = s8; + using int16_t = s16; + using int32_t = s32; + using int64_t = s64; + using __int64_t = s64; + using int128_t = s128; + using __int128_t = s128; + + using size_t = u64; + using ssize_t = s64; + + using uintptr_t = u64; + using intptr_t = s64; + using ptrdiff_t = s64; + + // using char = char; + using wchar_t = char16; + using char8_t = char; + using char16_t = char16; + using char32_t = u32; + + using short = s16; + using int = s32; + using long = s32; + +// } \ No newline at end of file diff --git a/includes/type/types/linux.pat b/includes/type/types/linux.pat new file mode 100644 index 0000000..8dd02da --- /dev/null +++ b/includes/type/types/linux.pat @@ -0,0 +1,13 @@ +#pragma once + +// Explicitly don't add these types to the `type` namespace for usability +// namespace type { + + using le16 = le u16; + using be16 = be u16; + using le32 = le u32; + using be32 = be u32; + using le64 = le u64; + using be64 = be u64; + +// } \ No newline at end of file diff --git a/includes/type/types/rust.pat b/includes/type/types/rust.pat new file mode 100644 index 0000000..a55c056 --- /dev/null +++ b/includes/type/types/rust.pat @@ -0,0 +1,24 @@ +#pragma once + +// Explicitly don't add these types to the `type` namespace for usability +// namespace type { + + // using u8 = u8; + // using u16 = u16; + // using u32 = u32; + // using u64 = u64; + // using u128 = u128; + + using i8 = s8; + using i16 = s16; + using i32 = s32; + using i64 = s64; + using i128 = s128; + + using f32 = float; + using f64 = double; + + using usize = u64; + using isize = i64; + +// } \ No newline at end of file diff --git a/includes/type/types/win32.pat b/includes/type/types/win32.pat new file mode 100644 index 0000000..892fca2 --- /dev/null +++ b/includes/type/types/win32.pat @@ -0,0 +1,53 @@ +#pragma once + +// Explicitly don't add these types to the `type` namespace for usability +// namespace type { + + using BYTE = u8; + using WORD = u16; + using DWORD = u32; + using QWORD = u64; + using DWORDLONG = u64; + using DWORD32 = u32; + using DWORD64 = u64; + + using INT = s32; + using UINT = u32; + using FLOAT = float; + using SHORT = s16; + using USHORT = u16; + using BOOL = bool; + using BOOLEAN = bool; + + using INT8 = s8; + using INT16 = s16; + using INT32 = s32; + using INT64 = s64; + using UINT8 = u8; + using UINT16 = u16; + using UINT32 = u32; + using UINT64 = u64; + + using LONG = s32; + using ULONG = u32; + using LONG32 = s32; + using ULONG32 = u32; + using LONG64 = s64; + using ULONG64 = u64; + using LONGLONG = s64; + using ULONGLONG = u64; + + using SIZE_T = u64; + using SSIZE_T = s64; + + using UCHAR = u8; + using CHAR = char; + using CCHAR = char; + + using ATOM = WORD; + using PVOID = SIZE_T; + using HANDLE = PVOID; + using HINSTANCE = HANDLE; + using HRESULT = LONG; + +// } \ No newline at end of file