]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
* grub-core/loader/macho.c: Fix compilation on non-i386.
authorVladimir Serbinenko <phcoder@gmail.com>
Tue, 17 Dec 2013 19:46:33 +0000 (20:46 +0100)
committerVladimir Serbinenko <phcoder@gmail.com>
Tue, 17 Dec 2013 19:46:33 +0000 (20:46 +0100)
ChangeLog
grub-core/loader/macho.c

index dcc002fe209f3fc34080fd242e7aebac370275d2..7eab58ddb69297952a36299db2684c49f00c1a4c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2013-12-17  Vladimir Serbinenko  <phcoder@gmail.com>
+
+       * grub-core/loader/macho.c: Fix compilation on non-i386.
+
 2013-12-17  Vladimir Serbinenko  <phcoder@gmail.com>
 
        Add missing format_arg attribute to check that printf with translated
index bf0bf74f78f2cea634e387b18f8744c93b57f33a..3da917689accaf6afca475d0245c97013f102189 100644 (file)
@@ -23,7 +23,6 @@
 
 #include <grub/err.h>
 #include <grub/macho.h>
-#include <grub/cpu/macho.h>
 #include <grub/machoload.h>
 #include <grub/file.h>
 #include <grub/misc.h>
@@ -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)