From ee5e2d89b63d357ca779a72d638d8f51e6bc30d0 Mon Sep 17 00:00:00 2001 From: Bernardo Sulzbach Date: Sat, 7 Sep 2024 10:36:21 +0200 Subject: [PATCH] Avoid redefining WIN32_LEAN_AND_MEAN on Windows This causes warnings for people integrating cppcoro's sources in their projects without using your CMakeLists. Other files already do the #ifndef check. --- lib/auto_reset_event.cpp | 4 +++- lib/spin_wait.cpp | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/auto_reset_event.cpp b/lib/auto_reset_event.cpp index 66c04e2d..f0698a08 100644 --- a/lib/auto_reset_event.cpp +++ b/lib/auto_reset_event.cpp @@ -6,7 +6,9 @@ #include "auto_reset_event.hpp" #if CPPCORO_OS_WINNT -# define WIN32_LEAN_AND_MEAN +# ifndef WIN32_LEAN_AND_MEAN +# define WIN32_LEAN_AND_MEAN +# endif # include # include #endif diff --git a/lib/spin_wait.cpp b/lib/spin_wait.cpp index 47263277..a74a4c44 100644 --- a/lib/spin_wait.cpp +++ b/lib/spin_wait.cpp @@ -9,7 +9,9 @@ #include #if CPPCORO_OS_WINNT -# define WIN32_LEAN_AND_MEAN +# ifndef WIN32_LEAN_AND_MEAN +# define WIN32_LEAN_AND_MEAN +# endif # include #endif