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/cmFindPackageCommand.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/cmFindPackageCommand.cxx')
-rw-r--r-- | Source/cmFindPackageCommand.cxx | 33 |
1 files changed, 16 insertions, 17 deletions
diff --git a/Source/cmFindPackageCommand.cxx b/Source/cmFindPackageCommand.cxx index 09fa795..d5fd75d 100644 --- a/Source/cmFindPackageCommand.cxx +++ b/Source/cmFindPackageCommand.cxx @@ -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; } }; |