diff --git a/UnleashedRecomp/CMakeLists.txt b/UnleashedRecomp/CMakeLists.txt index 14ae843..d3fd5a9 100644 --- a/UnleashedRecomp/CMakeLists.txt +++ b/UnleashedRecomp/CMakeLists.txt @@ -12,6 +12,7 @@ add_compile_options( -Wno-unused-but-set-variable -Wno-void-pointer-to-int-cast -Wno-int-to-void-pointer-cast + -Wno-invalid-offsetof ) add_compile_definitions( diff --git a/UnleashedRecomp/api/SWA.h b/UnleashedRecomp/api/SWA.h index 00939ff..bf18f4b 100644 --- a/UnleashedRecomp/api/SWA.h +++ b/UnleashedRecomp/api/SWA.h @@ -15,7 +15,6 @@ #include "CSD/Manager/csdmSceneObserver.h" #include "CSD/Manager/csdmSubjectBase.h" #include "CSD/Platform/csdTexList.h" -#include "Hedgehog/Base/Container/hhVector.h" #include "Hedgehog/Base/System/hhAllocator.h" #include "Hedgehog/Base/Thread/hhHolder.h" #include "Hedgehog/Base/Thread/hhHolderBase.h" diff --git a/UnleashedRecomp/api/SWA.inl b/UnleashedRecomp/api/SWA.inl index 22f1117..d6ef4c5 100644 --- a/UnleashedRecomp/api/SWA.inl +++ b/UnleashedRecomp/api/SWA.inl @@ -11,26 +11,12 @@ uint8_t SWA_CONCAT(pad, __LINE__)[length] #define SWA_ASSERT_OFFSETOF(type, field, offset) \ - static inline swa_assert_offsetof SWA_CONCAT(_, __COUNTER__) + static_assert(offsetof(type, field) == offset) #define SWA_ASSERT_SIZEOF(type, size) \ - static inline swa_assert_sizeof SWA_CONCAT(_, __COUNTER__) + static_assert(sizeof(type) == size) #define SWA_VIRTUAL_FUNCTION(returnType, virtualIndex, ...) \ GuestToHostFunction(*(be*)(g_memory.Translate(*(be*)(this) + (4 * virtualIndex))), __VA_ARGS__) -struct swa_null_ctor -{ -}; - -template -struct swa_assert_offsetof -{ - static_assert(TActual == TExpected, "offsetof assertion failed"); -}; - -template -struct swa_assert_sizeof -{ - static_assert(TActual == TExpected, "sizeof assertion failed"); -}; +struct swa_null_ctor {}; diff --git a/UnleashedRecomp/stdafx.h b/UnleashedRecomp/stdafx.h index 4eabefa..f23df68 100644 --- a/UnleashedRecomp/stdafx.h +++ b/UnleashedRecomp/stdafx.h @@ -27,6 +27,7 @@ #include #include #include +#include #include "framework.h" #include "mutex.h"