From 97b37b3ce468f8f674ff88e1600670a65cc66f5f Mon Sep 17 00:00:00 2001 From: Wojtek Figat Date: Mon, 16 Jun 2025 18:00:26 +0200 Subject: [PATCH] Add `PRAGMA_DISABLE_OPTIMIZATION`/`PRAGMA_ENABLE_OPTIMIZATION` --- Source/Engine/Core/Compiler.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Source/Engine/Core/Compiler.h b/Source/Engine/Core/Compiler.h index fb731930e..a45a4628a 100644 --- a/Source/Engine/Core/Compiler.h +++ b/Source/Engine/Core/Compiler.h @@ -26,6 +26,8 @@ _Pragma("clang diagnostic ignored \"-Wdeprecated-declarations\"") #define PRAGMA_ENABLE_DEPRECATION_WARNINGS \ _Pragma("clang diagnostic pop") +#define PRAGMA_DISABLE_OPTIMIZATION +#define PRAGMA_ENABLE_OPTIMIZATION #pragma clang diagnostic ignored "-Wswitch" #pragma clang diagnostic ignored "-Wmacro-redefined" @@ -54,6 +56,8 @@ #define OFFSET_OF(X, Y) __builtin_offsetof(X, Y) #define PRAGMA_DISABLE_DEPRECATION_WARNINGS #define PRAGMA_ENABLE_DEPRECATION_WARNINGS +#define PRAGMA_DISABLE_OPTIMIZATION +#define PRAGMA_ENABLE_OPTIMIZATION #elif defined(_MSC_VER) @@ -86,6 +90,8 @@ __pragma(warning(disable: 4996)) #define PRAGMA_ENABLE_DEPRECATION_WARNINGS \ __pragma (warning(pop)) +#define PRAGMA_DISABLE_OPTIMIZATION __pragma(optimize("", off)) +#define PRAGMA_ENABLE_OPTIMIZATION __pragma(optimize("", on)) #pragma warning(disable: 4251)