Skip to content

modules/media: Fix Visual Studio builds with older GLib (<= 2.74.x)

Chun-wei Fan requested to merge fix-msvc-older-glib into main

Hi,

From the commit message, in order to fix DLL builds against glib-2.74.x or earlier using Visual Studio:

The current definitions of the g_io_module_*() symbols do not build on Visual Studio when building against GLib earlier than 2.75.0 due to the way how these symbols are decorated in the GLib headers, as Visual Studio does not allow symbols that were previously marked with 'extern' (or so) to be marked with anything that is symantically different later.

As a result, if we are using Visual Studio and glib-2.74.x or earlier, override _GLIB_EXTERN as appropriate in the modules/media sources before including the GIO headers. This sadly, means that we need a configure-time check as it would have been too late if we checked the GLib version using G_VERSION_CHECK macro, as the GIO headers would have been included already.

...

This will be for (the upcoming) 4.10.x and the main branches--I missed this until 4.10.0 (stable) came out, as I typically build against stable deps for stable versions (with, of course, the exception of Cairo)

With blessings, thank you!

Edited by Chun-wei Fan

Merge request reports