From 2de056429e6df93dfc4e035ae02dd87fb849a54e Mon Sep 17 00:00:00 2001 From: Michael Shigorin Date: Thu, 4 Apr 2019 22:22:00 +0300 Subject: [PATCH] intprops, xalloc-oversized: port to lcc * lib/xalloc-oversized.h (xalloc_oversized): Do not use __builtin_mul_overflow if LCC is defined, as this results in "undefined reference to `__builtin_mul_overflow'" with lcc 1.23.12. * lib/intprops.h: Likewise. --- lib/intprops.h | 2 +- lib/xalloc-oversized.h | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/gl/lib/intprops.h b/gl/lib/intprops.h index 140f6d2..d907a58 100644 --- a/gl/lib/intprops.h +++ b/gl/lib/intprops.h @@ -221,7 +221,7 @@ : (max) >> (b) < (a)) /* True if __builtin_add_overflow (A, B, P) works when P is non-null. */ -#if 5 <= __GNUC__ && !defined __ICC +#if 5 <= __GNUC__ && !defined __ICC && !(defined __LCC__ && __LCC__ <= 123) # define _GL_HAS_BUILTIN_OVERFLOW 1 #else # define _GL_HAS_BUILTIN_OVERFLOW 0 diff --git a/gl/lib/xalloc-oversized.h b/gl/lib/xalloc-oversized.h index e3068c8..6a2a0d7 100644 --- a/gl/lib/xalloc-oversized.h +++ b/gl/lib/xalloc-oversized.h @@ -44,7 +44,8 @@ typedef size_t __xalloc_count_type; #if 7 <= __GNUC__ # define xalloc_oversized(n, s) \ __builtin_mul_overflow_p (n, s, (__xalloc_count_type) 1) -#elif 5 <= __GNUC__ && !defined __ICC && !__STRICT_ANSI__ +#elif 5 <= __GNUC__ && !defined __ICC && \ + !(defined __LCC__ && __LCC__ <= 123) && !__STRICT_ANSI__ # define xalloc_oversized(n, s) \ (__builtin_constant_p (n) && __builtin_constant_p (s) \ ? __xalloc_oversized (n, s) \ -- 2.10.4