diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2020-08-12 13:54:21 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2020-08-12 13:54:21 +0200 |
commit | d72e5f95e70976f9b8bc29a7ace3c354e815ca49 (patch) | |
tree | 4ac1f39941be5c6cd57287e15a049ec4d62eb126 /libbuild2/variable.ixx | |
parent | 446c6548a1b61a18a27e24320a53a66a3ef7008a (diff) |
Add int64 and int64s variable types
Diffstat (limited to 'libbuild2/variable.ixx')
-rw-r--r-- | libbuild2/variable.ixx | 28 |
1 files changed, 28 insertions, 0 deletions
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<int64_t>:: + assign (value& v, int64_t x) + { + if (v) + v.as<int64_t> () = x; + else + new (&v.data_) int64_t (x); + } + + inline void value_traits<int64_t>:: + append (value& v, int64_t x) + { + // ADD. + // + if (v) + v.as<int64_t> () += x; + else + new (&v.data_) int64_t (x); + } + + inline int value_traits<int64_t>:: + compare (int64_t l, int64_t r) + { + return l < r ? -1 : (l > r ? 1 : 0); + } + // uint64_t value // inline void value_traits<uint64_t>:: |