Commit f76472d3 authored by Thomas Grill's avatar Thomas Grill Committed by GitHub
Browse files

Merge pull request #26 from carthach/master

Fixes compilation on Win/MingW
parents df4ecd03 793392df
...@@ -48,7 +48,7 @@ double getstarttime() ...@@ -48,7 +48,7 @@ double getstarttime()
{ {
#if FLEXT_OS == FLEXT_OS_WIN #if FLEXT_OS == FLEXT_OS_WIN
LARGE_INTEGER frq; LARGE_INTEGER frq;
if(QueryPerformanceFrequency(&frq)) TimerVars<>::perffrq = (double)frq.QuadPart; if(QueryPerformanceFrequency(&frq)) TimerVars::perffrq = (double)frq.QuadPart;
#endif #endif
FLEXT_TEMPINST(TimerVars)::starttime = 0; FLEXT_TEMPINST(TimerVars)::starttime = 0;
...@@ -61,8 +61,8 @@ FLEXT_TEMPIMPL(double FLEXT_CLASSDEF(flext))::GetOSTime() ...@@ -61,8 +61,8 @@ FLEXT_TEMPIMPL(double FLEXT_CLASSDEF(flext))::GetOSTime()
#if FLEXT_OS == FLEXT_OS_WIN #if FLEXT_OS == FLEXT_OS_WIN
LARGE_INTEGER cnt; LARGE_INTEGER cnt;
if(perffrq && QueryPerformanceCounter(&cnt)) if(TimerVars::perffrq && QueryPerformanceCounter(&cnt))
tm = cnt.QuadPart/TimerVars<>::perffrq; tm = cnt.QuadPart/TimerVars::perffrq;
else { else {
SYSTEMTIME systm; SYSTEMTIME systm;
FILETIME fltm; FILETIME fltm;
...@@ -106,8 +106,8 @@ FLEXT_TEMPIMPL(void FLEXT_CLASSDEF(flext))::Sleep(double s) ...@@ -106,8 +106,8 @@ FLEXT_TEMPIMPL(void FLEXT_CLASSDEF(flext))::Sleep(double s)
else else
#else #else
LARGE_INTEGER cnt; LARGE_INTEGER cnt;
if(perffrq && QueryPerformanceCounter(&cnt)) { if(TimerVars::perffrq && QueryPerformanceCounter(&cnt)) {
LONGLONG dst = (LONGLONG)(cnt.QuadPart+perffrq*s); LONGLONG dst = (LONGLONG)(cnt.QuadPart+TimerVars::perffrq*s);
for(;;) { for(;;) {
SwitchToThread(); // while waiting switch to another thread SwitchToThread(); // while waiting switch to another thread
QueryPerformanceCounter(&cnt); 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