Enable overflow detection when at least 'gcc 8' is used.
[INTERPRETER] * BUG: Enable overflow detection when at least 'gcc 8' is used.
This commit is contained in:
parent
caacdd9c2f
commit
b03cfc16bf
1 changed files with 14 additions and 6 deletions
|
@ -24,15 +24,23 @@
|
|||
#ifndef __GB_OVERFLOW_H
|
||||
#define __GB_OVERFLOW_H
|
||||
|
||||
#define DO_NOT_CHECK_OVERFLOW 1
|
||||
#if __GNUC__ >= 8
|
||||
|
||||
#if defined __has_builtin
|
||||
#if __has_builtin(__builtin_add_overflow)
|
||||
#define DO_NOT_CHECK_OVERFLOW 0
|
||||
|
||||
#undef DO_NOT_CHECK_OVERFLOW
|
||||
#define DO_NOT_CHECK_OVERFLOW 0
|
||||
#else
|
||||
|
||||
#define DO_NOT_CHECK_OVERFLOW 1
|
||||
|
||||
#if defined(__has_builtin)
|
||||
#if __has_builtin(__builtin_add_overflow)
|
||||
|
||||
#undef DO_NOT_CHECK_OVERFLOW
|
||||
#define DO_NOT_CHECK_OVERFLOW 0
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#endif /* __GB_OVERFLOW_H */
|
||||
|
|
Loading…
Reference in a new issue