// Read the flags
- std::bitset<32> flags(static_cast<unsigned long>(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];
if(d->version >= 7) {
frames = d->data.mid(4, 4).toUInt(false);
- std::bitset<32> flags(static_cast<unsigned long>(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;
}
return;
}
- std::bitset<32> flags(static_cast<unsigned long>(data.toUInt()));
+ std::bitset<32> flags(TAGLIB_CONSTRUCT_BITSET(data.toUInt()));
// Check for the second byte's part of the MPEG synch
#define TAGLIB_IGNORE_MISSING_DESTRUCTOR
#endif
+#if (defined(_MSC_VER) && _MSC_VER >= 1600)
+#define TAGLIB_CONSTRUCT_BITSET(x) static_cast<unsigned long long>(x)
+#else
+#define TAGLIB_CONSTRUCT_BITSET(x) static_cast<unsigned long>(x)
+#endif
+
#include <string>
//! A namespace for all TagLib related classes and functions