added a switch -d:nimEmulateOverflowChecks for broken or old GCC versions (#13692)

This commit is contained in:
Andreas Rumpf 2020-03-19 09:56:30 +01:00 • committed by GitHub
commit ba6e7c6365
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 13 additions and 5 deletions

View file

@ -19,7 +19,7 @@ proc raiseDivByZero {.compilerproc, noinline.} =
{.pragma: nimbaseH, importc, nodecl, noSideEffect, compilerproc.}
when defined(gcc) or defined(clang):
when (defined(gcc) or defined(clang)) and not defined(nimEmulateOverflowChecks):
# take the #define from nimbase.h
proc nimAddInt(a, b: int, res: ptr int): bool {.nimbaseH.}