Better MSVC support

* Avoiding use of templated variables.
* Now compling on MSVC with /WX (warnings as errors).
* Fixed all MSVC warnings.
* Fixed MSVC source_groups.
This commit is contained in:
MerryMage
2016-07-18 10:28:17 +01:00
parent bf99ddd065
commit c18a3eeab4
17 changed files with 392 additions and 361 deletions

View File

@@ -10,6 +10,11 @@
#include "common/common_types.h"
#ifdef _MSC_VER
#pragma warning(push)
#pragma warning(disable:4554)
#endif
namespace Dynarmic {
namespace Common {
@@ -35,7 +40,7 @@ template<size_t bit_position, typename T>
constexpr bool Bit(const T value) {
static_assert(bit_position < BitSize<T>(), "bit_position must be smaller than size of T");
return (value >> bit_position) & 1;
return ((value >> bit_position) & 1) != 0;
}
/// Sign-extends a value that has NBits bits to the full bitwidth of type T.
@@ -53,3 +58,7 @@ inline T SignExtend(const T value) {
} // namespace Common
} // namespace Dynarmic
#ifdef _MSC_VER
#pragma warning(pop)
#endif