From 924d6d2aba729c6f5be1a10d81d6d76148f0b71d Mon Sep 17 00:00:00 2001 From: John Paul Adrian Glaubitz Date: Tue, 24 Oct 2017 22:13:45 +0200 Subject: [PATCH] Use platform-independent preprocessor macros for sparc64 sparc64 has different preprocessor definitons that can be used to detect the platform. There is __sparc64__, __sparcv9 and __sparc_v9__. However, all of them are defined only on one of the three targets BSD, Solaris and Linux. A cross-platform way to detect sparc64 is testing whether both __sparc__ and __arch64__ is defined which is available on all three targets. --- lib/builtins/int_lib.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/builtins/int_lib.h b/lib/builtins/int_lib.h index aadb437b81..012c28de27 100644 --- a/lib/builtins/int_lib.h +++ b/lib/builtins/int_lib.h @@ -89,7 +89,7 @@ * Presumably it's any version of GCC, and targeting an arch that * does not have dedicated bit counting instructions. */ -#if (defined(__sparc64__) || defined(__sparcv9) || defined(__mips_n64) || defined(__mips_o64) || defined(__riscv__) \ +#if ((defined(__sparc__) || defined(__arch64__)) || defined(__mips_n64) || defined(__mips_o64) || defined(__riscv__) \ || (defined(_MIPS_SIM) && ((_MIPS_SIM == _ABI64) || (_MIPS_SIM == _ABIO64)))) si_int __clzsi2(si_int); si_int __ctzsi2(si_int);