summaryrefslogtreecommitdiff
path: root/ext/bigdecimal/bits.h
diff options
context:
space:
mode:
Diffstat (limited to 'ext/bigdecimal/bits.h')
-rw-r--r--ext/bigdecimal/bits.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/ext/bigdecimal/bits.h b/ext/bigdecimal/bits.h
index f39e83b..3835fe3 100644
--- a/ext/bigdecimal/bits.h
+++ b/ext/bigdecimal/bits.h
@@ -15,6 +15,10 @@
# pragma intrinsic(__lzcnt64)
#endif
+#define numberof(array) ((int)(sizeof(array) / sizeof((array)[0])))
+#define roomof(x, y) (((x) + (y) - 1) / (y))
+#define type_roomof(x, y) roomof(sizeof(x), sizeof(y))
+
#define MUL_OVERFLOW_SIGNED_INTEGER_P(a, b, min, max) ( \
(a) == 0 ? 0 : \
(a) == -1 ? (b) < -(max) : \