diff --git a/taglib/ape/apefooter.cpp b/taglib/ape/apefooter.cpp index 6cef213b..0805e9e0 100644 --- a/taglib/ape/apefooter.cpp +++ b/taglib/ape/apefooter.cpp @@ -189,7 +189,7 @@ void Footer::parse(const ByteVector &data) // Read the flags - std::bitset<32> flags(static_cast(data.mid(20, 4).toUInt(false))); + std::bitset<32> flags(TAGLIB_CONSTRUCT_BITSET(data.mid(20, 4).toUInt(false))); d->headerPresent = flags[31]; d->footerPresent = !flags[30]; diff --git a/taglib/mpc/mpcproperties.cpp b/taglib/mpc/mpcproperties.cpp index b644053b..9adc6924 100644 --- a/taglib/mpc/mpcproperties.cpp +++ b/taglib/mpc/mpcproperties.cpp @@ -113,7 +113,7 @@ void MPC::Properties::read() if(d->version >= 7) { frames = d->data.mid(4, 4).toUInt(false); - std::bitset<32> flags(static_cast(d->data.mid(8, 4).toUInt(false))); + std::bitset<32> flags(TAGLIB_CONSTRUCT_BITSET(d->data.mid(8, 4).toUInt(false))); d->sampleRate = sftable[flags[17] * 2 + flags[16]]; d->channels = 2; } diff --git a/taglib/mpeg/mpegheader.cpp b/taglib/mpeg/mpegheader.cpp index ecd4fc84..c715dbc1 100644 --- a/taglib/mpeg/mpegheader.cpp +++ b/taglib/mpeg/mpegheader.cpp @@ -168,7 +168,7 @@ void MPEG::Header::parse(const ByteVector &data) return; } - std::bitset<32> flags(static_cast(data.toUInt())); + std::bitset<32> flags(TAGLIB_CONSTRUCT_BITSET(data.toUInt())); // Check for the second byte's part of the MPEG synch diff --git a/taglib/toolkit/taglib.h b/taglib/toolkit/taglib.h index 920f1b38..811d4584 100644 --- a/taglib/toolkit/taglib.h +++ b/taglib/toolkit/taglib.h @@ -36,6 +36,12 @@ #define TAGLIB_IGNORE_MISSING_DESTRUCTOR #endif +#if (defined(_MSC_VER) && _MSC_VER >= 1600) +#define TAGLIB_CONSTRUCT_BITSET(x) static_cast(x) +#else +#define TAGLIB_CONSTRUCT_BITSET(x) static_cast(x) +#endif + #include //! A namespace for all TagLib related classes and functions