accomodate excessively old gcc versions for raspbian mpy-cross cross-build

This commit is contained in:
Jeff Epler 2020-01-25 14:58:14 -06:00
parent a43a19728c
commit d9e0742a07
1 changed files with 5 additions and 0 deletions

View File

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