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.
This commit is contained in:
2026-07-19 19:00:08 -05:00
parent f76dc05f46
commit a712002fec
+4 -2
View File
@@ -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;