mirror of
https://github.com/Motorhead1991/qemu.git
synced 2026-02-27 06:35:23 -07:00
target/s390x: 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> Reviewed-by: Thomas Huth <thuth@redhat.com> Link: https://lore.kernel.org/r/e91c4e266b839f62b5c41173a05896b210ae1180.1745820062.git.ktokunaga.mail@gmail.com Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
parent
bea4eb18c5
commit
c4eb098bc1
1 changed files with 2 additions and 2 deletions
|
|
@ -373,7 +373,7 @@ static void s390_print_cpu_model_list_entry(gpointer data, gpointer user_data)
|
|||
g_free(name);
|
||||
}
|
||||
|
||||
static gint s390_cpu_list_compare(gconstpointer a, gconstpointer b)
|
||||
static gint s390_cpu_list_compare(gconstpointer a, gconstpointer b, gpointer d)
|
||||
{
|
||||
const S390CPUClass *cc_a = S390_CPU_CLASS((ObjectClass *)a);
|
||||
const S390CPUClass *cc_b = S390_CPU_CLASS((ObjectClass *)b);
|
||||
|
|
@ -415,7 +415,7 @@ void s390_cpu_list(void)
|
|||
|
||||
qemu_printf("Available CPUs:\n");
|
||||
list = object_class_get_list(TYPE_S390_CPU, false);
|
||||
list = g_slist_sort(list, s390_cpu_list_compare);
|
||||
list = g_slist_sort_with_data(list, s390_cpu_list_compare, NULL);
|
||||
g_slist_foreach(list, s390_print_cpu_model_list_entry, NULL);
|
||||
g_slist_free(list);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue