mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-01 23:03:54 -06:00
include/glib-compat.h: Poison g_list_sort and g_slist_sort
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/fa57c8069d6c723f5b947560677f4ca596334330.1745820062.git.ktokunaga.mail@gmail.com Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
parent
c4eb098bc1
commit
4cd5a25557
1 changed files with 7 additions and 0 deletions
|
@ -36,6 +36,13 @@
|
|||
#include <pwd.h>
|
||||
#endif
|
||||
|
||||
/*
|
||||
* These functions perform function pointer casts which can cause function call
|
||||
* failure on Emscripten. Use g_slist_sort_with_data and g_list_sort_with_data
|
||||
* instead of these functions.
|
||||
*/
|
||||
#pragma GCC poison g_slist_sort g_list_sort
|
||||
|
||||
/*
|
||||
* Note that because of the GLIB_VERSION_MAX_ALLOWED constant above, allowing
|
||||
* use of functions from newer GLib via this compat header needs a little
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue