mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-02-09 14:08:58 +01:00
[windows] remove various workarounds which were required for vs2013
This commit is contained in:
parent
30702c17b6
commit
bea18eedc4
@ -102,12 +102,6 @@ extern "C"
|
|||||||
__declspec(dllimport) void __stdcall DebugBreak(void);
|
__declspec(dllimport) void __stdcall DebugBreak(void);
|
||||||
}
|
}
|
||||||
#define Crash() {DebugBreak();}
|
#define Crash() {DebugBreak();}
|
||||||
|
|
||||||
#if (_MSC_VER > 1800)
|
|
||||||
#error alignof compat can be removed
|
|
||||||
#else
|
|
||||||
#define alignof(x) __alignof(x)
|
|
||||||
#endif
|
|
||||||
#endif // WIN32 ndef
|
#endif // WIN32 ndef
|
||||||
|
|
||||||
// Generic function to get last error message.
|
// Generic function to get last error message.
|
||||||
|
@ -24,9 +24,6 @@
|
|||||||
|
|
||||||
namespace Common {
|
namespace Common {
|
||||||
|
|
||||||
// Windows uses a specific implementation because std::condition_variable has
|
|
||||||
// terrible performance for this kind of workload with MSVC++ 2013.
|
|
||||||
#ifndef _WIN32
|
|
||||||
class Event final
|
class Event final
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@ -76,39 +73,5 @@ private:
|
|||||||
std::condition_variable m_condvar;
|
std::condition_variable m_condvar;
|
||||||
std::mutex m_mutex;
|
std::mutex m_mutex;
|
||||||
};
|
};
|
||||||
#else
|
|
||||||
class Event final
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
void Set()
|
|
||||||
{
|
|
||||||
m_event.set();
|
|
||||||
}
|
|
||||||
|
|
||||||
void Wait()
|
|
||||||
{
|
|
||||||
m_event.wait();
|
|
||||||
m_event.reset();
|
|
||||||
}
|
|
||||||
|
|
||||||
template<class Rep, class Period>
|
|
||||||
bool WaitFor(const std::chrono::duration<Rep, Period>& rel_time)
|
|
||||||
{
|
|
||||||
bool signaled = m_event.wait(
|
|
||||||
(u32)std::chrono::duration_cast<std::chrono::milliseconds>(rel_time).count()
|
|
||||||
) == 0;
|
|
||||||
m_event.reset();
|
|
||||||
return signaled;
|
|
||||||
}
|
|
||||||
|
|
||||||
void Reset()
|
|
||||||
{
|
|
||||||
m_event.reset();
|
|
||||||
}
|
|
||||||
|
|
||||||
private:
|
|
||||||
concurrency::event m_event;
|
|
||||||
};
|
|
||||||
#endif
|
|
||||||
|
|
||||||
} // namespace Common
|
} // namespace Common
|
||||||
|
@ -56,11 +56,7 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// We are not using std::atomic_bool here because MSVC sucks as of VC++
|
std::atomic_bool m_val;
|
||||||
// 2013 and does not implement the std::atomic_bool(bool) constructor.
|
|
||||||
//
|
|
||||||
// Re-evaluate next time we upgrade that piece of shit.
|
|
||||||
std::atomic<bool> m_val;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace Common
|
} // namespace Common
|
||||||
|
@ -954,8 +954,7 @@ public:
|
|||||||
template <typename T, typename... Args>
|
template <typename T, typename... Args>
|
||||||
void ABI_CallLambdaC(const std::function<T(Args...)>* f, u32 p1)
|
void ABI_CallLambdaC(const std::function<T(Args...)>* f, u32 p1)
|
||||||
{
|
{
|
||||||
// Double casting is required by VC++ for some reason.
|
auto trampoline = &XEmitter::CallLambdaTrampoline<T, Args...>;
|
||||||
auto trampoline = (void(*)())&XEmitter::CallLambdaTrampoline<T, Args...>;
|
|
||||||
ABI_CallFunctionPC((void*)trampoline, const_cast<void*>((const void*)f), p1);
|
ABI_CallFunctionPC((void*)trampoline, const_cast<void*>((const void*)f), p1);
|
||||||
}
|
}
|
||||||
}; // class XEmitter
|
}; // class XEmitter
|
||||||
|
Loading…
x
Reference in New Issue
Block a user