#location(..) and #call_location

This commit is contained in:
Ginger Bill
2017-06-18 14:36:06 +01:00
parent e4944b4f2e
commit 4236519b84
11 changed files with 241 additions and 96 deletions

View File

@@ -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); }