Commit 793392df authored by carthach's avatar carthach
Browse files

Fixes compilation on Win/MingW

parent df4ecd03
......@@ -48,7 +48,7 @@ double getstarttime()
{
#if FLEXT_OS == FLEXT_OS_WIN
LARGE_INTEGER frq;
if(QueryPerformanceFrequency(&frq)) TimerVars<>::perffrq = (double)frq.QuadPart;
if(QueryPerformanceFrequency(&frq)) TimerVars::perffrq = (double)frq.QuadPart;
#endif
FLEXT_TEMPINST(TimerVars)::starttime = 0;
......@@ -61,8 +61,8 @@ FLEXT_TEMPIMPL(double FLEXT_CLASSDEF(flext))::GetOSTime()
#if FLEXT_OS == FLEXT_OS_WIN
LARGE_INTEGER cnt;
if(perffrq && QueryPerformanceCounter(&cnt))
tm = cnt.QuadPart/TimerVars<>::perffrq;
if(TimerVars::perffrq && QueryPerformanceCounter(&cnt))
tm = cnt.QuadPart/TimerVars::perffrq;
else {
SYSTEMTIME systm;
FILETIME fltm;
......@@ -106,8 +106,8 @@ FLEXT_TEMPIMPL(void FLEXT_CLASSDEF(flext))::Sleep(double s)
else
#else
LARGE_INTEGER cnt;
if(perffrq && QueryPerformanceCounter(&cnt)) {
LONGLONG dst = (LONGLONG)(cnt.QuadPart+perffrq*s);
if(TimerVars::perffrq && QueryPerformanceCounter(&cnt)) {
LONGLONG dst = (LONGLONG)(cnt.QuadPart+TimerVars::perffrq*s);
for(;;) {
SwitchToThread(); // while waiting switch to another thread
QueryPerformanceCounter(&cnt);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment