UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
GenericPlatform.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
3#pragma once
4
5//---------------------------------------------------------------------
6// Utility for automatically setting up the pointer-sized integer type
7//---------------------------------------------------------------------
8
9template<typename T32BITS, typename T64BITS, int PointerSize>
11{
12 // nothing here are is it an error if the partial specializations fail
13};
14
15template<typename T32BITS, typename T64BITS>
17{
18 // Select the 64 bit type.
20};
21
22template<typename T32BITS, typename T64BITS>
24{
25 // Select the 32 bit type.
27};
28
33{
34 //~ Unsigned base types
35
36 // 8-bit unsigned integer
37 typedef unsigned char uint8;
38
39 // 16-bit unsigned integer
40 typedef unsigned short int uint16;
41
42 // 32-bit unsigned integer
43 typedef unsigned int uint32;
44
45 // 64-bit unsigned integer
46 typedef unsigned long long uint64;
47
48 //~ Signed base types.
49
50 // 8-bit signed integer
51 typedef signed char int8;
52
53 // 16-bit signed integer
54 typedef signed short int int16;
55
56 // 32-bit signed integer
57 typedef signed int int32;
58
59 // 64-bit signed integer
60 typedef signed long long int64;
61
62 //~ Character types
63
64 // An ANSI character. 8-bit fixed-width representation of 7-bit characters.
65 typedef char ANSICHAR;
66
67 // A wide character. In-memory only. ?-bit fixed-width representation of the platform's natural wide character set. Could be different sizes on different platforms.
68 typedef wchar_t WIDECHAR;
69
70 // An 8-bit character type. In-memory only. 8-bit representation.
72
73 // A 16-bit character type. In-memory only. 16-bit representation. Should really be char16_t but making this the generic option is easier for compilers which don't fully support C++11 yet (i.e. MSVC).
74 typedef uint16 CHAR16;
75
76 // A 32-bit character type. In-memory only. 32-bit representation. Should really be char32_t but making this the generic option is easier for compilers which don't fully support C++11 yet (i.e. MSVC).
77 [[deprecated("CHAR32 has been deprecated - please use UTF32CHAR instead.")]] // not using UE_DEPRECATED(5.6, "...") for dependency reasons
78 typedef uint32 CHAR32;
79
80 // A 32-bit character type. In-memory only. 32-bit representation.
82
83 // A switchable character. In-memory only. Either ANSICHAR or WIDECHAR, depending on a licensee's requirements.
84 typedef WIDECHAR TCHAR;
85
86 // Unsigned int. The same size as a pointer.
87 typedef SelectIntPointerType<uint32, uint64, sizeof(void*)>::TIntPointer UPTRINT;
88
89 // Signed int. The same size as a pointer.
90 typedef SelectIntPointerType<int32, int64, sizeof(void*)>::TIntPointer PTRINT;
91
92 // Unsigned int. The same size as a pointer.
93 typedef UPTRINT SIZE_T;
94
95 // Signed int. The same size as a pointer.
96 typedef PTRINT SSIZE_T;
97
99 typedef decltype(nullptr) TYPE_OF_NULLPTR;
100};
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
uint_least32_t char32_t
Definition MarketplaceKitWrapper.h:65
Definition GenericPlatform.h:33
unsigned long long uint64
Definition GenericPlatform.h:46
unsigned char uint8
Definition GenericPlatform.h:37
decltype(nullptr) TYPE_OF_NULLPTR
Definition GenericPlatform.h:99
SelectIntPointerType< int32, int64, sizeof(void *)>::TIntPointer PTRINT
Definition GenericPlatform.h:90
char ANSICHAR
Definition GenericPlatform.h:65
signed short int int16
Definition GenericPlatform.h:54
unsigned short int uint16
Definition GenericPlatform.h:40
uint32 CHAR32
Definition GenericPlatform.h:78
signed char int8
Definition GenericPlatform.h:51
WIDECHAR TCHAR
Definition GenericPlatform.h:84
unsigned int uint32
Definition GenericPlatform.h:43
int32 TYPE_OF_NULL
Definition GenericPlatform.h:98
UPTRINT SIZE_T
Definition GenericPlatform.h:93
SelectIntPointerType< uint32, uint64, sizeof(void *)>::TIntPointer UPTRINT
Definition GenericPlatform.h:87
signed int int32
Definition GenericPlatform.h:57
char32_t UTF32CHAR
Definition GenericPlatform.h:81
PTRINT SSIZE_T
Definition GenericPlatform.h:96
wchar_t WIDECHAR
Definition GenericPlatform.h:68
uint16 CHAR16
Definition GenericPlatform.h:74
char8_t UTF8CHAR
Definition GenericPlatform.h:71
signed long long int64
Definition GenericPlatform.h:60
T32BITS TIntPointer
Definition GenericPlatform.h:26
T64BITS TIntPointer
Definition GenericPlatform.h:19
Definition GenericPlatform.h:11