summaryrefslogtreecommitdiff
path: root/py
diff options
context:
space:
mode:
authorScott Shawcroft <scott@tannewt.org>2020-01-30 10:59:21 -0800
committerScott Shawcroft <scott@tannewt.org>2020-01-30 10:59:21 -0800
commit55eb1730b89797c9b2b2115b3bec509acb490cb0 (patch)
tree127714b653d8570fcb0c8e499eea266688e3c3b0 /py
parent2cc20e8816c6c1571b7488e83e3b13af79d50d65 (diff)
parentd22e95eedaccf24ffa91fda1dc101f6f05b1039f (diff)
Merge remote-tracking branch 'adafruit/master' into tweak_pixelbuf
Diffstat (limited to 'py')
-rw-r--r--py/sequence.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/py/sequence.c b/py/sequence.c
index a750e5bac..0e668ea2a 100644
--- a/py/sequence.c
+++ b/py/sequence.c
@@ -34,6 +34,11 @@
#define SWAP(type, var1, var2) { type t = var2; var2 = var1; var1 = t; }
+#if __GNUC__ < 5
+// n.b. does not actually detect overflow!
+#define __builtin_mul_overflow(a, b, x) (*(x) = (a) * (b), false)
+#endif
+
// Detect when a multiply causes an overflow.
size_t mp_seq_multiply_len(size_t item_sz, size_t len) {
size_t new_len;