diff --git a/lib/nimbase.h b/lib/nimbase.h index 26fd6751f7..af5d2b9e36 100644 --- a/lib/nimbase.h +++ b/lib/nimbase.h @@ -598,8 +598,9 @@ NIM_STATIC_ASSERT(sizeof(NI) == sizeof(void*) && NIM_INTBITS == sizeof(NI)*8, "P #define nimMulInt64(a, b, res) __builtin_smulll_overflow(a, b, (long long int*)res) #if NIM_INTBITS == 32 - #if ((defined(__arm__) && !defined(__unix__)) || defined(__riscv)) && defined(__GNUC__) - /* arm-none-eabi-gcc and riscv32-unknown-elf-gcc targets define int32_t as long int */ + #if ((defined(__arm__) && !defined(__unix__)) || defined(__riscv) || (defined(__xtensa__) && !defined(__unix__))) && defined(__GNUC__) + /* arm-none-eabi-gcc, riscv32-unknown-elf-gcc and xtensa-esp-elf-gcc targets + define int32_t as long int */ #define nimAddInt(a, b, res) __builtin_saddl_overflow(a, b, res) #define nimSubInt(a, b, res) __builtin_ssubl_overflow(a, b, res) #define nimMulInt(a, b, res) __builtin_smull_overflow(a, b, res)