diff options
Diffstat (limited to 'src/common/mac/macho_walker.cc')
-rw-r--r-- | src/common/mac/macho_walker.cc | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/common/mac/macho_walker.cc b/src/common/mac/macho_walker.cc index 505a4df1..4b9f56c2 100644 --- a/src/common/mac/macho_walker.cc +++ b/src/common/mac/macho_walker.cc @@ -32,17 +32,21 @@ // // Author: Dan Waylonis +#ifdef HAVE_CONFIG_H +#include <config.h> // Must come first +#endif + #include <assert.h> #include <fcntl.h> -#include <mach-o/arch.h> #include <mach-o/fat.h> #include <mach-o/loader.h> #include <string.h> #include <unistd.h> +#include "common/mac/arch_utilities.h" #include "common/mac/byteswap.h" -#include "common/mac/macho_walker.h" #include "common/mac/macho_utilities.h" +#include "common/mac/macho_walker.h" namespace MacFileUtilities { @@ -81,9 +85,8 @@ bool MachoWalker::WalkHeader(cpu_type_t cpu_type, cpu_subtype_t cpu_subtype) { cpu_subtype_t valid_cpu_subtype = cpu_subtype; // if |cpu_type| is 0, use the native cpu type. if (cpu_type == 0) { - const NXArchInfo* arch = NXGetLocalArchInfo(); - assert(arch); - valid_cpu_type = arch->cputype; + ArchInfo arch = GetLocalArchInfo(); + valid_cpu_type = arch.cputype; valid_cpu_subtype = CPU_SUBTYPE_MULTIPLE; } off_t offset; |