aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/lj_obj.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/lj_obj.h b/src/lj_obj.h
index 83e30b6e..b417dce7 100644
--- a/src/lj_obj.h
+++ b/src/lj_obj.h
@@ -761,6 +761,13 @@ static LJ_AINLINE int32_t lj_num2bit(lua_Number n)
761#define lj_num2int(n) ((int32_t)(n)) 761#define lj_num2int(n) ((int32_t)(n))
762#endif 762#endif
763 763
764/* Truncate towards zero. */
765#define lj_trnum2int32(n) ((int32_t)(n))
766#define lj_trnum2uint32(n) ((uint32_t)(n))
767#define lj_trnum2int64(n) ((int64_t)(n))
768#define lj_trnum2uint64(n) \
769 ((uint64_t)(int64_t)((n)- 9223372036854775808.0) + U64x(80000000,00000000))
770
764/* -- Miscellaneous object handling --------------------------------------- */ 771/* -- Miscellaneous object handling --------------------------------------- */
765 772
766/* Names and maps for internal and external object tags. */ 773/* Names and maps for internal and external object tags. */