From 092e8d50e219332da80256f336190e1bc8bc895c Mon Sep 17 00:00:00 2001 From: Mr-Wiseguy Date: Mon, 9 Sep 2024 22:37:12 -0400 Subject: [PATCH] Fix compilation on ARM64 and Apple --- librecomp/src/mods.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/librecomp/src/mods.cpp b/librecomp/src/mods.cpp index e707de2..1f32b0d 100644 --- a/librecomp/src/mods.cpp +++ b/librecomp/src/mods.cpp @@ -109,6 +109,7 @@ void protect(void* target_func, uint64_t old_flags) { (void)result; } #else +# include # include # include @@ -382,7 +383,7 @@ void patch_func(recomp_func_t* target_func, recomp::mods::GenericFunction replac uint64_t old_flags; unprotect(target_func_u8, &old_flags); -#ifdef IS_X86_64 +#if defined(IS_X86_64) static const uint8_t movabs_rax[] = {0x48, 0xB8}; static const uint8_t jmp_rax[] = {0xFF, 0xE0}; std::visit(overloaded { @@ -392,7 +393,7 @@ void patch_func(recomp_func_t* target_func, recomp::mods::GenericFunction replac write_bytes(jmp_rax, sizeof(jmp_rax)); } }, replacement_func); -#elif IS_ARM64 +#elif defined(IS_ARM64) ultramodern::error_handling::message_box("Mod loading not currently implemented on ARM CPUs!\n"); #else # error "Unsupported architecture"