mirror of
https://github.com/TwilitRealm/dusklight
synced 2026-06-22 06:56:31 -04:00
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:
@@ -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
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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));
|
||||
Reference in New Issue
Block a user