From 655fb0f9ded318244eeac702b04888d4a4810139 Mon Sep 17 00:00:00 2001 From: Eric Biggers Date: Sat, 18 Mar 2023 00:17:54 -0700 Subject: [PATCH] Fix 'MAX' redefined warning on macOS --- include/wimlib/compiler.h | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/include/wimlib/compiler.h b/include/wimlib/compiler.h index 91445b2a..742f3bfc 100644 --- a/include/wimlib/compiler.h +++ b/include/wimlib/compiler.h @@ -141,17 +141,17 @@ #define typeof __typeof__ /* Get the minimum of two variables, without multiple evaluation. */ -#ifndef min -# define min(a, b) ({ typeof(a) _a = (a); typeof(b) _b = (b); \ - (_a < _b) ? _a : _b; }) -#endif +#undef min +#define min(a, b) ({ typeof(a) _a = (a); typeof(b) _b = (b); \ + (_a < _b) ? _a : _b; }) +#undef MIN #define MIN(a, b) min((a), (b)) /* Get the maximum of two variables, without multiple evaluation. */ -#ifndef max -# define max(a, b) ({ typeof(a) _a = (a); typeof(b) _b = (b); \ - (_a > _b) ? _a : _b; }) -#endif +#undef max +#define max(a, b) ({ typeof(a) _a = (a); typeof(b) _b = (b); \ + (_a > _b) ? _a : _b; }) +#undef MAX #define MAX(a, b) max((a), (b)) /* Swap the values of two variables, without multiple evaluation. */ -- 2.43.0