https://github.com/Kitware/CMake
Revision 878632c90e4811ed08e5d1c298de8ae61d79f620 authored by Brad King on 11 February 2016, 14:52:37 UTC, committed by Brad King on 11 February 2016, 14:53:34 UTC
The fix in commit v3.5.0-rc1~84^2 (Xcode: Escape all backslashes in strings, 2015-12-27) is a change in behavior that can break existing projects that worked around the inconsistency with other generators. Add a release note to call attention to this change in behavior.
1 parent a5a5a68
Tip revision: 878632c90e4811ed08e5d1c298de8ae61d79f620 authored by Brad King on 11 February 2016, 14:52:37 UTC
Help: Add release note about Xcode escaping fix (#15969)
Help: Add release note about Xcode escaping fix (#15969)
Tip revision: 878632c
cmFileLock.cxx
/*============================================================================
CMake - Cross Platform Makefile Generator
Copyright 2014 Ruslan Baratov
Distributed under the OSI-approved BSD License (the "License");
see accompanying file Copyright.txt for details.
This software is distributed WITHOUT ANY WARRANTY; without even the
implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the License for more information.
============================================================================*/
#include "cmFileLock.h"
#include <assert.h>
#include "cmFileLockResult.h"
// Common implementation
cmFileLock::~cmFileLock()
{
if (!this->Filename.empty())
{
const cmFileLockResult result = this->Release();
static_cast<void>(result);
assert(result.IsOk());
}
}
cmFileLockResult cmFileLock::Lock(
const std::string& filename, unsigned long timeout)
{
if (filename.empty())
{
// Error is internal since all the directories and file must be created
// before actual lock called.
return cmFileLockResult::MakeInternal();
}
if (!this->Filename.empty())
{
// Error is internal since double-lock must be checked in class
// cmFileLockPool by the cmFileLock::IsLocked method.
return cmFileLockResult::MakeInternal();
}
this->Filename = filename;
cmFileLockResult result = this->OpenFile();
if (result.IsOk())
{
if (timeout == static_cast<unsigned long>(-1))
{
result = this->LockWithoutTimeout();
}
else
{
result = this->LockWithTimeout(timeout);
}
}
if (!result.IsOk())
{
this->Filename = "";
}
return result;
}
bool cmFileLock::IsLocked(const std::string& filename) const
{
return filename == this->Filename;
}
#if defined(_WIN32)
# include "cmFileLockWin32.cxx"
#else
# include "cmFileLockUnix.cxx"
#endif
Computing file changes ...