diff options
author | Brad King <brad.king@kitware.com> | 2016-06-28 14:17:52 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2016-06-29 13:47:58 (GMT) |
commit | b5ec5b0901177ebcd116d6ddd66ed114549014ec (patch) | |
tree | e1f24c8e619966137f4f8e09d4590b72c6a3c078 /Source/cmMakefile.cxx | |
parent | 8d79375818efbaa06858a8e2d176ab8a251bef63 (diff) | |
download | CMake-b5ec5b0901177ebcd116d6ddd66ed114549014ec.zip CMake-b5ec5b0901177ebcd116d6ddd66ed114549014ec.tar.gz CMake-b5ec5b0901177ebcd116d6ddd66ed114549014ec.tar.bz2 |
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|'
Diffstat (limited to 'Source/cmMakefile.cxx')
-rw-r--r-- | Source/cmMakefile.cxx | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index eae4258..0d550dd 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -35,10 +35,10 @@ #include "cmake.h" #include <stdlib.h> // required for atoi +#include <cm_auto_ptr.hxx> #include <cmsys/FStream.hxx> #include <cmsys/RegularExpression.hxx> #include <cmsys/SystemTools.hxx> -#include <cmsys/auto_ptr.hxx> #include <assert.h> #include <ctype.h> // for isspace @@ -262,7 +262,7 @@ bool cmMakefile::ExecuteCommand(const cmListFileFunction& lff, // Lookup the command prototype. if (cmCommand* proto = this->GetState()->GetCommand(name)) { // Clone the prototype. - cmsys::auto_ptr<cmCommand> pcmd(proto->Clone()); + CM_AUTO_PTR<cmCommand> pcmd(proto->Clone()); pcmd->SetMakefile(this); // Decide whether to invoke the command. @@ -589,9 +589,8 @@ void cmMakefile::EnforceDirectoryLevelRules() const void cmMakefile::AddEvaluationFile( const std::string& inputFile, - cmsys::auto_ptr<cmCompiledGeneratorExpression> outputName, - cmsys::auto_ptr<cmCompiledGeneratorExpression> condition, - bool inputIsContent) + CM_AUTO_PTR<cmCompiledGeneratorExpression> outputName, + CM_AUTO_PTR<cmCompiledGeneratorExpression> condition, bool inputIsContent) { this->EvaluationFiles.push_back(new cmGeneratorExpressionEvaluationFile( inputFile, outputName, condition, inputIsContent)); @@ -2890,7 +2889,7 @@ void cmMakefile::PopFunctionBlockerBarrier(bool reportError) FunctionBlockersType::size_type barrier = this->FunctionBlockerBarriers.back(); while (this->FunctionBlockers.size() > barrier) { - cmsys::auto_ptr<cmFunctionBlocker> fb(this->FunctionBlockers.back()); + CM_AUTO_PTR<cmFunctionBlocker> fb(this->FunctionBlockers.back()); this->FunctionBlockers.pop_back(); if (reportError) { // Report the context in which the unclosed block was opened. @@ -3027,7 +3026,7 @@ void cmMakefile::AddFunctionBlocker(cmFunctionBlocker* fb) this->FunctionBlockers.push_back(fb); } -cmsys::auto_ptr<cmFunctionBlocker> cmMakefile::RemoveFunctionBlocker( +CM_AUTO_PTR<cmFunctionBlocker> cmMakefile::RemoveFunctionBlocker( cmFunctionBlocker* fb, const cmListFileFunction& lff) { // Find the function blocker stack barrier for the current scope. @@ -3060,11 +3059,11 @@ cmsys::auto_ptr<cmFunctionBlocker> cmMakefile::RemoveFunctionBlocker( } cmFunctionBlocker* b = *pos; this->FunctionBlockers.erase(pos); - return cmsys::auto_ptr<cmFunctionBlocker>(b); + return CM_AUTO_PTR<cmFunctionBlocker>(b); } } - return cmsys::auto_ptr<cmFunctionBlocker>(); + return CM_AUTO_PTR<cmFunctionBlocker>(); } const char* cmMakefile::GetHomeDirectory() const @@ -3692,7 +3691,7 @@ cmTarget* cmMakefile::AddImportedTarget(const std::string& name, cmState::TargetType type, bool global) { // Create the target. - cmsys::auto_ptr<cmTarget> target(new cmTarget); + CM_AUTO_PTR<cmTarget> target(new cmTarget); target->SetType(type, name); target->MarkAsImported(global); target->SetMakefile(this); |