From ceb682042c8e3cb3baf02544d426a5c32111833c Mon Sep 17 00:00:00 2001 From: Martin Olivier Date: Thu, 1 Aug 2024 13:01:21 +0200 Subject: [PATCH] fix: macOS build Signed-off-by: Martin Olivier --- src/symbols.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/symbols.cpp b/src/symbols.cpp index ffe8bf7..168ee89 100644 --- a/src/symbols.cpp +++ b/src/symbols.cpp @@ -86,7 +86,7 @@ std::vector get_symbols(HMODULE handle, bool demangle, bool loadabl #include #include -static std::vector get_symbols_at_off(int fd, bool demangle, bool loadable, off_t offset, bool is_64_bit) { +static std::vector get_symbols_at_off(void *handle, int fd, bool demangle, bool loadable, off_t offset, bool is_64_bit) { std::vector result; lseek(fd, offset, SEEK_SET); @@ -181,6 +181,7 @@ std::vector get_symbols(void *handle, int fd, bool demangle, bool l for (uint32_t i = 0; i < ntohl(fat_header.nfat_arch); i++) { tmp = get_symbols_at_off( + handle, fd, demangle, loadable, @@ -191,9 +192,9 @@ std::vector get_symbols(void *handle, int fd, bool demangle, bool l free(fat_arches); } else if (magic == MH_MAGIC_64 || magic == MH_CIGAM_64) { - result = get_symbols_at_off(fd, demangle, 0, true); + result = get_symbols_at_off(handle, fd, demangle, loadable, 0, true); } else if (magic == MH_MAGIC || magic == MH_CIGAM) { - result = get_symbols_at_off(fd, demangle, 0, false); + result = get_symbols_at_off(handle, fd, demangle, loadable, 0, false); } else { throw std::string("Unsupported file format"); }