Skip to content

Commit

Permalink
Fix compilation on ARM64 and Apple
Browse files Browse the repository at this point in the history
  • Loading branch information
Mr-Wiseguy committed Sep 10, 2024
1 parent e225e22 commit 092e8d5
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions librecomp/src/mods.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ void protect(void* target_func, uint64_t old_flags) {
(void)result;
}
#else
# include <unistd.h>
# include <dlfcn.h>
# include <sys/mman.h>

Expand Down Expand Up @@ -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 {
Expand All @@ -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"
Expand Down

0 comments on commit 092e8d5

Please sign in to comment.