File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -484,16 +484,19 @@ function _init() {
484484
485485 Gio . Application . prototype . runAsync = GLib . MainLoop . prototype . runAsync ;
486486
487- // Redefine Gio functions with platform-specific implementations to be
488- // backward compatible with gi-repository 1.0, however when possible we
489- // notify a deprecation warning, to ensure that the surrounding code is
490- // updated.
491- try {
492- GioPlatform = imports . gi . GioUnix ;
493- } catch {
487+ if ( GLib . MAJOR_VERSION > 2 ||
488+ ( GLib . MAJOR_VERSION === 2 && GLib . MINOR_VERSION >= 86 ) ) {
489+ // Redefine Gio functions with platform-specific implementations to be
490+ // backward compatible with gi-repository 1.0, however when possible we
491+ // notify a deprecation warning, to ensure that the surrounding code is
492+ // updated.
494493 try {
495- GioPlatform = imports . gi . GioWin32 ;
496- } catch { }
494+ GioPlatform = imports . gi . GioUnix ;
495+ } catch {
496+ try {
497+ GioPlatform = imports . gi . GioWin32 ;
498+ } catch { }
499+ }
497500 }
498501
499502 const platformName = `${ GioPlatform ?. __name__ ?. slice ( 3 /* 'Gio'.length */ ) } ` ;
You can’t perform that action at this time.
0 commit comments