diff --git a/include/mgba-util/common.h b/include/mgba-util/common.h index 13bb1979f..ff15e23e8 100644 --- a/include/mgba-util/common.h +++ b/include/mgba-util/common.h @@ -136,12 +136,13 @@ typedef intptr_t ssize_t; uint32_t lo; \ }; \ uint64_t b64; \ - } *bswap = (void*) &DEST; \ + } bswap; \ const void* _ptr = (ARR); \ __asm__( \ "lwbrx %0, %2, %3 \n" \ "lwbrx %1, %2, %4 \n" \ - : "=&r"(bswap->lo), "=&r"(bswap->hi) : "b"(_ptr), "r"(_addr), "r"(_addr + 4)) ; \ + : "=&r"(bswap.lo), "=&r"(bswap.hi) : "b"(_ptr), "r"(_addr), "r"(_addr + 4)) ; \ + DEST = bswap.b64; \ } #define STORE_64LE(SRC, ADDR, ARR) { \ @@ -152,12 +153,12 @@ typedef intptr_t ssize_t; uint32_t lo; \ }; \ uint64_t b64; \ - } *bswap = (void*) &SRC; \ + } bswap = { .b64 = SRC }; \ const void* _ptr = (ARR); \ __asm__( \ "stwbrx %0, %2, %3 \n" \ "stwbrx %1, %2, %4 \n" \ - : : "r"(bswap->hi), "r"(bswap->lo), "b"(_ptr), "r"(_addr), "r"(_addr + 4) : "memory"); \ + : : "r"(bswap.hi), "r"(bswap.lo), "b"(_ptr), "r"(_addr), "r"(_addr + 4) : "memory"); \ } #elif defined(__llvm__) || (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 8)