mirror of
https://github.com/fltk/fltk.git
synced 2026-05-23 07:46:09 +08:00
X11 platform: Allow running with old (< 2.36) versions of libglib-2.0
These versions require calling g_type_init(). Newer versions don't. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12464 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This commit is contained in:
@@ -1299,6 +1299,13 @@ static bool gnome_scale_factor(float& factor) {
|
||||
//g_variant_get_type_ftype g_variant_get_type_f = (g_variant_get_type_ftype)dlsym(glib, "g_variant_get_type"); // 2.24
|
||||
|
||||
// call dynamic lib functions
|
||||
const unsigned *glib_major_version = (const unsigned *)dlsym(glib, "glib_major_version");
|
||||
const unsigned *glib_minor_version = (const unsigned *)dlsym(glib, "glib_minor_version");
|
||||
if (*glib_major_version >= 2 && *glib_minor_version < 36) {
|
||||
typedef void (*init_ftype)(void);
|
||||
init_ftype g_type_init_f = (init_ftype)dlsym(gobj, "g_type_init");
|
||||
g_type_init_f(); // necessary only if GLib version < 2.36
|
||||
}
|
||||
const char **known = g_settings_list_schemas_f(); // list of available GSettings schemas
|
||||
const char *schema;
|
||||
float ubuntu_f = 1, ubuntu_desktop_f = 1, gnome_f = 1;
|
||||
|
||||
Reference in New Issue
Block a user