diff --git a/ChangeLog b/ChangeLog index dcc002fe2..7eab58ddb 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2013-12-17 Vladimir Serbinenko + + * grub-core/loader/macho.c: Fix compilation on non-i386. + 2013-12-17 Vladimir Serbinenko Add missing format_arg attribute to check that printf with translated diff --git a/grub-core/loader/macho.c b/grub-core/loader/macho.c index bf0bf74f7..3da917689 100644 --- a/grub-core/loader/macho.c +++ b/grub-core/loader/macho.c @@ -23,7 +23,6 @@ #include #include -#include #include #include #include @@ -85,7 +84,7 @@ grub_macho_file (grub_file_t file, const char *filename, int is_64bit) } /* Is it a fat file? */ - if (filestart.fat.magic == grub_be_to_cpu32 (GRUB_MACHO_FAT_MAGIC)) + if (filestart.fat.magic == grub_cpu_to_be32_compile_time (GRUB_MACHO_FAT_MAGIC)) { struct grub_macho_fat_arch *archs; int i, narchs; @@ -111,15 +110,17 @@ grub_macho_file (grub_file_t file, const char *filename, int is_64bit) for (i = 0; i < narchs; i++) { - if (GRUB_MACHO_CPUTYPE_IS_HOST32 - (grub_be_to_cpu32 (archs[i].cputype)) && !is_64bit) + if ((archs[i].cputype + == grub_cpu_to_be32_compile_time (GRUB_MACHO_CPUTYPE_IA32)) + && !is_64bit) { macho->offset32 = grub_be_to_cpu32 (archs[i].offset); macho->end32 = grub_be_to_cpu32 (archs[i].offset) + grub_be_to_cpu32 (archs[i].size); } - if (GRUB_MACHO_CPUTYPE_IS_HOST64 - (grub_be_to_cpu32 (archs[i].cputype)) && is_64bit) + if ((archs[i].cputype + == grub_cpu_to_be32_compile_time (GRUB_MACHO_CPUTYPE_AMD64)) + && is_64bit) { macho->offset64 = grub_be_to_cpu32 (archs[i].offset); macho->end64 = grub_be_to_cpu32 (archs[i].offset)