From bb49005267088266433cf271630b457a0edaac8f Mon Sep 17 00:00:00 2001 From: Tsuda Kageyu Date: Fri, 20 Nov 2015 15:28:38 +0900 Subject: [PATCH] Fix a mismatch between the CMake check and the actual code. --- taglib/toolkit/tsmartptr.h | 64 +++++++++----------------------------- 1 file changed, 15 insertions(+), 49 deletions(-) diff --git a/taglib/toolkit/tsmartptr.h b/taglib/toolkit/tsmartptr.h index 5d61c73c..be00f89c 100644 --- a/taglib/toolkit/tsmartptr.h +++ b/taglib/toolkit/tsmartptr.h @@ -29,7 +29,7 @@ // This file is not a part of TagLib public interface. This is not installed. #ifdef HAVE_CONFIG_H -#include +# include #endif #ifndef DO_NOT_DOCUMENT // Tell Doxygen to skip this class. @@ -37,22 +37,20 @@ * \warning This is not part of the TagLib public API! */ -#if defined(HAVE_STD_SHARED_PTR) +#if defined(HAVE_STD_SMART_PTR) # include # define SHARED_PTR std::shared_ptr +# define SCOPED_PTR std::unique_ptr -#elif defined(HAVE_TR1_SHARED_PTR) - -# include -# define SHARED_PTR std::tr1::shared_ptr - -#elif defined(HAVE_BOOST_SHARED_PTR) +#elif defined(HAVE_BOOST_SMART_PTR) # include +# include # define SHARED_PTR boost::shared_ptr +# define SCOPED_PTR boost::scoped_ptr -#else // !HAVE_STD_SHARED_PTR && !HAVE_TR1_SHARED_PTR && !HAVE_BOOST_SHARED_PTR +#else // !HAVE_STD_SMART_PTR && !HAVE_BOOST_SMART_PTR # include # include @@ -68,13 +66,9 @@ namespace TagLib { public: CounterBase() : - RefCounter() - { - } + RefCounter() {} - virtual ~CounterBase() - { - } + virtual ~CounterBase() {} void addref() { @@ -104,9 +98,7 @@ namespace TagLib { public: CounterImpl(T *p) : - p(p) - { - } + p(p) {} virtual void dispose() { @@ -128,16 +120,12 @@ namespace TagLib public: RefCountPtr() : px(0), - counter(0) - { - } + counter(0) {} template explicit RefCountPtr(U *p) : px(p), - counter(new CounterImpl(p)) - { - } + counter(new CounterImpl(p)) {} RefCountPtr(const RefCountPtr &x) : px(x.px), @@ -255,28 +243,7 @@ namespace TagLib { a.swap(b); } -} -# define SHARED_PTR TagLib::RefCountPtr - -#endif // HAVE_STD_SHARED_PTR etc. - -#if defined(HAVE_STD_UNIQUE_PTR) - -# include -# define SCOPED_PTR std::unique_ptr - -#elif defined(HAVE_BOOST_SCOPED_PTR) - -# include -# define SCOPED_PTR boost::scoped_ptr - -#else // !HAVE_STD_UNIQUE_PTR && !HAVE_BOOST_SCOPED_PTR - -# include - -namespace TagLib -{ // Self-implements NonRefCountPtr if unique_ptr is not available. // I STRONGLY RECOMMEND using standard unique_ptr rather than this class. @@ -285,9 +252,7 @@ namespace TagLib { public: explicit NonRefCountPtr(T *p = 0) : - px(p) - { - } + px(p) {} ~NonRefCountPtr() { @@ -348,9 +313,10 @@ namespace TagLib } } +# define SHARED_PTR TagLib::RefCountPtr # define SCOPED_PTR TagLib::NonRefCountPtr -#endif // HAVE_STD_UNIQUE_PTR etc. +#endif // HAVE_STD_SMART_PTR etc. #endif // DO_NOT_DOCUMENT #endif