From 12af79e001ab18ff4d147a70dc583bbaddff46c6 Mon Sep 17 00:00:00 2001 From: sletz Date: Mon, 4 Feb 2008 11:16:27 +0000 Subject: [PATCH] Windows compilation git-svn-id: http://subversion.jackaudio.org/jack/jack2/trunk/jackmp@1826 0c269be4-1314-0410-8aa9-9f06e86f4224 --- common/JackEngineControl.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/common/JackEngineControl.cpp b/common/JackEngineControl.cpp index 7d58bfa4..70c57c1c 100644 --- a/common/JackEngineControl.cpp +++ b/common/JackEngineControl.cpp @@ -61,16 +61,18 @@ void JackEngineControl::ReadFrameTime(JackTimer* timer) } // Private -/* + #ifdef WIN32 inline jack_time_t MAX(jack_time_t a, jack_time_t b) { return (a < b) ? b : a; } -#else +#else + +#define MAX(a,b) std::max((a),(b)) #endif -*/ + void JackEngineControl::CalcCPULoad(JackClientInterface** table, JackGraphManager* manager) { @@ -80,7 +82,7 @@ void JackEngineControl::CalcCPULoad(JackClientInterface** table, JackGraphManage JackClientInterface* client = table[i]; JackClientTiming* timing = manager->GetClientTiming(i); if (client && client->GetClientControl()->fActive && timing->fStatus == Finished) { - lastCycleEnd = std::max(lastCycleEnd, timing->fFinishedAt); + lastCycleEnd = MAX(lastCycleEnd, timing->fFinishedAt); } } @@ -99,10 +101,10 @@ void JackEngineControl::CalcCPULoad(JackClientInterface** table, JackGraphManage jack_time_t maxUsecs = 0; for (int i = 0; i < JACK_ENGINE_ROLLING_COUNT; i++) { - maxUsecs = std::max(fRollingClientUsecs[i], maxUsecs); + maxUsecs = MAX(fRollingClientUsecs[i], maxUsecs); } - fMaxUsecs = std::max(fMaxUsecs, maxUsecs); + fMaxUsecs = MAX(fMaxUsecs, maxUsecs); fSpareUsecs = jack_time_t((maxUsecs < fPeriodUsecs) ? fPeriodUsecs - maxUsecs : 0); fCPULoad = ((1.f - (float(fSpareUsecs) / float(fPeriodUsecs))) * 50.f + (fCPULoad * 0.5f)); }