From: Mathieu Desnoyers Date: Mon, 18 Dec 2023 15:24:13 +0000 (-0500) Subject: Fix: allow clang to build liburcu on RISC-V X-Git-Url: https://git.lttng.org/?a=commitdiff_plain;ds=sidebyside;h=4e7b1f9943cbeec405ab1994315ad374071474fb;p=urcu.git Fix: allow clang to build liburcu on RISC-V Clang also defines __GNUC__, so use URCU_GCC_VERSION to detect if built with gcc. Signed-off-by: Mathieu Desnoyers Change-Id: Ic32a0cf64556f55ba4aa11141816fce1afcb0e90 --- diff --git a/include/urcu/uatomic/riscv.h b/include/urcu/uatomic/riscv.h index a70ea25..c1ba29e 100644 --- a/include/urcu/uatomic/riscv.h +++ b/include/urcu/uatomic/riscv.h @@ -8,6 +8,12 @@ * Let the compiler do it. */ +#ifndef _URCU_ARCH_UATOMIC_RISCV_H +#define _URCU_ARCH_UATOMIC_RISCV_H + +#include +#include + /* * See for details. * @@ -18,19 +24,10 @@ * - * - */ -#if defined(__GNUC__) -# error "Implementations of some atomic operations of GCC for RISC-V \ - are insufficient for sequential consistency. For this reason \ - Userspace RCU is currently marked as 'broken' for RISC-V with \ - GCC. However, it is still possible to use other toolchains." +#ifdef URCU_GCC_VERSION +# error "Implementations of some atomic operations of GCC for RISC-V are insufficient for sequential consistency. For this reason Userspace RCU is currently marked as 'broken' for RISC-V with GCC. However, it is still possible to use other toolchains." #endif -#ifndef _URCU_ARCH_UATOMIC_RISCV_H -#define _URCU_ARCH_UATOMIC_RISCV_H - -#include -#include - #ifdef __cplusplus extern "C" { #endif