added preprocessor conditions to check GLib version for g_type_init().