From a712002fec718d29bcbe46ae03a627bab8b87fe1 Mon Sep 17 00:00:00 2001 From: RT Date: Sun, 19 Jul 2026 19:00:08 -0500 Subject: [PATCH] CRIOMAIN.CPP: fix min/max undeclared identifier (VC6) min() and max() are not in scope in this translation unit under VC6. Replace with explicit ternary clamping expression; no new headers needed. --- Gameleap/code/mw4/Code/MW4/CRIOMAIN.CPP | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Gameleap/code/mw4/Code/MW4/CRIOMAIN.CPP b/Gameleap/code/mw4/Code/MW4/CRIOMAIN.CPP index d2d2bc96..8d28cf0f 100644 --- a/Gameleap/code/mw4/Code/MW4/CRIOMAIN.CPP +++ b/Gameleap/code/mw4/Code/MW4/CRIOMAIN.CPP @@ -1008,8 +1008,10 @@ DWORD FAR PASCAL CommWatchProc( LPSTR lpData ) { DWORD effectiveBaud = (g_dwRIOBaud != 0) ? g_dwRIOBaud : ((g_nRIOType == 0) ? 9600UL : 115200UL); - g_dwRIOPollTimeout = min(50UL, max(5UL, - (480000UL + effectiveBaud - 1) / effectiveBaud)); + { + DWORD t = (480000UL + effectiveBaud - 1) / effectiveBaud; + g_dwRIOPollTimeout = (t < 5UL) ? 5UL : (t > 50UL ? 50UL : t); + } } while(1) { DWORD dwEvtMask = 0;