split away drive init from ide_init2()
[qemu] / loader.c
index 54580e4..0cbcf9c 100644 (file)
--- a/loader.c
+++ b/loader.c
@@ -272,6 +272,9 @@ static void *load_at(int fd, int offset, int size)
     return ptr;
 }
 
+#ifdef ELF_CLASS
+#undef ELF_CLASS
+#endif
 
 #define ELF_CLASS   ELFCLASS32
 #include "elf.h"
@@ -321,7 +324,7 @@ int load_elf(const char *filename, int64_t address_offset,
         e_ident[2] != ELFMAG2 ||
         e_ident[3] != ELFMAG3)
         goto fail;
-#ifdef WORDS_BIGENDIAN
+#ifdef HOST_WORDS_BIGENDIAN
     data_order = ELFDATA2MSB;
 #else
     data_order = ELFDATA2LSB;
@@ -355,7 +358,7 @@ int load_elf(const char *filename, int64_t address_offset,
 
 static void bswap_uboot_header(uboot_image_header_t *hdr)
 {
-#ifndef WORDS_BIGENDIAN
+#ifndef HOST_WORDS_BIGENDIAN
     bswap32s(&hdr->ih_magic);
     bswap32s(&hdr->ih_hcrc);
     bswap32s(&hdr->ih_time);