Skip to content

Commit 2743853

Browse files
bernardosulzbachandreasbuhr
authored andcommitted
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.
1 parent 17848cb commit 2743853

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

lib/auto_reset_event.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@
66
#include "auto_reset_event.hpp"
77

88
#if CPPCORO_OS_WINNT
9-
# define WIN32_LEAN_AND_MEAN
9+
# ifndef WIN32_LEAN_AND_MEAN
10+
# define WIN32_LEAN_AND_MEAN
11+
# endif
1012
# include <windows.h>
1113
# include <system_error>
1214
#endif

lib/spin_wait.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@
99
#include <thread>
1010

1111
#if CPPCORO_OS_WINNT
12-
# define WIN32_LEAN_AND_MEAN
12+
# ifndef WIN32_LEAN_AND_MEAN
13+
# define WIN32_LEAN_AND_MEAN
14+
# endif
1315
# include <windows.h>
1416
#endif
1517

0 commit comments

Comments
 (0)