Solving problems with GTK 4.2.0 and GLib 2.68
vmagnin opened this issue · comments
Vincent Magnin commented
Describe the bug
After generating gtk-fortran with GTK 4.2.0 and GLib 2.68 under Fedora 34, building fails because of new GLIB_AVAILABLE_ENUMERATOR_IN_2_68
constants appearing in gtkenums-auto.f90
:
glib-2.0/glib/guri.h:90: G_URI_FLAGS_SCHEME_NORMALIZE GLIB_AVAILABLE_ENUMERATOR_IN_2_68 = 1 << 8,
glib-2.0/gio/gioenums.h:1223: G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_REQUIRE_SAME_USER GLIB_AVAILABLE_ENUMERATOR_IN_2_68 = (1<<5)
glib-2.0/gio/gioenums.h:1386: G_DBUS_SERVER_FLAGS_AUTHENTICATION_REQUIRE_SAME_USER GLIB_AVAILABLE_ENUMERATOR_IN_2_68 = (1<<2)
These constants are defined in glib-2.0/glib/gversionmacros.h
:
#define GLIB_AVAILABLE_ENUMERATOR_IN_2_68
meaning they are replaced by a void string if the C preprocessor knows that 2.68 is available.
Should be fixed by adding a regex in cfwrapper to remove strings similar to GLIB_AVAILABLE_ENUMERATOR_IN_?_??
Your system:
- OS version: Fedora 34
- Compiler version: gfortran 11
- GTK branch: gtk4 and gtk3
- GLib 2.68
Vincent Magnin commented
Fixed by adding line 83 in enums.py:
# Remove those preprocessor constants:
parameters[0] = re.sub("GLIB_AVAILABLE_ENUMERATOR_IN_\d_[\d]+ ", "", parameters[0])