Skip to content

GResource compiler: Prefix static [con|de]strutors with c_name

Chun-wei Fan requested to merge avoid-name-collisions into main

Hi,

From the commit message:

When attempting to test Windows support for building libadwaita, since we are using multiple GResource files, one would hit linker errors where multiple definitions of the following symbols have been defined, when glib-compile-resources was invoked without manual register:

resource_constructor_wrapper
resource_destructor_constructor
_arrayresource_constructor
_arrayresource_destructor

In order to avoid that, just prefix the definitions of resource_constructor and resource_destructor, like what we do when --manual-register is used, with what we pass in with --c-name so that we ensure that we do not end up in such name collisions.

This will also apply for glib-2.68.x and before.

With blessings, thank you!

Merge request reports