From e959ed4fc854394b13ea1d82b94ccc486e05ee46 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 20 Jul 2021 06:23:45 +0200 Subject: Map Apple Clang version 12.0.5 to vanilla Clang 10.0.0 --- libbuild2/cc/guess.cxx | 35 +++++++++++++++++++---------------- 1 file changed, 19 insertions(+), 16 deletions(-) (limited to 'libbuild2/cc') diff --git a/libbuild2/cc/guess.cxx b/libbuild2/cc/guess.cxx index 605e588..b7fd28c 100644 --- a/libbuild2/cc/guess.cxx +++ b/libbuild2/cc/guess.cxx @@ -2457,28 +2457,31 @@ namespace build2 // 9.1.0 -> 5.0 // 10.0.0 -> 6.0 // 11.0.0 -> 7.0 - // 11.0.3 -> 8.0 + // 11.0.3 -> 8.0 (yes, seriously!) // 12.0.0 -> 9.0 + // 12.0.5 -> 10.0 (yes, seriously!) // uint64_t mj (var_ver->major); uint64_t mi (var_ver->minor); uint64_t pa (var_ver->patch); - if (mj >= 12) {mj = 9; mi = 0;} - else if (mj == 11 && (mi > 0 || pa >= 3)) {mj = 8; mi = 0;} - else if (mj == 11) {mj = 7; mi = 0;} - else if (mj == 10) {mj = 6; mi = 0;} - else if (mj == 9 && mi >= 1) {mj = 5; mi = 0;} - else if (mj == 9) {mj = 4; mi = 0;} - else if (mj == 8) {mj = 3; mi = 9;} - else if (mj == 7 && mi >= 3) {mj = 3; mi = 8;} - else if (mj == 7) {mj = 3; mi = 7;} - else if (mj == 6 && mi >= 1) {mj = 3; mi = 5;} - else if (mj == 6) {mj = 3; mi = 4;} - else if (mj == 5 && mi >= 1) {mj = 3; mi = 3;} - else if (mj == 5) {mj = 3; mi = 2;} - else if (mj == 4 && mi >= 2) {mj = 3; mi = 1;} - else {mj = 3; mi = 0;} + if (mj > 12) {mj = 10; mi = 0;} + else if (mj == 12 && (mi > 0 || pa >= 5)) {mj = 10; mi = 0;} + else if (mj == 12) {mj = 9; mi = 0;} + else if (mj == 11 && (mi > 0 || pa >= 3)) {mj = 8; mi = 0;} + else if (mj == 11) {mj = 7; mi = 0;} + else if (mj == 10) {mj = 6; mi = 0;} + else if (mj == 9 && mi >= 1) {mj = 5; mi = 0;} + else if (mj == 9) {mj = 4; mi = 0;} + else if (mj == 8) {mj = 3; mi = 9;} + else if (mj == 7 && mi >= 3) {mj = 3; mi = 8;} + else if (mj == 7) {mj = 3; mi = 7;} + else if (mj == 6 && mi >= 1) {mj = 3; mi = 5;} + else if (mj == 6) {mj = 3; mi = 4;} + else if (mj == 5 && mi >= 1) {mj = 3; mi = 3;} + else if (mj == 5) {mj = 3; mi = 2;} + else if (mj == 4 && mi >= 2) {mj = 3; mi = 1;} + else {mj = 3; mi = 0;} ver = compiler_version { to_string (mj) + '.' + to_string (mi) + ".0", -- cgit v1.1