提交 134d42d6 编写于 作者: M Michael S. Tsirkin 提交者: Anthony Liguori

acpi-build: fix support for glib < 2.22

glib < 2.22 does not have g_array_get_element_size,
limit it's use (to check all elements are 1 byte
in size) to newer glib.

This fixes build on RHEL 5.3.
Reported-by: NRichard Henderson <rth@redhat.com>
Reported-by: NErik Rull <erik.rull@rdsoftware.de>
Tested-by: NRichard Henderson <rth@redhat.com>
Signed-off-by: NMichael S. Tsirkin <mst@redhat.com>
Message-id: 20131125220039.GA16386@redhat.com
Signed-off-by: NAnthony Liguori <aliguori@amazon.com>
上级 c0caec17
......@@ -425,7 +425,7 @@ static inline void *acpi_data_push(GArray *table_data, unsigned size)
static unsigned acpi_data_len(GArray *table)
{
#if GLIB_CHECK_VERSION(2, 14, 0)
#if GLIB_CHECK_VERSION(2, 22, 0)
assert(g_array_get_element_size(table) == 1);
#endif
return table->len;
......@@ -436,9 +436,7 @@ static void acpi_align_size(GArray *blob, unsigned align)
/* Align size to multiple of given size. This reduces the chance
* we need to change size in the future (breaking cross version migration).
*/
g_array_set_size(blob, (ROUND_UP(acpi_data_len(blob), align) +
g_array_get_element_size(blob) - 1) /
g_array_get_element_size(blob));
g_array_set_size(blob, ROUND_UP(acpi_data_len(blob), align));
}
/* Get pointer within table in a safe manner */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册