mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-09-07 08:28:43 +02:00
girepository: Make gi_repository_find_by_gtype() deterministic
When faced with a `GType` which is present in multiple typelibs, the old implementation was not deterministic, as it iterated over a hash table of typelibs. The iteration order of a hash table is not deterministic. Use the new `ordered_typelibs` and `ordered_lazy_typelibs` arrays to iterate instead, making the order deterministic. Add a unit test to check this. In particular, to check that symbols which are present in both `Gio` and `GioUnix` are correctly resolved as being from `GioUnix`. Signed-off-by: Philip Withnall <pwithnall@gnome.org> Helps: #3303
This commit is contained in:
@@ -29,6 +29,11 @@ if enable_gir
|
||||
gio_gir,
|
||||
]
|
||||
|
||||
gio_platform_gir_testing_dep = [
|
||||
gio_gir_testing_dep,
|
||||
gio_platform_gir,
|
||||
]
|
||||
|
||||
girepository_gir_testing_dep = [
|
||||
gio_gir_testing_dep,
|
||||
girepository_gir,
|
||||
@@ -46,7 +51,8 @@ if enable_gir
|
||||
'depends': gobject_gir_testing_dep,
|
||||
},
|
||||
'repository' : {
|
||||
'depends': gio_gir_testing_dep,
|
||||
'depends': [gio_gir_testing_dep, gio_platform_gir_testing_dep],
|
||||
'dependencies': [libgio_dep],
|
||||
},
|
||||
'repository-search-paths' : {
|
||||
'c_args': '-DGOBJECT_INTROSPECTION_LIBDIR="@0@"'.format(glib_libdir),
|
||||
|
Reference in New Issue
Block a user