summaryrefslogtreecommitdiffstats
path: root/Source/cmELF.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2016-06-28 14:17:52 (GMT)
committerBrad King <brad.king@kitware.com>2016-06-29 13:47:58 (GMT)
commitb5ec5b0901177ebcd116d6ddd66ed114549014ec (patch)
treee1f24c8e619966137f4f8e09d4590b72c6a3c078 /Source/cmELF.cxx
parent8d79375818efbaa06858a8e2d176ab8a251bef63 (diff)
downloadCMake-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/cmELF.cxx')
-rw-r--r--Source/cmELF.cxx13
1 files changed, 7 insertions, 6 deletions
diff --git a/Source/cmELF.cxx b/Source/cmELF.cxx
index 59667cd..15755cb 100644
--- a/Source/cmELF.cxx
+++ b/Source/cmELF.cxx
@@ -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) {