From 59987ca908edc35ad45e7c214c41c0f3c902d041 Mon Sep 17 00:00:00 2001 From: Jeff Sooknarine Date: Tue, 1 Apr 2025 17:16:55 -0400 Subject: [PATCH] Header-only build fix for WIN32_LEAN_AND_MEAN redefinition (#764) When using snmalloc as header-only library in a project that globally defines `WIN32_LEAN_AND_MEAN`, there is a compile error for macro redefinition. Guard the pal_windows.h define. --- src/snmalloc/pal/pal_windows.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/snmalloc/pal/pal_windows.h b/src/snmalloc/pal/pal_windows.h index ebf2e68..776df89 100644 --- a/src/snmalloc/pal/pal_windows.h +++ b/src/snmalloc/pal/pal_windows.h @@ -9,7 +9,9 @@ # include # include # endif -# define WIN32_LEAN_AND_MEAN +# ifndef WIN32_LEAN_AND_MEAN +# define WIN32_LEAN_AND_MEAN +# endif # ifndef NOMINMAX # define NOMINMAX # endif