aboutsummaryrefslogtreecommitdiff
path: root/hw/acpi/aml-build.c
diff options
context:
space:
mode:
authorMichael S. Tsirkin <mst@redhat.com>2015-03-03 17:40:45 +0100
committerMichael S. Tsirkin <mst@redhat.com>2015-03-03 17:42:18 +0100
commit2e5feadbf8133b9b108919a2f576943b448a1a06 (patch)
treec95dc7e9bf81e34515e4ff60d21c1c2497edd3dd /hw/acpi/aml-build.c
parent48ce35b7645154eff6b685b3178aacf33f2ff871 (diff)
aml-build: fix build for glib < 2.22
g_ptr_array_new_with_free_func is there since glib 2.22, use the older g_ptr_array_foreach instead. Reported-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'hw/acpi/aml-build.c')
-rw-r--r--hw/acpi/aml-build.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/hw/acpi/aml-build.c b/hw/acpi/aml-build.c
index 3e5949be10..876cada4b2 100644
--- a/hw/acpi/aml-build.c
+++ b/hw/acpi/aml-build.c
@@ -299,7 +299,7 @@ static Aml *aml_bundle(uint8_t op, AmlBlockFlags flags)
return var;
}
-static void aml_free(gpointer data)
+static void aml_free(gpointer data, gpointer user_data)
{
Aml *var = data;
build_free_array(var->buf);
@@ -310,13 +310,14 @@ Aml *init_aml_allocator(void)
Aml *var;
assert(!alloc_list);
- alloc_list = g_ptr_array_new_with_free_func(aml_free);
+ alloc_list = g_ptr_array_new();
var = aml_alloc();
return var;
}
void free_aml_allocator(void)
{
+ g_ptr_array_foreach(alloc_list, aml_free, NULL);
g_ptr_array_free(alloc_list, true);
alloc_list = 0;
}