[windows] remove various workarounds which were required for vs2013

This commit is contained in:
Shawn Hoffman 2015-03-16 16:46:57 -07:00
parent 30702c17b6
commit bea18eedc4
4 changed files with 2 additions and 50 deletions

View File

@ -102,12 +102,6 @@ extern "C"
__declspec(dllimport) void __stdcall DebugBreak(void);
}
#define Crash() {DebugBreak();}
#if (_MSC_VER > 1800)
#error alignof compat can be removed
#else
#define alignof(x) __alignof(x)
#endif
#endif // WIN32 ndef
// Generic function to get last error message.

View File

@ -24,9 +24,6 @@
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
{
public:
@ -76,39 +73,5 @@ private:
std::condition_variable m_condvar;
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

View File

@ -56,11 +56,7 @@ public:
}
private:
// We are not using std::atomic_bool here because MSVC sucks as of VC++
// 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;
std::atomic_bool m_val;
};
} // namespace Common

View File

@ -954,8 +954,7 @@ public:
template <typename T, typename... Args>
void ABI_CallLambdaC(const std::function<T(Args...)>* f, u32 p1)
{
// Double casting is required by VC++ for some reason.
auto trampoline = (void(*)())&XEmitter::CallLambdaTrampoline<T, Args...>;
auto trampoline = &XEmitter::CallLambdaTrampoline<T, Args...>;
ABI_CallFunctionPC((void*)trampoline, const_cast<void*>((const void*)f), p1);
}
}; // class XEmitter