Add support for NOMINMAX

François Gouget fgouget at codeweavers.com
Sat May 5 15:22:22 CDT 2001


Changelog:

   François Gouget <fgouget at codeweavers.com>

 * include/minmax.h,
   include/windef.h,
   graphics/x11drv/codepage.c

   Add the minmax.h header (VC6)
   Add support for NOMINMAX
   Remove __min/__max from windef.h, they belong to (msvcrt/)stdlib.h
   Fixes bug #177 reported by Andres Kruse

-- 
François Gouget
fgouget at codeweavers.com
-------------- next part --------------
--- /dev/null	Sun Apr 15 00:49:36 2001
+++ include/minmax.h	Sat May  5 11:31:13 2001
@@ -0,0 +1,17 @@
+/*
+ * min/max macros
+ *
+ * Copyright 2001 Francois Gouget
+ */
+
+#ifndef __WINE_MINMAX_H
+#define __WINE_MINMAX_H
+
+#ifndef max
+#define max(a,b)   (((a) > (b)) ? (a) : (b))
+#endif
+#ifndef min
+#define min(a,b)   (((a) < (b)) ? (a) : (b))
+#endif
+
+#endif /* __WINE_MINMAX_H */
Index: include/windef.h
===================================================================
RCS file: /home/cvs/wine/wine/include/windef.h,v
retrieving revision 1.56
diff -u -r1.56 windef.h
--- include/windef.h	2001/04/10 23:23:31	1.56
+++ include/windef.h	2001/05/05 19:55:05
@@ -14,6 +14,9 @@
 #define WINVER 0x0500
 
 #include "winnt.h"
+#ifndef NOMINMAX
+#include "minmax.h"
+#endif
 
 
 #ifdef __cplusplus
@@ -140,16 +143,6 @@
 #define ADD_LOWORD(dw,val)  ((dw) = ((dw) & 0xffff0000) | LOWORD((DWORD)(dw)+(val)))
 #endif
 
-
-/* min and max macros */
-#define __max(a,b) (((a) > (b)) ? (a) : (b))
-#define __min(a,b) (((a) < (b)) ? (a) : (b))
-#ifndef max
-#define max(a,b)   (((a) > (b)) ? (a) : (b))
-#endif
-#ifndef min
-#define min(a,b)   (((a) < (b)) ? (a) : (b))
-#endif
 
 #ifndef _MAX_PATH
 /* FIXME: These are supposed to be in stdlib.h only */
Index: graphics/x11drv/codepage.c
===================================================================
RCS file: /home/cvs/wine/wine/graphics/x11drv/codepage.c,v
retrieving revision 1.8
diff -u -r1.8 codepage.c
--- graphics/x11drv/codepage.c	2000/10/12 23:05:21	1.8
+++ graphics/x11drv/codepage.c	2001/05/05 19:55:05
@@ -576,7 +576,7 @@
     if ( pfo_ansi != NULL )
     {
 	pTM->tmAveCharWidth = floor((pfo_ansi->foAvgCharWidth * 2.0 + pfo->foAvgCharWidth) / 3.0 * pfo->rescale + 0.5);
-	pTM->tmMaxCharWidth = __max(pfo_ansi->foMaxCharWidth, pfo->foMaxCharWidth) * pfo->rescale;
+	pTM->tmMaxCharWidth = max(pfo_ansi->foMaxCharWidth, pfo->foMaxCharWidth) * pfo->rescale;
     }
     else
     {


More information about the wine-patches mailing list