Skip to content

Commit e99cb89

Browse files
author
pepc84
committed
Old g++ Update button: platform-specific upgrade instructions
1 parent a69c564 commit e99cb89

2 files changed

Lines changed: 8 additions & 3 deletions

File tree

mode/CppMode.jar

22 Bytes
Binary file not shown.

src/java/CppBuild.java

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -509,7 +509,7 @@ public File compile(RunnerListener listener) throws Exception {
509509
String gpp = findGpp(isWindows);
510510

511511
int gppVer = gppMajorVersion(gpp);
512-
if (gppVer > 0 && gppVer < 99) { // SIMULATION
512+
if (gppVer > 0 && gppVer < 7) {
513513
listener.statusError("g++ " + gppVer + " is too old — need GCC 7+ for C++17.");
514514
boolean isWin2 = isWindows;
515515
final int[] choice = {-1};
@@ -528,8 +528,13 @@ public File compile(RunnerListener listener) throws Exception {
528528
null, opts, opts[0]);
529529
});
530530
} catch (Exception ignored2) {}
531-
if (choice[0] == 0 && isWin2) {
532-
try { InstallWizard.run(listener); } catch (Exception ignored3) {}
531+
if (choice[0] == 0) {
532+
if (isWin2) {
533+
try { InstallWizard.run(listener); } catch (Exception ignored3) {}
534+
} else {
535+
// Linux/macOS: open the install wizard which handles package managers
536+
try { InstallWizard.run(listener); } catch (Exception ignored3) {}
537+
}
533538
}
534539
throw new Exception("g++ too old: " + gppVer);
535540
}

0 commit comments

Comments
 (0)