cmFileLockResult: Remove expensive windows.h include

stage/master/nightly/2023/06/23^2
Clemens Wasser 2023-06-16 19:22:11 +02:00
parent 870390ee81
commit 64821d8a26
3 changed files with 6 additions and 18 deletions

View File

@ -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;

View File

@ -5,6 +5,10 @@
#include <cerrno>
#include <cstring>
#ifdef _WIN32
# include <Windows.h>
#endif
cmFileLockResult cmFileLockResult::MakeOk()
{
return { OK, 0 };

View File

@ -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.