From 96f2131e593e206f0e458409f22adfff8c1b5356 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 28 Mar 2016 15:59:06 +0200 Subject: Clean up variable usage --- build2/cxx/guess | 28 +++++++++++----------------- 1 file changed, 11 insertions(+), 17 deletions(-) (limited to 'build2/cxx/guess') diff --git a/build2/cxx/guess b/build2/cxx/guess index cd9f740..0588523 100644 --- a/build2/cxx/guess +++ b/build2/cxx/guess @@ -8,8 +8,6 @@ #include #include -#include - namespace build2 { namespace cxx @@ -62,22 +60,18 @@ namespace build2 // struct compiler_version { - std::string major; - std::string minor; - std::string patch; - std::string build; + std::string string; - // The format is always A.B[.C][-D]. + // Currently all the compilers that we support have numeric MAJOR, + // MINOR, and PATCH components and it makes sense to represent them as + // integers for easy comparison. If we meet a compiler for which this + // doesn't hold, then we will probably just set these to 0 and let the + // user deal with the string representation. // - std::string - string () const - { - std::string r (major); - r += '.'; r += minor; - if (!patch.empty ()) {r += '.'; r += patch;} - if (!build.empty ()) {r += '-'; r += build;} - return r; - } + uint64_t major; + uint64_t minor; + uint64_t patch; + std::string build; }; // C++ compiler information. @@ -106,7 +100,7 @@ namespace build2 }; compiler_info - guess (const path& cxx, lookup coptions); // @@ VAR + guess (const path& cxx, const strings* coptions); } } -- cgit v1.1