UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
MSVCPlatform.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
3/*================================================================================
4 MSVCPlatform.h: Setup for any MSVC-using platform
5==================================================================================*/
6
7#pragma once
8
9#if _MSC_VER < 1920
10 #error "Compiler is expected to support if constexpr"
11#endif
12
13#if !defined(__cpp_fold_expressions)
14 #error "Compiler is expected to support fold expressions"
15#endif
16
17#define PLATFORM_RETURN_ADDRESS() _ReturnAddress()
18#define PLATFORM_RETURN_ADDRESS_POINTER() _AddressOfReturnAddress()
19
20// https://devblogs.microsoft.com/cppblog/improving-the-state-of-debug-performance-in-c/
21#if __has_cpp_attribute(msvc::intrinsic)
22#define UE_INTRINSIC_CAST [[msvc::intrinsic]]
23#endif
24
25// Ensure we can use this builtin - seems to be present on Clang 9, GCC 11 and MSVC 19.26
26#define PLATFORM_COMPILER_SUPPORTS_BUILTIN_BITCAST (_MSC_VER >= 1926)
27
28#ifdef __has_cpp_attribute
29 #if __has_cpp_attribute(msvc::lifetimebound)
30 #define UE_LIFETIMEBOUND [[msvc::lifetimebound]]
31 #endif
32#endif
33
34#define UE_NO_PROFILE_ATTRIBUTE