mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-05 21:31:08 -06:00
cmFileLockResult: Remove expensive windows.h include
This commit is contained in:
@@ -12,11 +12,7 @@
|
|||||||
cmFileLock::cmFileLock(cmFileLock&& other) noexcept
|
cmFileLock::cmFileLock(cmFileLock&& other) noexcept
|
||||||
{
|
{
|
||||||
this->File = other.File;
|
this->File = other.File;
|
||||||
#if defined(_WIN32)
|
other.File = (decltype(other.File))-1;
|
||||||
other.File = INVALID_HANDLE_VALUE;
|
|
||||||
#else
|
|
||||||
other.File = -1;
|
|
||||||
#endif
|
|
||||||
this->Filename = std::move(other.Filename);
|
this->Filename = std::move(other.Filename);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -32,11 +28,7 @@ cmFileLock::~cmFileLock()
|
|||||||
cmFileLock& cmFileLock::operator=(cmFileLock&& other) noexcept
|
cmFileLock& cmFileLock::operator=(cmFileLock&& other) noexcept
|
||||||
{
|
{
|
||||||
this->File = other.File;
|
this->File = other.File;
|
||||||
#if defined(_WIN32)
|
other.File = (decltype(other.File))-1;
|
||||||
other.File = INVALID_HANDLE_VALUE;
|
|
||||||
#else
|
|
||||||
other.File = -1;
|
|
||||||
#endif
|
|
||||||
this->Filename = std::move(other.Filename);
|
this->Filename = std::move(other.Filename);
|
||||||
|
|
||||||
return *this;
|
return *this;
|
||||||
|
|||||||
@@ -5,6 +5,10 @@
|
|||||||
#include <cerrno>
|
#include <cerrno>
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
|
|
||||||
|
#ifdef _WIN32
|
||||||
|
# include <Windows.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
cmFileLockResult cmFileLockResult::MakeOk()
|
cmFileLockResult cmFileLockResult::MakeOk()
|
||||||
{
|
{
|
||||||
return { OK, 0 };
|
return { OK, 0 };
|
||||||
|
|||||||
@@ -6,10 +6,6 @@
|
|||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
#if defined(_WIN32)
|
|
||||||
# include <windows.h> // DWORD
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Result of the locking/unlocking file.
|
* @brief Result of the locking/unlocking file.
|
||||||
* @note See @c cmFileLock
|
* @note See @c cmFileLock
|
||||||
@@ -17,11 +13,7 @@
|
|||||||
class cmFileLockResult
|
class cmFileLockResult
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
#if defined(_WIN32)
|
|
||||||
using Error = DWORD;
|
|
||||||
#else
|
|
||||||
using Error = int;
|
using Error = int;
|
||||||
#endif
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Successful lock/unlock.
|
* @brief Successful lock/unlock.
|
||||||
|
|||||||
Reference in New Issue
Block a user