aboutsummaryrefslogtreecommitdiff
path: root/src/integer128.cpp
diff options
context:
space:
mode:
authorGinger Bill <bill@gingerbill.org>2017-06-18 14:36:06 +0100
committerGinger Bill <bill@gingerbill.org>2017-06-18 14:36:06 +0100
commit4236519b84e2bea73b1b7756a20a2df24d3fb070 (patch)
tree39e90d5650a9e84270d41b899eadc3aaed02a87c /src/integer128.cpp
parente4944b4f2ebf617d629184257ef81e9c3f212e6c (diff)
`#location(..)` and `#call_location`
Diffstat (limited to 'src/integer128.cpp')
-rw-r--r--src/integer128.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/integer128.cpp b/src/integer128.cpp
index 3ebd811c6..58a21d6d7 100644
--- a/src/integer128.cpp
+++ b/src/integer128.cpp
@@ -152,7 +152,12 @@ u64 bit128__digit_value(Rune r) {
return 16; // NOTE(bill): Larger than highest possible
}
-u128 u128_lo_hi(u64 lo, u64 hi) { return u128{lo, hi}; }
+u128 u128_lo_hi(u64 lo, u64 hi) {
+ u128 r = {};
+ r.lo = lo;
+ r.hi = hi;
+ return r;
+}
u128 u128_from_u32(u32 u) { return u128_lo_hi(cast(u64)u, 0); }
u128 u128_from_u64(u64 u) { return u128_lo_hi(cast(u64)u, 0); }
u128 u128_from_i64(i64 u) { return u128_lo_hi(cast(u64)u, u < 0 ? -1 : 0); }