Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(72)

Unified Diff: src/common/mac/macho_walker.cc

Issue 1340543002: Fix Mac Breakpad host tools to build in Linux cross-compile (Closed) Base URL: https://chromium.googlesource.com/breakpad/breakpad.git@master
Patch Set: Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: src/common/mac/macho_walker.cc
diff --git a/src/common/mac/macho_walker.cc b/src/common/mac/macho_walker.cc
index eee27d64f52869cf7cf79a56dcab043ea4fc316e..463138e9f397c7f693598ca3f87070b6a7a9b943 100644
--- a/src/common/mac/macho_walker.cc
+++ b/src/common/mac/macho_walker.cc
@@ -37,8 +37,8 @@ extern "C" { // necessary for Leopard
#include <assert.h>
#include <fcntl.h>
#include <mach-o/arch.h>
+ #include <mach-o/fat.h>
#include <mach-o/loader.h>
- #include <mach-o/swap.h>
#include <string.h>
#include <unistd.h>
}
@@ -156,7 +156,7 @@ bool MachoWalker::FindHeader(cpu_type_t cpu_type,
return false;
if (magic == MH_CIGAM || magic == MH_CIGAM_64)
- swap_mach_header(&header, NXHostByteOrder());
+ breakpad_swap_mach_header(&header);
if (cpu_type != header.cputype ||
(cpu_subtype != CPU_SUBTYPE_MULTIPLE &&
@@ -174,7 +174,7 @@ bool MachoWalker::FindHeader(cpu_type_t cpu_type,
return false;
if (NXHostByteOrder() != NX_BigEndian)
- swap_fat_header(&fat, NXHostByteOrder());
+ breakpad_swap_fat_header(&fat);
offset += sizeof(fat);
@@ -185,7 +185,7 @@ bool MachoWalker::FindHeader(cpu_type_t cpu_type,
return false;
if (NXHostByteOrder() != NX_BigEndian)
- swap_fat_arch(&arch, 1, NXHostByteOrder());
+ breakpad_swap_fat_arch(&arch, 1);
if (arch.cputype == cpu_type &&
(cpu_subtype == CPU_SUBTYPE_MULTIPLE ||
@@ -208,7 +208,7 @@ bool MachoWalker::WalkHeaderAtOffset(off_t offset) {
bool swap = (header.magic == MH_CIGAM);
if (swap)
- swap_mach_header(&header, NXHostByteOrder());
+ breakpad_swap_mach_header(&header);
// Copy the data into the mach_header_64 structure. Since the 32-bit and
// 64-bit only differ in the last field (reserved), this is safe to do.
@@ -234,7 +234,7 @@ bool MachoWalker::WalkHeader64AtOffset(off_t offset) {
bool swap = (header.magic == MH_CIGAM_64);
if (swap)
- breakpad_swap_mach_header_64(&header, NXHostByteOrder());
+ breakpad_swap_mach_header_64(&header);
current_header_ = &header;
current_header_size_ = sizeof(header);
@@ -255,7 +255,7 @@ bool MachoWalker::WalkHeaderCore(off_t offset, uint32_t number_of_commands,
return false;
if (swap)
- swap_load_command(&cmd, NXHostByteOrder());
+ breakpad_swap_load_command(&cmd);
// Call the user callback
if (callback_ && !callback_(this, &cmd, offset, swap, callback_context_))

Powered by Google App Engine
This is Rietveld 408576698