mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-04 08:13:54 -06:00
target/ppc: Fix type conflict of GLib function pointers
On Emscripten, function pointer casts can result in runtime failures due to strict function signature checks. This affects the use of g_list_sort and g_slist_sort, which internally perform function pointer casts that are not supported by Emscripten. To avoid these issues, g_list_sort_with_data and g_slist_sort_with_data should be used instead, as they do not rely on function pointer casting. Signed-off-by: Kohei Tokunaga <ktokunaga.mail@gmail.com> Link: https://lore.kernel.org/r/d917055d35f5ff7316ccdcbdf57af9a7bd85bf29.1745820062.git.ktokunaga.mail@gmail.com Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
parent
84cb7025fa
commit
bea4eb18c5
1 changed files with 2 additions and 2 deletions
|
@ -7115,7 +7115,7 @@ PowerPCCPUClass *ppc_cpu_get_family_class(PowerPCCPUClass *pcc)
|
|||
}
|
||||
|
||||
/* Sort by PVR, ordering special case "host" last. */
|
||||
static gint ppc_cpu_list_compare(gconstpointer a, gconstpointer b)
|
||||
static gint ppc_cpu_list_compare(gconstpointer a, gconstpointer b, gpointer d)
|
||||
{
|
||||
ObjectClass *oc_a = (ObjectClass *)a;
|
||||
ObjectClass *oc_b = (ObjectClass *)b;
|
||||
|
@ -7183,7 +7183,7 @@ static void ppc_cpu_list(void)
|
|||
|
||||
qemu_printf("Available CPUs:\n");
|
||||
list = object_class_get_list(TYPE_POWERPC_CPU, false);
|
||||
list = g_slist_sort(list, ppc_cpu_list_compare);
|
||||
list = g_slist_sort_with_data(list, ppc_cpu_list_compare, NULL);
|
||||
g_slist_foreach(list, ppc_cpu_list_entry, NULL);
|
||||
g_slist_free(list);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue