Skip to content

Commit

Permalink
Merge pull request #71 from think-cell/redef_warnings
Browse files Browse the repository at this point in the history
Remove possible warnings with redefinitions of WIN32_LEAN_AND_MEAN.
  • Loading branch information
lewissbaker committed Mar 27, 2018
2 parents 862e99d + 936e6ee commit a19b13b
Show file tree
Hide file tree
Showing 10 changed files with 33 additions and 11 deletions.
4 changes: 3 additions & 1 deletion lib/file.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@
#include <cassert>

#if CPPCORO_OS_WINNT
# define WIN32_LEAN_AND_MEAN
# ifndef WIN32_LEAN_AND_MEAN
# define WIN32_LEAN_AND_MEAN
# endif
# include <Windows.h>
#endif

Expand Down
4 changes: 3 additions & 1 deletion lib/file_read_operation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@
#include <cppcoro/file_read_operation.hpp>

#if CPPCORO_OS_WINNT
# define WIN32_LEAN_AND_MEAN
# ifndef WIN32_LEAN_AND_MEAN
# define WIN32_LEAN_AND_MEAN
# endif
# include <Windows.h>

bool cppcoro::file_read_operation::try_start() noexcept
Expand Down
4 changes: 3 additions & 1 deletion lib/file_write_operation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@
#include <cppcoro/file_write_operation.hpp>

#if CPPCORO_OS_WINNT
# define WIN32_LEAN_AND_MEAN
# ifndef WIN32_LEAN_AND_MEAN
# define WIN32_LEAN_AND_MEAN
# endif
# include <Windows.h>

bool cppcoro::file_write_operation::try_start() noexcept
Expand Down
8 changes: 6 additions & 2 deletions lib/io_service.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,12 @@
#include <thread>

#if CPPCORO_OS_WINNT
# define WIN32_LEAN_AND_MEAN
# define NOMINMAX
# ifndef WIN32_LEAN_AND_MEAN
# define WIN32_LEAN_AND_MEAN
# endif
# ifndef NOMINMAX
# define NOMINMAX
# endif
# include <Windows.h>
#endif

Expand Down
4 changes: 3 additions & 1 deletion lib/lightweight_manual_reset_event.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@
#include <system_error>

#if CPPCORO_OS_WINNT
# define WIN32_LEAN_AND_MEAN
# ifndef WIN32_LEAN_AND_MEAN
# define WIN32_LEAN_AND_MEAN
# endif
# include <Windows.h>

# if CPPCORO_OS_WINNT >= 0x0602
Expand Down
4 changes: 3 additions & 1 deletion lib/read_only_file.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@
#include <cppcoro\read_only_file.hpp>

#if CPPCORO_OS_WINNT
# define WIN32_LEAN_AND_MEAN
# ifndef WIN32_LEAN_AND_MEAN
# define WIN32_LEAN_AND_MEAN
# endif
# include <Windows.h>

cppcoro::read_only_file cppcoro::read_only_file::open(
Expand Down
4 changes: 3 additions & 1 deletion lib/read_write_file.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@
#include <cppcoro\read_write_file.hpp>

#if CPPCORO_OS_WINNT
# define WIN32_LEAN_AND_MEAN
# ifndef WIN32_LEAN_AND_MEAN
# define WIN32_LEAN_AND_MEAN
# endif
# include <Windows.h>

cppcoro::read_write_file cppcoro::read_write_file::open(
Expand Down
4 changes: 3 additions & 1 deletion lib/win32.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@

#include <cppcoro/detail/win32.hpp>

#define WIN32_LEAN_AND_MEAN
#ifndef WIN32_LEAN_AND_MEAN
# define WIN32_LEAN_AND_MEAN
#endif
#include <Windows.h>

void cppcoro::detail::win32::safe_handle::close() noexcept
Expand Down
4 changes: 3 additions & 1 deletion lib/writable_file.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@
#include <system_error>

#if CPPCORO_OS_WINNT
# define WIN32_LEAN_AND_MEAN
# ifndef WIN32_LEAN_AND_MEAN
# define WIN32_LEAN_AND_MEAN
# endif
# include <Windows.h>

void cppcoro::writable_file::set_size(
Expand Down
4 changes: 3 additions & 1 deletion lib/write_only_file.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@
#include <cppcoro\write_only_file.hpp>

#if CPPCORO_OS_WINNT
# define WIN32_LEAN_AND_MEAN
# ifndef WIN32_LEAN_AND_MEAN
# define WIN32_LEAN_AND_MEAN
# endif
# include <Windows.h>

cppcoro::write_only_file cppcoro::write_only_file::open(
Expand Down

0 comments on commit a19b13b

Please sign in to comment.