Fix primitive int types on 64-bit non-Windows targets

`long` is variable-sized on non-Windows targets, so don't use it.

Added some static_asserts to confirm this is the case.
This commit is contained in:
PJB3005
2026-02-24 15:23:52 +01:00
parent e5cfe0e6b4
commit e9b3df4d61
3 changed files with 17 additions and 0 deletions
+1
View File
@@ -1314,6 +1314,7 @@ set(REL_FILES
)
set(DUSK_FILES
src/dusk/asserts.cpp
src/dusk/imgui.cpp
src/dusk/stubs.cpp
src/dusk/extras.c
+5
View File
@@ -8,8 +8,13 @@ typedef signed char s8;
typedef unsigned char u8;
typedef signed short int s16;
typedef unsigned short int u16;
#if TARGET_PC
typedef signed int s32;
typedef unsigned int u32;
#else
typedef signed long s32;
typedef unsigned long u32;
#endif
typedef signed long long int s64;
typedef unsigned long long int u64;
+11
View File
@@ -0,0 +1,11 @@
#include <cstdint>
#include <dolphin/types.h>
static_assert(sizeof(u8) == sizeof(uint8_t));
static_assert(sizeof(s8) == sizeof(int8_t));
static_assert(sizeof(u16) == sizeof(uint16_t));
static_assert(sizeof(s16) == sizeof(int16_t));
static_assert(sizeof(u32) == sizeof(uint32_t));
static_assert(sizeof(s32) == sizeof(int32_t));
static_assert(sizeof(u64) == sizeof(uint64_t));
static_assert(sizeof(s64) == sizeof(int64_t));