mirror of
https://github.com/minetest/minetest.git
synced 2025-01-10 23:37:29 +01:00
Fix warning about getVertexTypeDescription reaching its end (#14806)
This commit is contained in:
parent
85e717fcd1
commit
53a50e0b0d
@ -107,6 +107,7 @@ static const VertexType &getVertexTypeDescription(E_VERTEX_TYPE type)
|
|||||||
return vtTangents;
|
return vtTangents;
|
||||||
default:
|
default:
|
||||||
assert(false);
|
assert(false);
|
||||||
|
CODE_UNREACHABLE();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
16
irr/src/os.h
16
irr/src/os.h
@ -10,6 +10,22 @@
|
|||||||
#include "ILogger.h"
|
#include "ILogger.h"
|
||||||
#include "ITimer.h"
|
#include "ITimer.h"
|
||||||
|
|
||||||
|
// CODE_UNREACHABLE(): Invokes undefined behavior for unreachable code optimization
|
||||||
|
#if defined(__cpp_lib_unreachable)
|
||||||
|
#include <utility>
|
||||||
|
#define CODE_UNREACHABLE() std::unreachable()
|
||||||
|
#elif defined(__has_builtin)
|
||||||
|
#if __has_builtin(__builtin_unreachable)
|
||||||
|
#define CODE_UNREACHABLE() __builtin_unreachable()
|
||||||
|
#endif
|
||||||
|
#elif defined(_MSC_VER)
|
||||||
|
#define CODE_UNREACHABLE() __assume(false)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef CODE_UNREACHABLE
|
||||||
|
#define CODE_UNREACHABLE() (void)0
|
||||||
|
#endif
|
||||||
|
|
||||||
namespace irr
|
namespace irr
|
||||||
{
|
{
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user