|
@@ -13,13 +13,15 @@
|
|
|
#include <QString>
|
|
|
#include <QFile>
|
|
|
|
|
|
-using NumericPointer = unsigned long long;
|
|
|
+
|
|
|
+using NumericPointer = typename std::conditional<sizeof(void *) == sizeof(unsigned long long),
|
|
|
+ unsigned long long, unsigned int>::type;
|
|
|
|
|
|
template<class Type>
|
|
|
NumericPointer data_cast(Type * _pointer)
|
|
|
{
|
|
|
static_assert(sizeof(Type *) == sizeof(NumericPointer),
|
|
|
- "Compiled for 64 bit arcitecture. Use NumericPointer = unsigned int");
|
|
|
+ "Cannot compile for that architecture, see NumericPointer definition");
|
|
|
|
|
|
return reinterpret_cast<NumericPointer>(_pointer);
|
|
|
}
|
|
@@ -28,7 +30,7 @@ template<class Type>
|
|
|
Type * data_cast(NumericPointer _numeric)
|
|
|
{
|
|
|
static_assert(sizeof(Type *) == sizeof(NumericPointer),
|
|
|
- "Compiled for 64 bit arcitecture. Use NumericPointer = unsigned int");
|
|
|
+ "Cannot compile for that architecture, see NumericPointer definition");
|
|
|
|
|
|
return reinterpret_cast<Type *>(_numeric);
|
|
|
}
|