support glib for version < 2.40