From d72e5f95e70976f9b8bc29a7ace3c354e815ca49 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 12 Aug 2020 13:54:21 +0200 Subject: Add int64 and int64s variable types --- libbuild2/variable.ixx | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'libbuild2/variable.ixx') diff --git a/libbuild2/variable.ixx b/libbuild2/variable.ixx index 84bf20c..a11ee12 100644 --- a/libbuild2/variable.ixx +++ b/libbuild2/variable.ixx @@ -368,6 +368,34 @@ namespace build2 return l < r ? -1 : (l > r ? 1 : 0); } + // int64_t value + // + inline void value_traits:: + assign (value& v, int64_t x) + { + if (v) + v.as () = x; + else + new (&v.data_) int64_t (x); + } + + inline void value_traits:: + append (value& v, int64_t x) + { + // ADD. + // + if (v) + v.as () += x; + else + new (&v.data_) int64_t (x); + } + + inline int value_traits:: + compare (int64_t l, int64_t r) + { + return l < r ? -1 : (l > r ? 1 : 0); + } + // uint64_t value // inline void value_traits:: -- cgit v1.1