/
redgpu
/
ezEngine
Обзор
Документация
Войти
/
redgpu
/
ezEngine
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
dev
Code/Engine/Foundation/Basics/Compiler/Clang.h
69 строк
2 KB
Jan Krassnigg
MSVC / Clang fixes (#1997)
21 июл 2026, 15:22
Не верифицирован
21 июл 2026, 15:22
6f3ddbe
Код
Авторство
О чём код?
#pragma once #if defined(__clang__) && !defined(_MSC_VER) # undef EZ_COMPILER_CLANG # define EZ_COMPILER_CLANG EZ_ON # define EZ_ALWAYS_INLINE __attribute__((always_inline)) inline # if EZ_ENABLED(EZ_COMPILE_FOR_DEBUG) # define EZ_FORCE_INLINE inline # else # define EZ_FORCE_INLINE __attribute__((always_inline)) inline # endif # if __has_builtin(__builtin_debugtrap) # define EZ_DEBUG_BREAK \ { \ __builtin_debugtrap(); \ } # elif __has_builtin(__debugbreak) # define EZ_DEBUG_BREAK \ { \ __debugbreak(); \ } # else # include <signal.h> # if defined(SIGTRAP) # define EZ_DEBUG_BREAK \ { \ raise(SIGTRAP); \ } # else # define EZ_DEBUG_BREAK \ { \ raise(SIGABRT); \ } # endif # endif # define EZ_SOURCE_FUNCTION __PRETTY_FUNCTION__ # define EZ_SOURCE_LINE __LINE__ # define EZ_SOURCE_FILE __FILE__ # ifdef BUILDSYSTEM_BUILDTYPE_Debug # undef EZ_COMPILE_FOR_DEBUG # define EZ_COMPILE_FOR_DEBUG EZ_ON # endif # define EZ_WARNING_PUSH() _Pragma("clang diagnostic push") # define EZ_WARNING_POP() _Pragma("clang diagnostic pop") # define EZ_WARNING_DISABLE_CLANG(_x) _Pragma(EZ_PP_STRINGIFY(clang diagnostic ignored _x)) # define EZ_DECL_EXPORT [[gnu::visibility("default")]] # define EZ_DECL_IMPORT [[gnu::visibility("default")]] # define EZ_DECL_EXPORT_FRIEND # define EZ_DECL_IMPORT_FRIEND #elif defined(__clang__) // Clang in MSVC compatibility mode (clang-cl, or the clang driver targeting *-windows-msvc). // Everything else comes from MSVC.h, but clang's warning suppressions still have to work, // because the MSVC warning pragmas have no effect on the clang frontend. # define EZ_WARNING_DISABLE_CLANG(_x) _Pragma(EZ_PP_STRINGIFY(clang diagnostic ignored _x)) #else # define EZ_WARNING_DISABLE_CLANG(_x) #endif