aboutsummaryrefslogtreecommitdiff
path: root/stdlib/integers.h
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2024-11-30 17:25:36 -0500
committerBruce Hill <bruce@bruce-hill.com>2024-11-30 17:25:36 -0500
commit07dd1894b70f537bff13e8f9cb2613e62947c006 (patch)
tree7ab832a167e1cc7fdedf2e5a45715f87c6d2f161 /stdlib/integers.h
parent919e47a4188acc1da711ac05e5aa097a3b1349f7 (diff)
Bugfixes for moments mixing up microseconds/nanoseconds, plus adding
accessor fields for them
Diffstat (limited to 'stdlib/integers.h')
-rw-r--r--stdlib/integers.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/stdlib/integers.h b/stdlib/integers.h
index 5556c19c..1ebc30aa 100644
--- a/stdlib/integers.h
+++ b/stdlib/integers.h
@@ -360,6 +360,9 @@ CONVERSION_FUNC(16, 8)
if (__builtin_expect(!truncate && (num##_t)(int_type##_t)rounded != rounded, 0)) \
fail("Cannot truncate the " #num " %g to an " #int_type, (double)rounded); \
return (int_type##_t)rounded; \
+ } \
+ MACROLIKE PUREFUNC num##_t int_type##_to_##num(int_type##_t n) { \
+ return (num##_t)n; \
}
CONVERSION_FUNC(Num, Int64)