Bläddra i källkod

Enable editor for 32bit platform

nordsoft 3 år sedan
förälder
incheckning
36b87689f9
2 ändrade filer med 6 tillägg och 4 borttagningar
  1. 1 1
      .github/workflows/github.yml
  2. 5 3
      mapeditor/StdInc.h

+ 1 - 1
.github/workflows/github.yml

@@ -103,7 +103,7 @@ jobs:
             pack: 1
             cpack_args: -D CPACK_NSIS_EXECUTABLE=`which makensis`
             extension: exe
-            cmake_args: -G Ninja -DENABLE_EDITOR=0
+            cmake_args: -G Ninja
           - platform: msvc
             os: windows-latest
             test: 0

+ 5 - 3
mapeditor/StdInc.h

@@ -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);
 }