Merge "use GNU C89 extern inline semantics for __size_mul_overflow()"

This commit is contained in:
Josh Gao 2016-02-03 01:28:48 +00:00 committed by Gerrit Code Review
commit 153e9928b8
1 changed files with 2 additions and 2 deletions

View File

@ -462,8 +462,8 @@
#define __size_mul_overflow(a, b, result) __builtin_umul_overflow(a, b, result)
#endif
#else
static __inline__ __always_inline int __size_mul_overflow(__SIZE_TYPE__ a, __SIZE_TYPE__ b,
__SIZE_TYPE__ *result) {
extern __inline__ __always_inline __attribute__((gnu_inline))
int __size_mul_overflow(__SIZE_TYPE__ a, __SIZE_TYPE__ b, __SIZE_TYPE__ *result) {
*result = a * b;
static const __SIZE_TYPE__ mul_no_overflow = 1UL << (sizeof(__SIZE_TYPE__) * 4);
return (a >= mul_no_overflow || b >= mul_no_overflow) && a > 0 && (__SIZE_TYPE__)-1 / a < b;