cmFileLockResult: Remove expensive windows.h include
parent
870390ee81
commit
64821d8a26
|
@ -12,11 +12,7 @@
|
|||
cmFileLock::cmFileLock(cmFileLock&& other) noexcept
|
||||
{
|
||||
this->File = other.File;
|
||||
#if defined(_WIN32)
|
||||
other.File = INVALID_HANDLE_VALUE;
|
||||
#else
|
||||
other.File = -1;
|
||||
#endif
|
||||
other.File = (decltype(other.File))-1;
|
||||
this->Filename = std::move(other.Filename);
|
||||
}
|
||||
|
||||
|
@ -32,11 +28,7 @@ cmFileLock::~cmFileLock()
|
|||
cmFileLock& cmFileLock::operator=(cmFileLock&& other) noexcept
|
||||
{
|
||||
this->File = other.File;
|
||||
#if defined(_WIN32)
|
||||
other.File = INVALID_HANDLE_VALUE;
|
||||
#else
|
||||
other.File = -1;
|
||||
#endif
|
||||
other.File = (decltype(other.File))-1;
|
||||
this->Filename = std::move(other.Filename);
|
||||
|
||||
return *this;
|
||||
|
|
|
@ -5,6 +5,10 @@
|
|||
#include <cerrno>
|
||||
#include <cstring>
|
||||
|
||||
#ifdef _WIN32
|
||||
# include <Windows.h>
|
||||
#endif
|
||||
|
||||
cmFileLockResult cmFileLockResult::MakeOk()
|
||||
{
|
||||
return { OK, 0 };
|
||||
|
|
|
@ -6,10 +6,6 @@
|
|||
|
||||
#include <string>
|
||||
|
||||
#if defined(_WIN32)
|
||||
# include <windows.h> // DWORD
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Result of the locking/unlocking file.
|
||||
* @note See @c cmFileLock
|
||||
|
@ -17,11 +13,7 @@
|
|||
class cmFileLockResult
|
||||
{
|
||||
public:
|
||||
#if defined(_WIN32)
|
||||
using Error = DWORD;
|
||||
#else
|
||||
using Error = int;
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Successful lock/unlock.
|
||||
|
|
Loading…
Reference in New Issue