aboutsummaryrefslogtreecommitdiff
path: root/build2/cxx/guess
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2016-03-28 15:59:06 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2016-03-28 16:03:35 +0200
commit96f2131e593e206f0e458409f22adfff8c1b5356 (patch)
treefdb71a7a435d631872e0413dbe13113a636932de /build2/cxx/guess
parent69801c4e23f877359118e55ed291737f4fbece04 (diff)
Clean up variable usage
Diffstat (limited to 'build2/cxx/guess')
-rw-r--r--build2/cxx/guess28
1 files changed, 11 insertions, 17 deletions
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 <build2/types>
#include <build2/utility>
-#include <build2/variable>
-
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<const value> coptions); // @@ VAR
+ guess (const path& cxx, const strings* coptions);
}
}