mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2024-11-14 21:37:52 -07:00
Merge pull request #9778 from shuffle2/msvc-wa
msvc: remove workarounds for old compiler issues
This commit is contained in:
commit
bd7c5bd742
@ -134,10 +134,6 @@ public:
|
|||||||
// so that we can use this within unions
|
// so that we can use this within unions
|
||||||
constexpr BitField() = default;
|
constexpr BitField() = default;
|
||||||
|
|
||||||
// Visual Studio (as of VS2017) considers BitField to not be trivially
|
|
||||||
// copyable if we delete this copy assignment operator.
|
|
||||||
// https://developercommunity.visualstudio.com/content/problem/101208/c-compiler-is-overly-strict-regarding-whether-a-cl.html
|
|
||||||
#ifndef _MSC_VER
|
|
||||||
// We explicitly delete the copy assignment operator here, because the
|
// We explicitly delete the copy assignment operator here, because the
|
||||||
// default copy assignment would copy the full storage value, rather than
|
// default copy assignment would copy the full storage value, rather than
|
||||||
// just the bits relevant to this particular bit field.
|
// just the bits relevant to this particular bit field.
|
||||||
@ -145,7 +141,6 @@ public:
|
|||||||
// relevant bits, but we're prevented from doing that because the savestate
|
// relevant bits, but we're prevented from doing that because the savestate
|
||||||
// code expects that this class is trivially copyable.
|
// code expects that this class is trivially copyable.
|
||||||
BitField& operator=(const BitField&) = delete;
|
BitField& operator=(const BitField&) = delete;
|
||||||
#endif
|
|
||||||
|
|
||||||
DOLPHIN_FORCE_INLINE BitField& operator=(T val)
|
DOLPHIN_FORCE_INLINE BitField& operator=(T val)
|
||||||
{
|
{
|
||||||
@ -241,10 +236,6 @@ public:
|
|||||||
// so that we can use this within unions
|
// so that we can use this within unions
|
||||||
constexpr BitFieldArray() = default;
|
constexpr BitFieldArray() = default;
|
||||||
|
|
||||||
// Visual Studio (as of VS2017) considers BitField to not be trivially
|
|
||||||
// copyable if we delete this copy assignment operator.
|
|
||||||
// https://developercommunity.visualstudio.com/content/problem/101208/c-compiler-is-overly-strict-regarding-whether-a-cl.html
|
|
||||||
#ifndef _MSC_VER
|
|
||||||
// We explicitly delete the copy assignment operator here, because the
|
// We explicitly delete the copy assignment operator here, because the
|
||||||
// default copy assignment would copy the full storage value, rather than
|
// default copy assignment would copy the full storage value, rather than
|
||||||
// just the bits relevant to this particular bit field.
|
// just the bits relevant to this particular bit field.
|
||||||
@ -252,7 +243,6 @@ public:
|
|||||||
// relevant bits, but we're prevented from doing that because the savestate
|
// relevant bits, but we're prevented from doing that because the savestate
|
||||||
// code expects that this class is trivially copyable.
|
// code expects that this class is trivially copyable.
|
||||||
BitFieldArray& operator=(const BitFieldArray&) = delete;
|
BitFieldArray& operator=(const BitFieldArray&) = delete;
|
||||||
#endif
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
constexpr std::size_t StartBit() const { return position; }
|
constexpr std::size_t StartBit() const { return position; }
|
||||||
|
@ -10,18 +10,6 @@
|
|||||||
#include "Common/BitUtils.h"
|
#include "Common/BitUtils.h"
|
||||||
#include "Common/CommonTypes.h"
|
#include "Common/CommonTypes.h"
|
||||||
|
|
||||||
#ifdef _MSC_VER
|
|
||||||
|
|
||||||
// MSVC needs a workaround, because its std::numeric_limits<double>::signaling_NaN()
|
|
||||||
// will use __builtin_nans, which is improperly handled by the compiler and generates
|
|
||||||
// a bad constant. Here we go back to the version MSVC used before the builtin.
|
|
||||||
// TODO: Remove this and use numeric_limits directly whenever this bug is fixed.
|
|
||||||
// See Visual Studio bug # 128935 "std::numeric_limits<float>::signaling_NaN() is broken"
|
|
||||||
|
|
||||||
#include <ymath.h>
|
|
||||||
|
|
||||||
#endif // _MSC_VER
|
|
||||||
|
|
||||||
namespace Common
|
namespace Common
|
||||||
{
|
{
|
||||||
template <typename T>
|
template <typename T>
|
||||||
@ -30,23 +18,6 @@ constexpr T SNANConstant()
|
|||||||
return std::numeric_limits<T>::signaling_NaN();
|
return std::numeric_limits<T>::signaling_NaN();
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef _MSC_VER
|
|
||||||
|
|
||||||
// See workaround note above.
|
|
||||||
|
|
||||||
template <>
|
|
||||||
constexpr double SNANConstant()
|
|
||||||
{
|
|
||||||
return (_CSTD _Snan._Double);
|
|
||||||
}
|
|
||||||
template <>
|
|
||||||
constexpr float SNANConstant()
|
|
||||||
{
|
|
||||||
return (_CSTD _Snan._Float);
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif // _MSC_VER
|
|
||||||
|
|
||||||
// The most significant bit of the fraction is an is-quiet bit on all architectures we care about.
|
// The most significant bit of the fraction is an is-quiet bit on all architectures we care about.
|
||||||
enum : u64
|
enum : u64
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user