MinGW tweak: use __rfbmax/__rfbmin instead of max/min, just like most
other files. (There are other variants in use as well: vncmax/vncmin,
max/min, MAX/MIN.)
git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@3337 3789f03b-4d11-0410-bbf8-ca57d06f2519
diff --git a/win/vncviewer/DesktopWindow.cxx b/win/vncviewer/DesktopWindow.cxx
index e282a28..243d1b5 100644
--- a/win/vncviewer/DesktopWindow.cxx
+++ b/win/vncviewer/DesktopWindow.cxx
@@ -27,6 +27,7 @@
#include <rfb_win32/DeviceContext.h>
#include <rfb_win32/Win32Util.h>
#include <rfb_win32/MsgBox.h>
+#include <rfb/util.h>
#include <vncviewer/DesktopWindow.h>
#include <vncviewer/resource.h>
@@ -363,8 +364,8 @@
bool DesktopWindow::setViewportOffset(const Point& tl) {
- Point np = Point(max(0, min(tl.x, buffer->width()-client_size.width())),
- max(0, min(tl.y, buffer->height()-client_size.height())));
+ Point np = Point(__rfbmax(0, __rfbmin(tl.x, buffer->width()-client_size.width())),
+ __rfbmax(0, __rfbmin(tl.y, buffer->height()-client_size.height())));
Point delta = np.translate(scrolloffset.negate());
if (!np.equals(scrolloffset)) {
scrolloffset = np;
@@ -1219,8 +1220,8 @@
si.nMin = 0;
si.nMax = buffer->height();
si.nPage = buffer->height() - (reqd_size.height() - window_size.height());
- maxscrolloffset.y = max(0, si.nMax-si.nPage);
- scrolloffset.y = min(maxscrolloffset.y, scrolloffset.y);
+ maxscrolloffset.y = __rfbmax(0, si.nMax-si.nPage);
+ scrolloffset.y = __rfbmin(maxscrolloffset.y, scrolloffset.y);
si.nPos = scrolloffset.y;
SetScrollInfo(frameHandle, SB_VERT, &si, TRUE);
}
@@ -1230,8 +1231,8 @@
si.nMin = 0;
si.nMax = buffer->width();
si.nPage = buffer->width() - (reqd_size.width() - window_size.width());
- maxscrolloffset.x = max(0, si.nMax-si.nPage);
- scrolloffset.x = min(maxscrolloffset.x, scrolloffset.x);
+ maxscrolloffset.x = __rfbmax(0, si.nMax-si.nPage);
+ scrolloffset.x = __rfbmin(maxscrolloffset.x, scrolloffset.x);
si.nPos = scrolloffset.x;
SetScrollInfo(frameHandle, SB_HORZ, &si, TRUE);
}