Commit 56539394 authored by Francois Gouget's avatar Francois Gouget Committed by Alexandre Julliard

Added the minmax.h header (VC6).

Added support for NOMINMAX. Remove __min/__max from windef.h, they belong to (msvcrt/)stdlib.h.
parent b7175dfb
......@@ -576,7 +576,7 @@ static void X11DRV_GetTextMetricsA_cp932( fontObject* pfo, LPTEXTMETRICA pTM )
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
{
......
......@@ -39,6 +39,7 @@ INSTALLED_INCLUDES = \
mapidefs.h \
mciavi.h \
mcx.h \
minmax.h \
mmreg.h \
mmsystem.h \
msacm.h \
......
/*
* 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 */
......@@ -140,16 +140,15 @@ typedef INT CALLBACK (*PROC)();
#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 NOMINMAX
#ifndef max
#define max(a,b) (((a) > (b)) ? (a) : (b))
#endif
#ifndef min
#define min(a,b) (((a) < (b)) ? (a) : (b))
#endif
#endif /* NOMINMAX */
#ifndef _MAX_PATH
/* FIXME: These are supposed to be in stdlib.h only */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment