Skip to content

Commit 59987ca

Browse files
authored
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.
1 parent 80bdcd9 commit 59987ca

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/snmalloc/pal/pal_windows.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@
99
# include <errno.h>
1010
# include <stdio.h>
1111
# endif
12-
# define WIN32_LEAN_AND_MEAN
12+
# ifndef WIN32_LEAN_AND_MEAN
13+
# define WIN32_LEAN_AND_MEAN
14+
# endif
1315
# ifndef NOMINMAX
1416
# define NOMINMAX
1517
# endif

0 commit comments

Comments
 (0)