Skip to content

Commit d2311b8

Browse files
committed
xrCore: XR_NOEXCEPT added
Replaces noexcept by throw() in release configuration due to disabled exceptions From commit: Im-dex/xray-162@ae4b026
1 parent 1f3d298 commit d2311b8

File tree

2 files changed

+19
-2
lines changed

2 files changed

+19
-2
lines changed

src/xrCore/cpuid.h

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,17 @@
22
#ifndef _INC_CPUID
33
#define _INC_CPUID
44

5+
#ifndef xrCoreH
6+
// If xrCore.h is not included then compilation fails
7+
// This fixes it.
8+
// XXX: Find a better solution
9+
#ifdef NDEBUG
10+
#define XR_NOEXCEPT throw()
11+
#else
12+
#define XR_NOEXCEPT noexcept
13+
#endif
14+
#endif
15+
516
enum class CpuFeature : u32
617
{
718
Mmx = 0x0001,
@@ -36,9 +47,9 @@ struct processor_info
3647
// except 2nd (and upper) logical threads
3748
// of the same physical core
3849

39-
bool hasFeature(const CpuFeature feature) const noexcept
50+
bool hasFeature(const CpuFeature feature) const XR_NOEXCEPT
4051
{
41-
return features & static_cast<u32>(feature);
52+
return (features & static_cast<u32>(feature)) != 0;
4253
}
4354
};
4455

src/xrCore/xrCore.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,20 @@
3131
#if !defined(_CPPUNWIND)
3232
#error Please enable exceptions...
3333
#endif
34+
3435
#ifndef _MT
3536
#error Please enable multi-threaded library...
3637
#endif
38+
3739
#ifdef NDEBUG
3840
#define XRAY_EXCEPTIONS 0
3941
#define LUABIND_NO_EXCEPTIONS
42+
#define XR_NOEXCEPT throw()
43+
#define XR_NOEXCEPT_OP(x)
4044
#else
4145
#define XRAY_EXCEPTIONS 1
46+
#define XR_NOEXCEPT noexcept
47+
#define XR_NOEXCEPT_OP(x) noexcept(x)
4248
#endif
4349

4450
#include "Common/Platform.hpp"

0 commit comments

Comments
 (0)