mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 06:09:50 -06:00
BranchWatchTableModel: Assume Unreachable Code Truly Is
This commit is contained in:
@ -143,6 +143,7 @@ add_library(common
|
||||
TraversalClient.h
|
||||
TraversalProto.h
|
||||
TypeUtils.h
|
||||
Unreachable.h
|
||||
UPnP.cpp
|
||||
UPnP.h
|
||||
VariantUtil.h
|
||||
|
21
Source/Core/Common/Unreachable.h
Normal file
21
Source/Core/Common/Unreachable.h
Normal file
@ -0,0 +1,21 @@
|
||||
// Copyright 2024 Dolphin Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "Common/CommonFuncs.h"
|
||||
|
||||
namespace Common
|
||||
{
|
||||
// TODO C++23: Replace with std::unreachable.
|
||||
[[noreturn]] inline void Unreachable()
|
||||
{
|
||||
#ifdef _DEBUG
|
||||
Crash();
|
||||
#elif defined(_MSC_VER) && !defined(__clang__)
|
||||
__assume(false);
|
||||
#else
|
||||
__builtin_unreachable();
|
||||
#endif
|
||||
}
|
||||
} // namespace Common
|
Reference in New Issue
Block a user