Commit b5ec5b09 authored by Brad King's avatar Brad King

Avoid using KWSys auto_ptr by adopting it ourselves

Replace use of cmsys::auto_ptr with a CM_AUTO_PTR macro that maps to
our own implementation adopted from the KWSys auto_ptr implementation.
Later we may be able to map CM_AUTO_PTR to std::auto_ptr on compilers
that do not warn about it.

Automate the client site conversions:

    git grep -l auto_ptr -- Source/ | grep -v Source/kwsys/ | xargs sed -i \
      's|cmsys::auto_ptr|CM_AUTO_PTR|;s|cmsys/auto_ptr.hxx|cm_auto_ptr.hxx|'
parent 8d793758
......@@ -24,9 +24,10 @@ to build with such toolchains.
std::auto_ptr
-------------
Some implementations have a ``std::auto_ptr`` which can not be used as a
return value from a function. ``std::auto_ptr`` may not be used. Use
``cmsys::auto_ptr`` instead.
The ``std::auto_ptr`` template is deprecated in C++11. We want to use it
so we can build on C++98 compilers but we do not want to turn off compiler
warnings about deprecated interfaces in general. Use the ``CM_AUTO_PTR``
macro instead.
size_t
------
......
......@@ -364,6 +364,7 @@ set(SRCS
cmake.cxx
cmake.h
cm_auto_ptr.hxx
cm_get_date.h
cm_get_date.c
cm_sha2.h
......
......@@ -1044,7 +1044,7 @@ std::string cmCPackWIXGenerator::CreateNewIdForPath(std::string const& path)
std::string cmCPackWIXGenerator::CreateHashedId(
std::string const& path, std::string const& normalizedFilename)
{
cmsys::auto_ptr<cmCryptoHash> sha1 = cmCryptoHash::New("SHA1");
CM_AUTO_PTR<cmCryptoHash> sha1 = cmCryptoHash::New("SHA1");
std::string hash = sha1->HashString(path.c_str());
std::string identifier;
......
......@@ -624,7 +624,7 @@ int cmCPackGenerator::InstallProjectViaInstallCMakeProjects(
cm.AddCMakePaths();
cm.SetProgressCallback(cmCPackGeneratorProgress, this);
cmGlobalGenerator gg(&cm);
cmsys::auto_ptr<cmMakefile> mf(
CM_AUTO_PTR<cmMakefile> mf(
new cmMakefile(&gg, cm.GetCurrentSnapshot()));
if (!installSubDirectory.empty() && installSubDirectory != "/") {
tempInstallDirectory += installSubDirectory;
......
......@@ -185,7 +185,7 @@ int main(int argc, char const* const* argv)
cminst.GetCurrentSnapshot().SetDefaultDefinitions();
cminst.GetState()->RemoveUnscriptableCommands();
cmGlobalGenerator cmgg(&cminst);
cmsys::auto_ptr<cmMakefile> globalMF(
CM_AUTO_PTR<cmMakefile> globalMF(
new cmMakefile(&cmgg, cminst.GetCurrentSnapshot()));
#if defined(__CYGWIN__)
globalMF->AddDefinition("CMAKE_LEGACY_CYGWIN_WIN32", "0");
......
......@@ -612,7 +612,7 @@ int cmCTestLaunch::Main(int argc, const char* const argv[])
#include "cmGlobalGenerator.h"
#include "cmMakefile.h"
#include "cmake.h"
#include <cmsys/auto_ptr.hxx>
#include <cm_auto_ptr.hxx>
void cmCTestLaunch::LoadConfig()
{
cmake cm;
......@@ -620,7 +620,7 @@ void cmCTestLaunch::LoadConfig()
cm.SetHomeOutputDirectory("");
cm.GetCurrentSnapshot().SetDefaultDefinitions();
cmGlobalGenerator gg(&cm);
cmsys::auto_ptr<cmMakefile> mf(new cmMakefile(&gg, cm.GetCurrentSnapshot()));
CM_AUTO_PTR<cmMakefile> mf(new cmMakefile(&gg, cm.GetCurrentSnapshot()));
std::string fname = this->LogDir;
fname += "CTestLaunchConfig.cmake";
if (cmSystemTools::FileExists(fname.c_str()) &&
......
......@@ -1352,7 +1352,7 @@ void cmCTestTestHandler::GetListOfTests()
cm.SetHomeOutputDirectory("");
cm.GetCurrentSnapshot().SetDefaultDefinitions();
cmGlobalGenerator gg(&cm);
cmsys::auto_ptr<cmMakefile> mf(new cmMakefile(&gg, cm.GetCurrentSnapshot()));
CM_AUTO_PTR<cmMakefile> mf(new cmMakefile(&gg, cm.GetCurrentSnapshot()));
mf->AddDefinition("CTEST_CONFIGURATION_TYPE",
this->CTest->GetConfigType().c_str());
......
......@@ -30,7 +30,7 @@
#include "cmCTestSVN.h"
#include "cmCTestVC.h"
#include <cmsys/auto_ptr.hxx>
#include <cm_auto_ptr.hxx>
//#include <cmsys/RegularExpression.hxx>
#include <cmsys/Process.h>
......@@ -159,7 +159,7 @@ int cmCTestUpdateHandler::ProcessHandler()
, this->Quiet);
// Create an object to interact with the VCS tool.
cmsys::auto_ptr<cmCTestVC> vc;
CM_AUTO_PTR<cmCTestVC> vc;
switch (this->UpdateType) {
case e_CVS:
vc.reset(new cmCTestCVS(this->CTest, ofs));
......
......@@ -51,7 +51,7 @@
#include <math.h>
#include <stdlib.h>
#include <cmsys/auto_ptr.hxx>
#include <cm_auto_ptr.hxx>
#include <cm_zlib.h>
#include <cmsys/Base64.h>
......@@ -474,7 +474,7 @@ int cmCTest::Initialize(const char* binary_dir, cmCTestStartCommand* command)
cm.SetHomeOutputDirectory("");
cm.GetCurrentSnapshot().SetDefaultDefinitions();
cmGlobalGenerator gg(&cm);
cmsys::auto_ptr<cmMakefile> mf(new cmMakefile(&gg, cm.GetCurrentSnapshot()));
CM_AUTO_PTR<cmMakefile> mf(new cmMakefile(&gg, cm.GetCurrentSnapshot()));
if (!this->ReadCustomConfigurationFileTree(this->BinaryDir.c_str(),
mf.get())) {
cmCTestOptionalLog(
......@@ -1165,7 +1165,7 @@ int cmCTest::RunTest(std::vector<const char*> argv, std::string* output,
}
std::string oldpath = cmSystemTools::GetCurrentWorkingDirectory();
cmsys::auto_ptr<cmSystemTools::SaveRestoreEnvironment> saveEnv;
CM_AUTO_PTR<cmSystemTools::SaveRestoreEnvironment> saveEnv;
if (modifyEnv) {
saveEnv.reset(new cmSystemTools::SaveRestoreEnvironment);
cmSystemTools::AppendEnv(*environment);
......@@ -1193,7 +1193,7 @@ int cmCTest::RunTest(std::vector<const char*> argv, std::string* output,
*output = "";
}
cmsys::auto_ptr<cmSystemTools::SaveRestoreEnvironment> saveEnv;
CM_AUTO_PTR<cmSystemTools::SaveRestoreEnvironment> saveEnv;
if (modifyEnv) {
saveEnv.reset(new cmSystemTools::SaveRestoreEnvironment);
cmSystemTools::AppendEnv(*environment);
......
......@@ -15,22 +15,22 @@
#include <cmsys/FStream.hxx>
#include <cmsys/MD5.h>
cmsys::auto_ptr<cmCryptoHash> cmCryptoHash::New(const char* algo)
CM_AUTO_PTR<cmCryptoHash> cmCryptoHash::New(const char* algo)
{
if (strcmp(algo, "MD5") == 0) {
return cmsys::auto_ptr<cmCryptoHash>(new cmCryptoHashMD5);
return CM_AUTO_PTR<cmCryptoHash>(new cmCryptoHashMD5);
} else if (strcmp(algo, "SHA1") == 0) {
return cmsys::auto_ptr<cmCryptoHash>(new cmCryptoHashSHA1);
return CM_AUTO_PTR<cmCryptoHash>(new cmCryptoHashSHA1);
} else if (strcmp(algo, "SHA224") == 0) {
return cmsys::auto_ptr<cmCryptoHash>(new cmCryptoHashSHA224);
return CM_AUTO_PTR<cmCryptoHash>(new cmCryptoHashSHA224);
} else if (strcmp(algo, "SHA256") == 0) {
return cmsys::auto_ptr<cmCryptoHash>(new cmCryptoHashSHA256);
return CM_AUTO_PTR<cmCryptoHash>(new cmCryptoHashSHA256);
} else if (strcmp(algo, "SHA384") == 0) {
return cmsys::auto_ptr<cmCryptoHash>(new cmCryptoHashSHA384);
return CM_AUTO_PTR<cmCryptoHash>(new cmCryptoHashSHA384);
} else if (strcmp(algo, "SHA512") == 0) {
return cmsys::auto_ptr<cmCryptoHash>(new cmCryptoHashSHA512);
return CM_AUTO_PTR<cmCryptoHash>(new cmCryptoHashSHA512);
} else {
return cmsys::auto_ptr<cmCryptoHash>(CM_NULLPTR);
return CM_AUTO_PTR<cmCryptoHash>(CM_NULLPTR);
}
}
......
......@@ -14,13 +14,13 @@
#include "cmStandardIncludes.h"
#include <cmsys/auto_ptr.hxx>
#include <cm_auto_ptr.hxx>
class cmCryptoHash
{
public:
virtual ~cmCryptoHash() {}
static cmsys::auto_ptr<cmCryptoHash> New(const char* algo);
static CM_AUTO_PTR<cmCryptoHash> New(const char* algo);
std::string HashString(const std::string& input);
std::string HashFile(const std::string& file);
......
......@@ -13,7 +13,7 @@
#include "cmMakefile.h"
#include <cmsys/auto_ptr.hxx>
#include <cm_auto_ptr.hxx>
cmCustomCommand::cmCustomCommand()
: Backtrace()
......
......@@ -66,7 +66,7 @@ std::string cmCustomCommandGenerator::GetCommand(unsigned int c) const
}
}
cmsys::auto_ptr<cmCompiledGeneratorExpression> cge = this->GE->Parse(argv0);
CM_AUTO_PTR<cmCompiledGeneratorExpression> cge = this->GE->Parse(argv0);
std::string exe = cge->Evaluate(this->LG, this->Config);
return exe;
......@@ -145,7 +145,7 @@ std::vector<std::string> const& cmCustomCommandGenerator::GetDepends() const
std::vector<std::string> depends = this->CC.GetDepends();
for (std::vector<std::string>::const_iterator i = depends.begin();
i != depends.end(); ++i) {
cmsys::auto_ptr<cmCompiledGeneratorExpression> cge = this->GE->Parse(*i);
CM_AUTO_PTR<cmCompiledGeneratorExpression> cge = this->GE->Parse(*i);
std::vector<std::string> result;
cmSystemTools::ExpandListArgument(cge->Evaluate(this->LG, this->Config),
result);
......
......@@ -13,8 +13,8 @@
#include "cmELF.h"
#include <cm_auto_ptr.hxx>
#include <cmsys/FStream.hxx>
#include <cmsys/auto_ptr.hxx>
// Include the ELF format information system header.
#if defined(__OpenBSD__)
......@@ -107,7 +107,7 @@ public:
};
// Construct and take ownership of the file stream object.
cmELFInternal(cmELF* external, cmsys::auto_ptr<cmsys::ifstream>& fin,
cmELFInternal(cmELF* external, CM_AUTO_PTR<cmsys::ifstream>& fin,
ByteOrderType order)
: External(external)
, Stream(*fin.release())
......@@ -237,7 +237,7 @@ public:
typedef typename Types::tagtype tagtype;
// Construct with a stream and byte swap indicator.
cmELFInternalImpl(cmELF* external, cmsys::auto_ptr<cmsys::ifstream>& fin,
cmELFInternalImpl(cmELF* external, CM_AUTO_PTR<cmsys::ifstream>& fin,
ByteOrderType order);
// Return the number of sections as specified by the ELF header.
......@@ -537,8 +537,9 @@ private:
};
template <class Types>
cmELFInternalImpl<Types>::cmELFInternalImpl(
cmELF* external, cmsys::auto_ptr<cmsys::ifstream>& fin, ByteOrderType order)
cmELFInternalImpl<Types>::cmELFInternalImpl(cmELF* external,
CM_AUTO_PTR<cmsys::ifstream>& fin,
ByteOrderType order)
: cmELFInternal(external, fin, order)
{
// Read the main header.
......@@ -755,7 +756,7 @@ cmELF::cmELF(const char* fname)
: Internal(CM_NULLPTR)
{
// Try to open the file.
cmsys::auto_ptr<cmsys::ifstream> fin(new cmsys::ifstream(fname));
CM_AUTO_PTR<cmsys::ifstream> fin(new cmsys::ifstream(fname));
// Quit now if the file could not be opened.
if (!fin.get() || !*fin) {
......
......@@ -25,8 +25,8 @@
#include "cmVersion.h"
#include <assert.h>
#include <cm_auto_ptr.hxx>
#include <cmsys/FStream.hxx>
#include <cmsys/auto_ptr.hxx>
static std::string cmExportFileGeneratorEscape(std::string const& str)
{
......@@ -69,15 +69,15 @@ const char* cmExportFileGenerator::GetMainExportFileName() const
bool cmExportFileGenerator::GenerateImportFile()
{
// Open the output file to generate it.
cmsys::auto_ptr<cmsys::ofstream> foutPtr;
CM_AUTO_PTR<cmsys::ofstream> foutPtr;
if (this->AppendMode) {
// Open for append.
cmsys::auto_ptr<cmsys::ofstream> ap(
CM_AUTO_PTR<cmsys::ofstream> ap(
new cmsys::ofstream(this->MainImportFile.c_str(), std::ios::app));
foutPtr = ap;
} else {
// Generate atomically and with copy-if-different.
cmsys::auto_ptr<cmGeneratedFileStream> ap(
CM_AUTO_PTR<cmGeneratedFileStream> ap(
new cmGeneratedFileStream(this->MainImportFile.c_str(), true));
ap->SetCopyIfDifferent(true);
foutPtr = ap;
......@@ -393,7 +393,7 @@ void cmExportFileGenerator::PopulateIncludeDirectoriesInterface(
std::string dirs = cmGeneratorExpression::Preprocess(
tei->InterfaceIncludeDirectories, preprocessRule, true);
this->ReplaceInstallPrefix(dirs);
cmsys::auto_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(dirs);
CM_AUTO_PTR<cmCompiledGeneratorExpression> cge = ge.Parse(dirs);
std::string exportDirs =
cge->Evaluate(target->GetLocalGenerator(), "", false, target);
......
......@@ -16,7 +16,7 @@
#include "cmVersion.h"
#include "cmake.h"
#include <cmsys/auto_ptr.hxx>
#include <cm_auto_ptr.hxx>
bool cmExportLibraryDependenciesCommand::InitialPass(
std::vector<std::string> const& args, cmExecutionStatus&)
......@@ -53,13 +53,13 @@ void cmExportLibraryDependenciesCommand::FinalPass()
void cmExportLibraryDependenciesCommand::ConstFinalPass() const
{
// Use copy-if-different if not appending.
cmsys::auto_ptr<cmsys::ofstream> foutPtr;
CM_AUTO_PTR<cmsys::ofstream> foutPtr;
if (this->Append) {
cmsys::auto_ptr<cmsys::ofstream> ap(
CM_AUTO_PTR<cmsys::ofstream> ap(
new cmsys::ofstream(this->Filename.c_str(), std::ios::app));
foutPtr = ap;
} else {
cmsys::auto_ptr<cmGeneratedFileStream> ap(
CM_AUTO_PTR<cmGeneratedFileStream> ap(
new cmGeneratedFileStream(this->Filename.c_str(), true));
ap->SetCopyIfDifferent(true);
foutPtr = ap;
......
......@@ -66,7 +66,7 @@ std::string cmExportTryCompileFileGenerator::FindTargets(
cmGeneratorExpressionDAGChecker dagChecker(tgt->GetName(), propName,
CM_NULLPTR, CM_NULLPTR);
cmsys::auto_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(prop);
CM_AUTO_PTR<cmCompiledGeneratorExpression> cge = ge.Parse(prop);
cmTarget dummyHead;
dummyHead.SetType(cmState::EXECUTABLE, "try_compile_dummy_exe");
......
......@@ -34,12 +34,12 @@
// include sys/stat.h after sys/types.h
#include <sys/stat.h>
#include <cm_auto_ptr.hxx>
#include <cmsys/Directory.hxx>
#include <cmsys/Encoding.hxx>
#include <cmsys/FStream.hxx>
#include <cmsys/Glob.hxx>
#include <cmsys/RegularExpression.hxx>
#include <cmsys/auto_ptr.hxx>
// Table of permissions flags.
#if defined(_WIN32) && !defined(__CYGWIN__)
......@@ -330,7 +330,7 @@ bool cmFileCommand::HandleHashCommand(std::vector<std::string> const& args)
return false;
}
cmsys::auto_ptr<cmCryptoHash> hash(cmCryptoHash::New(args[0].c_str()));
CM_AUTO_PTR<cmCryptoHash> hash(cmCryptoHash::New(args[0].c_str()));
if (hash.get()) {
std::string out = hash->HashFile(args[1]);
if (!out.empty()) {
......@@ -2478,7 +2478,7 @@ bool cmFileCommand::HandleDownloadCommand(std::vector<std::string> const& args)
const char* cainfo = this->Makefile->GetDefinition("CMAKE_TLS_CAINFO");
std::string expectedHash;
std::string hashMatchMSG;
cmsys::auto_ptr<cmCryptoHash> hash;
CM_AUTO_PTR<cmCryptoHash> hash;
bool showProgress = false;
while (i != args.end()) {
......@@ -2534,7 +2534,7 @@ bool cmFileCommand::HandleDownloadCommand(std::vector<std::string> const& args)
this->SetError("DOWNLOAD missing sum value for EXPECTED_MD5.");
return false;
}
hash = cmsys::auto_ptr<cmCryptoHash>(cmCryptoHash::New("MD5"));
hash = CM_AUTO_PTR<cmCryptoHash>(cmCryptoHash::New("MD5"));
hashMatchMSG = "MD5 sum";
expectedHash = cmSystemTools::LowerCase(*i);
} else if (*i == "SHOW_PROGRESS") {
......@@ -2555,7 +2555,7 @@ bool cmFileCommand::HandleDownloadCommand(std::vector<std::string> const& args)
}
std::string algo = i->substr(0, pos);
expectedHash = cmSystemTools::LowerCase(i->substr(pos + 1));
hash = cmsys::auto_ptr<cmCryptoHash>(cmCryptoHash::New(algo.c_str()));
hash = CM_AUTO_PTR<cmCryptoHash>(cmCryptoHash::New(algo.c_str()));
if (!hash.get()) {
std::string err = "DOWNLOAD EXPECTED_HASH given unknown ALGO: ";
err += algo;
......@@ -2971,11 +2971,11 @@ void cmFileCommand::AddEvaluationFile(const std::string& inputName,
cmListFileBacktrace lfbt = this->Makefile->GetBacktrace();
cmGeneratorExpression outputGe(lfbt);
cmsys::auto_ptr<cmCompiledGeneratorExpression> outputCge =
CM_AUTO_PTR<cmCompiledGeneratorExpression> outputCge =
outputGe.Parse(outputExpr);
cmGeneratorExpression conditionGe(lfbt);
cmsys::auto_ptr<cmCompiledGeneratorExpression> conditionCge =
CM_AUTO_PTR<cmCompiledGeneratorExpression> conditionCge =
conditionGe.Parse(condition);
this->Makefile->AddEvaluationFile(inputName, outputCge, conditionCge,
......
......@@ -1500,9 +1500,9 @@ void cmFindPackageCommand::StoreVersionFound()
this->Makefile->AddDefinition(ver + "_COUNT", buf);
}
#include <cm_auto_ptr.hxx>
#include <cmsys/Glob.hxx>
#include <cmsys/String.h>
#include <cmsys/auto_ptr.hxx>
class cmFileList;
class cmFileListGeneratorBase
......@@ -1515,10 +1515,10 @@ protected:
private:
bool Search(cmFileList&);
virtual bool Search(std::string const& parent, cmFileList&) = 0;
virtual cmsys::auto_ptr<cmFileListGeneratorBase> Clone() const = 0;
virtual CM_AUTO_PTR<cmFileListGeneratorBase> Clone() const = 0;
friend class cmFileList;
cmFileListGeneratorBase* SetNext(cmFileListGeneratorBase const& next);
cmsys::auto_ptr<cmFileListGeneratorBase> Next;
CM_AUTO_PTR<cmFileListGeneratorBase> Next;
};
class cmFileList
......@@ -1551,7 +1551,7 @@ public:
private:
virtual bool Visit(std::string const& fullPath) = 0;
friend class cmFileListGeneratorBase;
cmsys::auto_ptr<cmFileListGeneratorBase> First;
CM_AUTO_PTR<cmFileListGeneratorBase> First;
cmFileListGeneratorBase* Last;
};
......@@ -1621,9 +1621,9 @@ private:
std::string fullPath = parent + this->String;
return this->Consider(fullPath, lister);
}
cmsys::auto_ptr<cmFileListGeneratorBase> Clone() const CM_OVERRIDE
CM_AUTO_PTR<cmFileListGeneratorBase> Clone() const CM_OVERRIDE
{
cmsys::auto_ptr<cmFileListGeneratorBase> g(
CM_AUTO_PTR<cmFileListGeneratorBase> g(
new cmFileListGeneratorFixed(*this));
return g;
}
......@@ -1655,9 +1655,9 @@ private:
}
return false;
}
cmsys::auto_ptr<cmFileListGeneratorBase> Clone() const CM_OVERRIDE
CM_AUTO_PTR<cmFileListGeneratorBase> Clone() const CM_OVERRIDE
{
cmsys::auto_ptr<cmFileListGeneratorBase> g(
CM_AUTO_PTR<cmFileListGeneratorBase> g(
new cmFileListGeneratorEnumerate(*this));
return g;
}
......@@ -1706,9 +1706,9 @@ private:
}
return false;
}
cmsys::auto_ptr<cmFileListGeneratorBase> Clone() const CM_OVERRIDE
CM_AUTO_PTR<cmFileListGeneratorBase> Clone() const CM_OVERRIDE
{
cmsys::auto_ptr<cmFileListGeneratorBase> g(
CM_AUTO_PTR<cmFileListGeneratorBase> g(
new cmFileListGeneratorProject(*this));
return g;
}
......@@ -1763,9 +1763,9 @@ private:
}
return false;
}
cmsys::auto_ptr<cmFileListGeneratorBase> Clone() const CM_OVERRIDE
CM_AUTO_PTR<cmFileListGeneratorBase> Clone() const CM_OVERRIDE
{
cmsys::auto_ptr<cmFileListGeneratorBase> g(
CM_AUTO_PTR<cmFileListGeneratorBase> g(
new cmFileListGeneratorMacProject(*this));
return g;
}
......@@ -1807,9 +1807,9 @@ private:
}
return false;
}
cmsys::auto_ptr<cmFileListGeneratorBase> Clone() const CM_OVERRIDE
CM_AUTO_PTR<cmFileListGeneratorBase> Clone() const CM_OVERRIDE
{
cmsys::auto_ptr<cmFileListGeneratorBase> g(
CM_AUTO_PTR<cmFileListGeneratorBase> g(
new cmFileListGeneratorCaseInsensitive(*this));
return g;
}
......@@ -1853,10 +1853,9 @@ private:
}
return false;
}
cmsys::auto_ptr<cmFileListGeneratorBase> Clone() const CM_OVERRIDE
CM_AUTO_PTR<cmFileListGeneratorBase> Clone() const CM_OVERRIDE
{
cmsys::auto_ptr<cmFileListGeneratorBase> g(
new cmFileListGeneratorGlob(*this));
CM_AUTO_PTR<cmFileListGeneratorBase> g(new cmFileListGeneratorGlob(*this));
return g;
}
};
......
......@@ -11,7 +11,7 @@
============================================================================*/
#include "cmForEachCommand.h"
#include <cmsys/auto_ptr.hxx>
#include <cm_auto_ptr.hxx>
cmForEachFunctionBlocker::cmForEachFunctionBlocker(cmMakefile* mf)
: Makefile(mf)
......@@ -36,8 +36,7 @@ bool cmForEachFunctionBlocker::IsFunctionBlocked(const cmListFileFunction& lff,
// if this is the endofreach for this statement
if (!this->Depth) {
// Remove the function blocker for this scope or bail.
cmsys::auto_ptr<cmFunctionBlocker> fb(
mf.RemoveFunctionBlocker(this, lff));
CM_AUTO_PTR<cmFunctionBlocker> fb(mf.RemoveFunctionBlocker(this, lff));
if (!fb.get()) {
return false;
}
......@@ -184,7 +183,7 @@ bool cmForEachCommand::InitialPass(std::vector<std::string> const& args,
bool cmForEachCommand::HandleInMode(std::vector<std::string> const& args)
{
cmsys::auto_ptr<cmForEachFunctionBlocker> f(
CM_AUTO_PTR<cmForEachFunctionBlocker> f(
new cmForEachFunctionBlocker(this->Makefile));
f->Args.push_back(args[0]);
......
......@@ -26,14 +26,14 @@ cmGeneratorExpression::cmGeneratorExpression(
{
}
cmsys::auto_ptr<cmCompiledGeneratorExpression> cmGeneratorExpression::Parse(
CM_AUTO_PTR<cmCompiledGeneratorExpression> cmGeneratorExpression::Parse(
std::string const& input)
{
return cmsys::auto_ptr<cmCompiledGeneratorExpression>(
return CM_AUTO_PTR<cmCompiledGeneratorExpression>(
new cmCompiledGeneratorExpression(this->Backtrace, input));
}
cmsys::auto_ptr<cmCompiledGeneratorExpression> cmGeneratorExpression::Parse(
CM_AUTO_PTR<cmCompiledGeneratorExpression> cmGeneratorExpression::Parse(
const char* input)
{
return this->Parse(std::string(input ? input : ""));
......
......@@ -17,8 +17,8 @@
#include "cmListFileCache.h"
#include <cm_auto_ptr.hxx>
#include <cmsys/RegularExpression.hxx>
#include <cmsys/auto_ptr.hxx>
class cmGeneratorTarget;
class cmLocalGenerator;
......@@ -47,9 +47,8 @@ public:
cmListFileBacktrace const& backtrace = cmListFileBacktrace());
~cmGeneratorExpression();
cmsys::auto_ptr<cmCompiledGeneratorExpression> Parse(
std::string const& input);
cmsys::auto_ptr<cmCompiledGeneratorExpression> Parse(const char* input);
CM_AUTO_PTR<cmCompiledGeneratorExpression> Parse(std::string const& input);
CM_AUTO_PTR<cmCompiledGeneratorExpression> Parse(const char* input);
enum PreprocessContext
{
......
......@@ -23,9 +23,8 @@
cmGeneratorExpressionEvaluationFile::cmGeneratorExpressionEvaluationFile(
const std::string& input,
cmsys::auto_ptr<cmCompiledGeneratorExpression> outputFileExpr,
cmsys::auto_ptr<cmCompiledGeneratorExpression> condition,
bool inputIsContent)
CM_AUTO_PTR<cmCompiledGeneratorExpression> outputFileExpr,
CM_AUTO_PTR<cmCompiledGeneratorExpression> condition, bool inputIsContent)
: Input(input)
, OutputFileExpr(outputFileExpr)
, Condition(condition)
......@@ -135,7 +134,7 @@ void cmGeneratorExpressionEvaluationFile::Generate(cmLocalGenerator* lg)
cmListFileBacktrace lfbt = this->OutputFileExpr->GetBacktrace();
cmGeneratorExpression contentGE(lfbt);
cmsys::auto_ptr<cmCompiledGeneratorExpression> inputExpression =
CM_AUTO_PTR<cmCompiledGeneratorExpression> inputExpression =
contentGE.Parse(inputContent);
std::map<std::string, std::string> outputFiles;
......
......@@ -14,7 +14,7 @@
#include "cmGeneratorExpression.h"
#include <cmsys/auto_ptr.hxx>
#include <cm_auto_ptr.hxx>
#include <sys/types.h>
class cmLocalGenerator;
......@@ -24,9 +24,8 @@ class cmGeneratorExpressionEvaluationFile
public:
cmGeneratorExpressionEvaluationFile(
const std::string& input,
cmsys::auto_ptr<cmCompiledGeneratorExpression> outputFileExpr,
cmsys::auto_ptr<cmCompiledGeneratorExpression> condition,
bool inputIsContent);
CM_AUTO_PTR<cmCompiledGeneratorExpression> outputFileExpr,
CM_AUTO_PTR<cmCompiledGeneratorExpression> condition, bool inputIsContent);
void Generate(cmLocalGenerator* lg);
......@@ -42,8 +41,8 @@ private:
private:
const std::string Input;
const cmsys::auto_ptr<cmCompiledGeneratorExpression> OutputFileExpr;
const cmsys::auto_ptr<cmCompiledGeneratorExpression> Condition;
const CM_AUTO_PTR<cmCompiledGeneratorExpression> OutputFileExpr;
const CM_AUTO_PTR<cmCompiledGeneratorExpression> Condition;
std::vector<std::string> Files;
const bool InputIsContent;
};
......
......@@ -24,7 +24,7 @@ std::string cmGeneratorExpressionNode::EvaluateDependentExpression(
cmGeneratorExpressionDAGChecker* dagChecker)
{
cmGeneratorExpression ge(context->Backtrace);
cmsys::auto_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(prop);
CM_AUTO_PTR<cmCompiledGeneratorExpression> cge = ge.Parse(prop);
cge->SetEvaluateForBuildsystem(context->EvaluateForBuildsystem);
std::string result =
cge->Evaluate(lg, context->Config, context->Quiet, headTarget,
......
......@@ -42,13 +42,13 @@ class cmGeneratorTarget::TargetPropertyEntry
static cmLinkImplItem NoLinkImplItem;
public:
TargetPropertyEntry(cmsys::auto_ptr<cmCompiledGeneratorExpression> cge,
TargetPropertyEntry(CM_AUTO_PTR<cmCompiledGeneratorExpression> cge,
cmLinkImplItem const& item = NoLinkImplItem)
: ge(cge)
, LinkImplItem(item)
{
}
const cmsys::auto_ptr<cmCompiledGeneratorExpression> ge;
const CM_AUTO_PTR<cmCompiledGeneratorExpression> ge;
cmLinkImplItem const& LinkImplItem;
};
cmLinkImplItem cmGeneratorTarget::TargetPropertyEntry::NoLinkImplItem;
......@@ -253,7 +253,7 @@ void CreatePropertyGeneratorExpressions(
for (std::vector<std::string>::const_iterator it = entries.begin();
it != entries.end(); ++it, ++btIt) {
cmGeneratorExpression ge(*btIt);
cmsys::auto_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(*it);
CM_AUTO_PTR<cmCompiledGeneratorExpression> cge = ge.Parse(*it);
cge->SetEvaluateForBuildsystem(evaluateForBuildsystem);
items.push_back(new cmGeneratorTarget::TargetPropertyEntry(cge));
}
......@@ -443,7 +443,7 @@ std::string cmGeneratorTarget::GetOutputName(const std::string& config,
// Now evaluate genex and update the previously-prepared map entry.
cmGeneratorExpression ge;
cmsys::auto_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(outName);
CM_AUTO_PTR<cmCompiledGeneratorExpression> cge = ge.Parse(outName);
i->second = cge->Evaluate(this->LocalGenerator, config);
} else if (i->second.empty()) {
// An empty map entry indicates we have been called recursively
......@@ -461,7 +461,7 @@ void cmGeneratorTarget::AddSource(const std::string& src)
this->Target->AddSource(src);
cmListFileBacktrace lfbt = this->Makefile->GetBacktrace();
cmGeneratorExpression ge(lfbt);
cmsys::auto_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(src);
CM_AUTO_PTR<cmCompiledGeneratorExpression> cge = ge.Parse(src);
cge->SetEvaluateForBuildsystem(true);
this->SourceEntries.push_back(new TargetPropertyEntry(cge));
this->SourceFilesMap.clear();
......@@ -477,7 +477,7 @@ void cmGeneratorTarget::AddTracedSources(std::vector<std::string> const& srcs)
this->LinkImplementationLanguageIsContextDependent = true;
cmListFileBacktrace lfbt = this->Makefile->GetBacktrace();
cmGeneratorExpression ge(lfbt);
cmsys::auto_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(srcFiles);
CM_AUTO_PTR<cmCompiledGeneratorExpression> cge = ge.Parse(srcFiles);
cge->SetEvaluateForBuildsystem(true);
this->SourceEntries.push_back(
new cmGeneratorTarget::TargetPropertyEntry(cge));
......@@ -862,7 +862,7 @@ static void AddInterfaceEntries(
if (it->Target) {
std::string genex = "$<TARGET_PROPERTY:" + *it + "," + prop + ">";
cmGeneratorExpression ge(it->Backtrace);
cmsys::auto_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(genex);
CM_AUTO_PTR<cmCompiledGeneratorExpression> cge = ge.Parse(genex);
cge->SetEvaluateForBuildsystem(true);
entries.push_back(
new cmGeneratorTarget::TargetPropertyEntry(cge, *it));
......@@ -2119,8 +2119,7 @@ void cmTargetTraceDependencies::CheckCustomCommand(cmCustomCommand const& cc)