mirror of
https://github.com/hedge-dev/UnleashedRecomp.git
synced 2025-10-30 07:11:05 +00:00
Fix sizeof/offsetof assertions.
This commit is contained in:
parent
49b0dbe4db
commit
349f07cf77
4 changed files with 5 additions and 18 deletions
|
|
@ -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(
|
||||
|
|
|
|||
|
|
@ -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"
|
||||
|
|
|
|||
|
|
@ -11,26 +11,12 @@
|
|||
uint8_t SWA_CONCAT(pad, __LINE__)[length]
|
||||
|
||||
#define SWA_ASSERT_OFFSETOF(type, field, offset) \
|
||||
static inline swa_assert_offsetof<BB_OFFSETOF(type, field), offset> SWA_CONCAT(_, __COUNTER__)
|
||||
static_assert(offsetof(type, field) == offset)
|
||||
|
||||
#define SWA_ASSERT_SIZEOF(type, size) \
|
||||
static inline swa_assert_sizeof<sizeof type, size> SWA_CONCAT(_, __COUNTER__)
|
||||
static_assert(sizeof(type) == size)
|
||||
|
||||
#define SWA_VIRTUAL_FUNCTION(returnType, virtualIndex, ...) \
|
||||
GuestToHostFunction<returnType>(*(be<uint32_t>*)(g_memory.Translate(*(be<uint32_t>*)(this) + (4 * virtualIndex))), __VA_ARGS__)
|
||||
|
||||
struct swa_null_ctor
|
||||
{
|
||||
};
|
||||
|
||||
template<int TActual, int TExpected>
|
||||
struct swa_assert_offsetof
|
||||
{
|
||||
static_assert(TActual == TExpected, "offsetof assertion failed");
|
||||
};
|
||||
|
||||
template<int TActual, int TExpected>
|
||||
struct swa_assert_sizeof
|
||||
{
|
||||
static_assert(TActual == TExpected, "sizeof assertion failed");
|
||||
};
|
||||
struct swa_null_ctor {};
|
||||
|
|
|
|||
|
|
@ -27,6 +27,7 @@
|
|||
#include <imgui_internal.h>
|
||||
#include <imgui_impl_sdl2.h>
|
||||
#include <o1heap.h>
|
||||
#include <cstddef>
|
||||
|
||||
#include "framework.h"
|
||||
#include "mutex.h"
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue