diff options
author | Michael S. Tsirkin <mst@redhat.com> | 2013-11-21 14:17:54 +0200 |
---|---|---|
committer | Anthony Liguori <aliguori@amazon.com> | 2013-11-21 07:54:03 -0800 |
commit | b15654c21acef4d2bc17e6ac528c6c93abbb7e1e (patch) | |
tree | e7cd7e62c271199cb94a4633fce59e5b8c53655d /hw/i386/acpi-build.c | |
parent | 542da88f0013ebb2b2d8ca10becbfebd9948abba (diff) |
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/acpi-build.c')
-rw-r--r-- | hw/i386/acpi-build.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c index 59a17dfbd3..5f36e7ec02 100644 --- a/hw/i386/acpi-build.c +++ b/hw/i386/acpi-build.c @@ -425,7 +425,10 @@ static inline void *acpi_data_push(GArray *table_data, unsigned size) static unsigned acpi_data_len(GArray *table) { - return table->len * g_array_get_element_size(table); +#if GLIB_CHECK_VERSION(2, 14, 0) + assert(g_array_get_element_size(table) == 1); +#endif + return table->len; } static void acpi_align_size(GArray *blob, unsigned align) |