1
0

LuaState: Fixed VS2017's throw warnings for destructors. (#3779)

This commit is contained in:
Mattes D 2017-06-19 11:08:08 +02:00 committed by GitHub
parent 7ac3b0fa0b
commit 801084c38c
2 changed files with 12 additions and 5 deletions

View File

@ -77,7 +77,7 @@ public:
} }
} }
~cStackBalanceCheck() ~cStackBalanceCheck() NO_THROW
{ {
auto currStackPos = lua_gettop(m_LuaState); auto currStackPos = lua_gettop(m_LuaState);
if (currStackPos != m_StackPos) if (currStackPos != m_StackPos)
@ -117,7 +117,7 @@ public:
{ {
} }
~cStackBalancePopper() ~cStackBalancePopper() NO_THROW
{ {
auto curTop = lua_gettop(m_LuaState); auto curTop = lua_gettop(m_LuaState);
if (curTop > m_Count) if (curTop > m_Count)
@ -476,7 +476,7 @@ public:
std::swap(m_StackLen, a_Src.m_StackLen); std::swap(m_StackLen, a_Src.m_StackLen);
} }
~cStackValue() ~cStackValue() NO_THROW
{ {
if (m_LuaState != nullptr) if (m_LuaState != nullptr)
{ {

View File

@ -49,7 +49,13 @@
#define SIZE_T_FMT_PRECISION(x) "%" #x "Iu" #define SIZE_T_FMT_PRECISION(x) "%" #x "Iu"
#define SIZE_T_FMT_HEX "%Ix" #define SIZE_T_FMT_HEX "%Ix"
#define NORETURN __declspec(noreturn) #define NORETURN __declspec(noreturn)
#if (_MSC_VER < 1910)
// MSVC 2013 (and possibly 2015?) have no idea about "noexcept(false)"
#define NO_THROW throw(...)
#else
#define NO_THROW noexcept(false)
#endif
// Use non-standard defines in <cmath> // Use non-standard defines in <cmath>
#define _USE_MATH_DEFINES #define _USE_MATH_DEFINES
@ -93,7 +99,8 @@
#define SIZE_T_FMT_HEX "%zx" #define SIZE_T_FMT_HEX "%zx"
#endif #endif
#define NORETURN __attribute((__noreturn__)) #define NORETURN __attribute((__noreturn__))
#define NO_THROW noexcept(false)
#else #else