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-Tag: v0.13.4~6 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=fd586ce5ab6fbbeb6d777d07d3e1ff4cbe547a97;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 66a2b06..1bf82d6 100644 --- a/include/urcu/uatomic/riscv.h +++ b/include/urcu/uatomic/riscv.h @@ -22,6 +22,12 @@ * IN THE SOFTWARE. */ +#ifndef _URCU_ARCH_UATOMIC_RISCV_H +#define _URCU_ARCH_UATOMIC_RISCV_H + +#include +#include + /* * See for details. * @@ -32,19 +38,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