From ff9d238c3ddccb90f1fddfaa0e1d1461535d493d Mon Sep 17 00:00:00 2001 From: Gleb Chesnokov Date: Tue, 16 Jun 2026 17:40:43 +0300 Subject: [PATCH] scst/include/backport.h: Fix __has_builtin() check for older GCC Fixes: https://github.com/SCST-project/scst/issues/377 --- scst/include/backport.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/scst/include/backport.h b/scst/include/backport.h index d5048de6b..aec624fa0 100644 --- a/scst/include/backport.h +++ b/scst/include/backport.h @@ -1310,9 +1310,13 @@ static __always_inline size_t __must_check size_add(size_t addend1, size_t adden * and family") # v7.0. */ -#if defined(__has_builtin) && __has_builtin(__builtin_counted_by_ref) +#if defined(__has_builtin) +#if __has_builtin(__builtin_counted_by_ref) #define __flex_counter(FAM) __builtin_counted_by_ref(FAM) -#else +#endif +#endif + +#ifndef __flex_counter #define __flex_counter(FAM) ((void *)NULL) #endif