From 821d9789501444a57c2c06335334e4d1dab5567e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B3zef=20Kucia?= Date: Wed, 28 Sep 2016 09:42:49 +0200 Subject: [PATCH] include: Add min() & max() macros. --- include/vkd3d_windows.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/include/vkd3d_windows.h b/include/vkd3d_windows.h index a030d1be..cf971f14 100644 --- a/include/vkd3d_windows.h +++ b/include/vkd3d_windows.h @@ -179,6 +179,7 @@ typedef struct SECURITY_ATTRIBUTES SECURITY_ATTRIBUTES; #endif /* _WIN32 */ +/* Nameless unions */ #ifndef __C89_NAMELESS # ifdef NONAMELESSUNION # define __C89_NAMELESS @@ -189,4 +190,13 @@ typedef struct SECURITY_ATTRIBUTES SECURITY_ATTRIBUTES; # endif /* NONAMELESSUNION */ #endif /* __C89_NAMELESS */ +/* Define min() & max() macros */ +#ifndef min +# define min(a, b) (((a) <= (b)) ? (a) : (b)) +#endif + +#ifndef max +# define max(a, b) (((a) >= (b)) ? (a) : (b)) +#endif + #endif /* __VKD3D_WINDOWS_H */