summaryrefslogtreecommitdiff
path: root/hw/i386/bios-linker-loader.c
diff options
context:
space:
mode:
authorMichael S. Tsirkin <mst@redhat.com>2013-11-21 14:17:54 +0200
committerAnthony Liguori <aliguori@amazon.com>2013-11-21 07:54:03 -0800
commitb15654c21acef4d2bc17e6ac528c6c93abbb7e1e (patch)
treee7cd7e62c271199cb94a4633fce59e5b8c53655d /hw/i386/bios-linker-loader.c
parent542da88f0013ebb2b2d8ca10becbfebd9948abba (diff)
downloadqemu-b15654c21acef4d2bc17e6ac528c6c93abbb7e1e.tar.gz
acpi-build: fix build on glib < 2.14
g_array_get_element_size was only added in glib 2.14. Fortunately we don't use it for any arrays where element size is > 1, so just add an assert. Reported-by: Richard Henderson <rth@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Message-id: 1385036128-8753-2-git-send-email-mst@redhat.com Signed-off-by: Anthony Liguori <aliguori@amazon.com>
Diffstat (limited to 'hw/i386/bios-linker-loader.c')
-rw-r--r--hw/i386/bios-linker-loader.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/hw/i386/bios-linker-loader.c b/hw/i386/bios-linker-loader.c
index 083385332e..fd23611008 100644
--- a/hw/i386/bios-linker-loader.c
+++ b/hw/i386/bios-linker-loader.c
@@ -90,7 +90,7 @@ enum {
GArray *bios_linker_loader_init(void)
{
- return g_array_new(false, true /* clear */, sizeof(BiosLinkerLoaderEntry));
+ return g_array_new(false, true /* clear */, 1);
}
/* Free linker wrapper and return the linker array. */
@@ -115,7 +115,7 @@ void bios_linker_loader_alloc(GArray *linker,
BIOS_LINKER_LOADER_ALLOC_ZONE_HIGH);
/* Alloc entries must come first, so prepend them */
- g_array_prepend_val(linker, entry);
+ g_array_prepend_vals(linker, &entry, sizeof entry);
}
void bios_linker_loader_add_checksum(GArray *linker, const char *file,
@@ -132,7 +132,7 @@ void bios_linker_loader_add_checksum(GArray *linker, const char *file,
entry.cksum.start = cpu_to_le32((uint8_t *)start - (uint8_t *)table);
entry.cksum.length = cpu_to_le32(size);
- g_array_append_val(linker, entry);
+ g_array_append_vals(linker, &entry, sizeof entry);
}
void bios_linker_loader_add_pointer(GArray *linker,
@@ -154,5 +154,5 @@ void bios_linker_loader_add_pointer(GArray *linker,
assert(pointer_size == 1 || pointer_size == 2 ||
pointer_size == 4 || pointer_size == 8);
- g_array_append_val(linker, entry);
+ g_array_append_vals(linker, &entry, sizeof entry);
}