diff --git a/CMakeLists.txt b/CMakeLists.txt index 1f29e463..e56978f5 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -11,6 +11,11 @@ else() endif() OPTION(ENABLE_STATIC_RUNTIME "Visual Studio, link with runtime statically" OFF) +option(ENABLE_CXX11 "Enable C++11 features" OFF) +if(ENABLE_CXX11) + add_definitions(-DTAGLIB_USE_CXX11) +endif() + option(VISIBILITY_HIDDEN "Build with -fvisibility=hidden" OFF) if(VISIBILITY_HIDDEN) add_definitions (-fvisibility=hidden) diff --git a/taglib/asf/asfattribute.h b/taglib/asf/asfattribute.h index 28f945aa..a77e05ca 100644 --- a/taglib/asf/asfattribute.h +++ b/taglib/asf/asfattribute.h @@ -119,6 +119,8 @@ namespace TagLib /*! * Moves the contents of \a other into this item. + * + * \note Not available unless TAGLIB_USE_CXX11 macro is defined. */ ASF::Attribute &operator=(Attribute &&other); diff --git a/taglib/asf/asfpicture.h b/taglib/asf/asfpicture.h index 1703c71f..a3250a11 100644 --- a/taglib/asf/asfpicture.h +++ b/taglib/asf/asfpicture.h @@ -111,6 +111,8 @@ namespace TagLib /*! * Constructs an picture equivalent to \a other. + * + * \note Not available unless TAGLIB_USE_CXX11 macro is defined. */ Picture(Picture &&other); @@ -130,7 +132,9 @@ namespace TagLib /*! * Moves the contents of \a other into this picture. - */ + * + * \note Not available unless TAGLIB_USE_CXX11 macro is defined. + */ Picture& operator=(Picture &&other); #endif diff --git a/taglib/fileref.h b/taglib/fileref.h index 1bcd1039..bb11178b 100644 --- a/taglib/fileref.h +++ b/taglib/fileref.h @@ -143,6 +143,8 @@ namespace TagLib { /*! * Move \a ref into the FileRef. + * + * \note Not available unless TAGLIB_USE_CXX11 macro is defined. */ FileRef(FileRef &&ref); @@ -239,7 +241,9 @@ namespace TagLib { #ifdef TAGLIB_USE_CXX11 /*! - * Assign the file pointed to by \a ref to this FileRef. + * Moves \a ref into this FileRef. + * + * \note Not available unless TAGLIB_USE_CXX11 macro is defined. */ FileRef &operator=(FileRef &&ref); diff --git a/taglib/mpeg/mpegheader.h b/taglib/mpeg/mpegheader.h index e601ded5..00a708e7 100644 --- a/taglib/mpeg/mpegheader.h +++ b/taglib/mpeg/mpegheader.h @@ -59,8 +59,10 @@ namespace TagLib { #ifdef TAGLIB_USE_CXX11 /*! - * Moves \a h into the \e Header. - */ + * Moves \a h into this Header. + * + * \note Not available unless TAGLIB_USE_CXX11 macro is defined. + */ Header(Header &&h); #endif @@ -166,7 +168,9 @@ namespace TagLib { #ifdef TAGLIB_USE_CXX11 /*! - * Moves \a h into the \e Header. + * Moves \a h into this Header. + * + * \note Not available unless TAGLIB_USE_CXX11 macro is defined. */ Header &operator=(Header &&h); diff --git a/taglib/toolkit/taglib.h b/taglib/toolkit/taglib.h index b87d6506..9bc81655 100755 --- a/taglib/toolkit/taglib.h +++ b/taglib/toolkit/taglib.h @@ -52,22 +52,9 @@ #endif -// Determines if std::shared_ptr and rvalue reference are available. +// TAGLIB_USE_CXX11 determines whether or not to enable C++11 features. // Replaces RefCounter capability with std::shared_ptr if available. -#ifndef __has_feature -# define __has_feature(x) 0 -#endif - -#ifndef TAGLIB_USE_CXX11 -# if (defined(_MSC_VER) && _MSC_VER >= 1600) \ - || (defined(__clang__) && __has_feature(cxx_rvalue_references)) \ - || (defined(__GNUC__) && defined(__GXX_EXPERIMENTAL_CXX0X__)) - -# define TAGLIB_USE_CXX11 -# endif -#endif - #ifdef TAGLIB_USE_CXX11 # include #endif diff --git a/taglib/toolkit/tbytevector.h b/taglib/toolkit/tbytevector.h index d2f3d5af..5c6a0fa9 100644 --- a/taglib/toolkit/tbytevector.h +++ b/taglib/toolkit/tbytevector.h @@ -70,6 +70,8 @@ namespace TagLib { /*! * Constructs a byte vector equivalent to \a v. + * + * \note Not available unless TAGLIB_USE_CXX11 macro is defined. */ ByteVector(ByteVector &&v); @@ -392,7 +394,9 @@ namespace TagLib { #ifdef TAGLIB_USE_CXX11 /*! - * Moves \a v into the ByteVector. + * Moves \a v into this ByteVector. + * + * \note Not available unless TAGLIB_USE_CXX11 macro is defined. */ ByteVector &operator=(ByteVector &&v); diff --git a/taglib/toolkit/tbytevectorlist.h b/taglib/toolkit/tbytevectorlist.h index 22e558b4..3aa87a43 100644 --- a/taglib/toolkit/tbytevectorlist.h +++ b/taglib/toolkit/tbytevectorlist.h @@ -57,7 +57,9 @@ namespace TagLib { #ifdef TAGLIB_USE_CXX11 /*! - * Moves \a l into the StringList. + * Moves \a l into this ByteVectorList. + * + * \note Not available unless TAGLIB_USE_CXX11 macro is defined. */ ByteVectorList(ByteVectorList &&l); @@ -73,7 +75,9 @@ namespace TagLib { #ifdef TAGLIB_USE_CXX11 /*! - * Moves \a l into the \e ByteVectorList. + * Moves \a l into this ByteVectorList. + * + * \note Not available unless TAGLIB_USE_CXX11 macro is defined. */ ByteVectorList &operator=(ByteVectorList &&l); diff --git a/taglib/toolkit/tlist.h b/taglib/toolkit/tlist.h index feffc954..b1067f23 100644 --- a/taglib/toolkit/tlist.h +++ b/taglib/toolkit/tlist.h @@ -73,7 +73,9 @@ namespace TagLib { #ifdef TAGLIB_USE_CXX11 /*! - * Moves \a l into the \e List. + * Moves \a l into this List. + * + * \note Not available unless TAGLIB_USE_CXX11 macro is defined. */ List(List &&l); @@ -138,12 +140,16 @@ namespace TagLib { /*! * Appends \a item to the end of the list and returns a reference to the * list. + * + * \note Not available unless TAGLIB_USE_CXX11 macro is defined. */ List &append(T &&item); /*! * Appends all of the values in \a l to the end of the list and returns a * reference to the list. + * + * \note Not available unless TAGLIB_USE_CXX11 macro is defined. */ List &append(List &&l); @@ -166,12 +172,16 @@ namespace TagLib { /*! * Prepends \a item to the beginning list and returns a reference to the * list. + * + * \note Not available unless TAGLIB_USE_CXX11 macro is defined. */ List &prepend(T &&item); /*! * Prepends all of the items in \a l to the beginning list and returns a * reference to the list. + * + * \note Not available unless TAGLIB_USE_CXX11 macro is defined. */ List &prepend(List &&l); @@ -265,7 +275,9 @@ namespace TagLib { #ifdef TAGLIB_USE_CXX11 /*! - * Moves \a l into the \e List. + * Moves \a l into this List. + * + * \note Not available unless TAGLIB_USE_CXX11 macro is defined. */ List &operator=(List &&l); diff --git a/taglib/toolkit/tmap.h b/taglib/toolkit/tmap.h index 457d2c7d..3f0bfc0b 100644 --- a/taglib/toolkit/tmap.h +++ b/taglib/toolkit/tmap.h @@ -76,7 +76,9 @@ namespace TagLib { #ifdef TAGLIB_USE_CXX11 /*! - * Moves \a m into the Map. + * Moves \a m into this Map. + * + * \note Not available unless TAGLIB_USE_CXX11 macro is defined. */ Map(Map &&m); @@ -122,6 +124,8 @@ namespace TagLib { /*! * Inserts \a value under \a key in the map. If a value for \a key already * exists it will be overwritten. + * + * \note Not available unless TAGLIB_USE_CXX11 macro is defined. */ Map &insert(const Key &key, T &&value); @@ -196,7 +200,9 @@ namespace TagLib { #ifdef TAGLIB_USE_CXX11 /*! - * Moves \a m into the Map. + * Moves \a m into this Map. + * + * \note Not available unless TAGLIB_USE_CXX11 macro is defined. */ Map &operator=(Map &&m); diff --git a/taglib/toolkit/tstring.h b/taglib/toolkit/tstring.h index 4512ec72..2ebec75f 100644 --- a/taglib/toolkit/tstring.h +++ b/taglib/toolkit/tstring.h @@ -126,7 +126,9 @@ namespace TagLib { #ifdef TAGLIB_USE_CXX11 /*! - * Moves \a s into the \e String. + * Constructs a String equivalent to \a s. + * + * \note Not available unless TAGLIB_USE_CXX11 macro is defined. */ String(String &&s); @@ -408,7 +410,9 @@ namespace TagLib { #ifdef TAGLIB_USE_CXX11 /*! - * Moves \a s into the \e String. + * Moves \a s into this String. + * + * \note Not available unless TAGLIB_USE_CXX11 macro is defined. */ String &operator=(String &&s); @@ -427,7 +431,9 @@ namespace TagLib { #ifdef TAGLIB_USE_CXX11 /*! - * Moves \a s into the \e String. + * Moves \a s into this String. + * + * \note Not available unless TAGLIB_USE_CXX11 macro is defined. */ String &operator=(wstring &&s); diff --git a/taglib/toolkit/tstringlist.h b/taglib/toolkit/tstringlist.h index babefa17..3659efec 100644 --- a/taglib/toolkit/tstringlist.h +++ b/taglib/toolkit/tstringlist.h @@ -61,7 +61,9 @@ namespace TagLib { #ifdef TAGLIB_USE_CXX11 /*! - * Moves \a l into the StringList. + * Constructs a StringList equivalent to \a l. + * + * \note Not available unless TAGLIB_USE_CXX11 macro is defined. */ StringList(StringList &&l); @@ -102,12 +104,16 @@ namespace TagLib { /*! * Appends \a s to the end of the list and returns a reference to the * list. + * + * \note Not available unless TAGLIB_USE_CXX11 macro is defined. */ StringList &append(String &&s); /*! * Appends all of the values in \a l to the end of the list and returns a * reference to the list. + * + * \note Not available unless TAGLIB_USE_CXX11 macro is defined. */ StringList &append(StringList &&l); @@ -123,7 +129,9 @@ namespace TagLib { #ifdef TAGLIB_USE_CXX11 /*! - * Moves \a l into the \e StringList. + * Moves \a l into this StringList. + * + * \note Not available unless TAGLIB_USE_CXX11 macro is defined. */ StringList &operator=(StringList &&l);