From ca567bee7913bb588cadd5b6f41a250e89b0389c Mon Sep 17 00:00:00 2001 From: Lior Halphon Date: Sat, 25 Apr 2020 22:54:50 +0300 Subject: [PATCH] Fix Linux build break --- Core/gb.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Core/gb.c b/Core/gb.c index f1eae90..701a48a 100644 --- a/Core/gb.c +++ b/Core/gb.c @@ -307,7 +307,11 @@ int GB_load_isx(GB_gameboy_t *gb, const char *path) #define READ(x) if (fread(&x, sizeof(x), 1, f) != 1) goto error fread(magic, 1, sizeof(magic), f); - bool extended = *(uint32_t *)&magic == htonl('ISX '); +#ifdef GB_BIG_ENDIAN + bool extended = *(uint32_t *)&magic == 'ISX '; +#else + bool extended = *(uint32_t *)&magic == __builtin_bswap32('ISX '); +#endif fseek(f, extended? 0x20 : 0, SEEK_SET);