cppcoro/lib/win32.cpp
Attila 936e6eeb10 Remove possible warnings with redefinitions
If the library is used as part of a bigger project some definitions can
be provided via external build files.
2018-03-09 17:32:58 +01:00

21 lines
553 B
C++

///////////////////////////////////////////////////////////////////////////////
// Copyright (c) Lewis Baker
// Licenced under MIT license. See LICENSE.txt for details.
///////////////////////////////////////////////////////////////////////////////
#include <cppcoro/detail/win32.hpp>
#ifndef WIN32_LEAN_AND_MEAN
# define WIN32_LEAN_AND_MEAN
#endif
#include <Windows.h>
void cppcoro::detail::win32::safe_handle::close() noexcept
{
if (m_handle != nullptr && m_handle != INVALID_HANDLE_VALUE)
{
::CloseHandle(m_handle);
m_handle = nullptr;
}
}