mirror of
https://github.com/vcmi/vcmi.git
synced 2025-02-03 13:01:33 +02:00
Enable editor for 32bit platform
This commit is contained in:
parent
29b2a81442
commit
36b87689f9
2
.github/workflows/github.yml
vendored
2
.github/workflows/github.yml
vendored
@ -103,7 +103,7 @@ jobs:
|
|||||||
pack: 1
|
pack: 1
|
||||||
cpack_args: -D CPACK_NSIS_EXECUTABLE=`which makensis`
|
cpack_args: -D CPACK_NSIS_EXECUTABLE=`which makensis`
|
||||||
extension: exe
|
extension: exe
|
||||||
cmake_args: -G Ninja -DENABLE_EDITOR=0
|
cmake_args: -G Ninja
|
||||||
- platform: msvc
|
- platform: msvc
|
||||||
os: windows-latest
|
os: windows-latest
|
||||||
test: 0
|
test: 0
|
||||||
|
@ -13,13 +13,15 @@
|
|||||||
#include <QString>
|
#include <QString>
|
||||||
#include <QFile>
|
#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>
|
template<class Type>
|
||||||
NumericPointer data_cast(Type * _pointer)
|
NumericPointer data_cast(Type * _pointer)
|
||||||
{
|
{
|
||||||
static_assert(sizeof(Type *) == sizeof(NumericPointer),
|
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);
|
return reinterpret_cast<NumericPointer>(_pointer);
|
||||||
}
|
}
|
||||||
@ -28,7 +30,7 @@ template<class Type>
|
|||||||
Type * data_cast(NumericPointer _numeric)
|
Type * data_cast(NumericPointer _numeric)
|
||||||
{
|
{
|
||||||
static_assert(sizeof(Type *) == sizeof(NumericPointer),
|
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);
|
return reinterpret_cast<Type *>(_numeric);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user