Fall back for overflow-checked arithmetic with Intel compiler

The Intel compiler does not have intrinsics like `__builtin_uadd_overflow`.

https://bugzilla.gnome.org/show_bug.cgi?id=769104
This commit is contained in:
Thiago Macieira 2016-07-22 21:18:08 -07:00 committed by Colin Walters
parent df457c9110
commit a5f209bc65

View File

@ -381,7 +381,8 @@ typedef const gchar * (*GTranslateFunc) (const gchar *str,
/* Overflow-checked unsigned integer arithmetic /* Overflow-checked unsigned integer arithmetic
*/ */
#ifndef _GLIB_TEST_OVERFLOW_FALLBACK #ifndef _GLIB_TEST_OVERFLOW_FALLBACK
#if __GNUC__ >= 5 /* https://bugzilla.gnome.org/show_bug.cgi?id=769104 */
#if __GNUC__ >= 5 && !defined(__INTEL_COMPILER)
#define _GLIB_HAVE_BUILTIN_OVERFLOW_CHECKS #define _GLIB_HAVE_BUILTIN_OVERFLOW_CHECKS
#elif __has_builtin(__builtin_uadd_overflow) #elif __has_builtin(__builtin_uadd_overflow)
#define _GLIB_HAVE_BUILTIN_OVERFLOW_CHECKS #define _GLIB_HAVE_BUILTIN_OVERFLOW_CHECKS