From 231305ac4725ae7777bb6e859f99c328f0064ce3 Mon Sep 17 00:00:00 2001 From: Brayden Lee Date: Mon, 22 Dec 2025 22:52:20 -0500 Subject: [PATCH] Revert "Added Unreachable" This reverts commit 760d5ec69ab9c8969f09ac920143eccc69a641b8. --- imgui.h | 35 ++--------------------------------- 1 file changed, 2 insertions(+), 33 deletions(-) diff --git a/imgui.h b/imgui.h index 6cecb3a60..2c8fecef6 100644 --- a/imgui.h +++ b/imgui.h @@ -43,7 +43,7 @@ Index of this file: // [SECTION] Dear ImGui end-user API functions // [SECTION] Flags & Enumerations // [SECTION] Tables API flags and structures (ImGuiTableFlags, ImGuiTableColumnFlags, ImGuiTableRowFlags, ImGuiTableBgTarget, ImGuiTableSortSpecs, ImGuiTableColumnSortSpecs) -// [SECTION] Helpers: Debug log, Memory allocations macros, ImVector<>, Unreachable +// [SECTION] Helpers: Debug log, Memory allocations macros, ImVector<> // [SECTION] ImGuiStyle // [SECTION] ImGuiIO // [SECTION] Misc data structures (ImGuiInputTextCallbackData, ImGuiSizeCallbackData, ImGuiPayload) @@ -2152,7 +2152,7 @@ struct ImGuiTableColumnSortSpecs }; //----------------------------------------------------------------------------- -// [SECTION] Helpers: Debug log, memory allocations macros, ImVector<>, Unreachable +// [SECTION] Helpers: Debug log, memory allocations macros, ImVector<> //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- @@ -2257,37 +2257,6 @@ struct ImVector }; IM_MSVC_RUNTIME_CHECKS_RESTORE -//----------------------------------------------------------------------------- -// ImGui::Unreachable() -// Provides an equivalent for std::unreachable() for C++<23. This signals to the compiler that a region is unreachable, allowing optimizations. -//----------------------------------------------------------------------------- -// If you are using C++>=23, use std::unreachable() in , and you may also define STD_UNREACHABLE_IS_AVAILABLE to substitute definitions. -// Code is from: https://en.cppreference.com/w/cpp/utility/unreachable.html -// Inclusion in the ImGUI namespace is chosen to avoid possible namespace collisions with stdlib >= 23. -//----------------------------------------------------------------------------- -namespace ImGui -{ -//#define STD_UNREACHABLE_IS_AVAILABLE -#ifdef STD_UNREACHABLE_IS_AVAILABLE - #include - constexpr const auto Unreachable = ::std::unreachable; - #undef STD_UNREACHABLE_IS_AVAILABLE -#else - [[noreturn]] inline void Unreachable() - { - // Uses compiler specific extensions if possible. - // Even if no extension is used, undefined behavior is still raised by - // an empty function body and the noreturn attribute. - #if defined(_MSC_VER) && !defined(__clang__) // MSVC - __assume(false); - #else // GCC, Clang - __builtin_unreachable(); - #endif - } -#endif - -} // namespace ImGui - //----------------------------------------------------------------------------- // [SECTION] ImGuiStyle //-----------------------------------------------------------------------------