From ac375f07d9e9b04453cf1e170cced05ff260aabb Mon Sep 17 00:00:00 2001 From: Francisco Date: Mon, 19 Apr 2021 10:44:30 +0100 Subject: [PATCH] add precompiler guards to restrict builtin use to gcc and clang --- lib/include/srsran/adt/bounded_bitset.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/include/srsran/adt/bounded_bitset.h b/lib/include/srsran/adt/bounded_bitset.h index 3faa87c0c..cd4eb732d 100644 --- a/lib/include/srsran/adt/bounded_bitset.h +++ b/lib/include/srsran/adt/bounded_bitset.h @@ -89,6 +89,7 @@ struct zerobit_counter { } }; +#ifdef __GNUC__ // clang and gcc /// Specializations for unsigned template struct zerobit_counter { @@ -101,7 +102,9 @@ struct zerobit_counter { return (value) ? __builtin_ctz(value) : std::numeric_limits::digits; } }; +#endif +#ifdef __GNUC__ // clang and gcc /// Specializations for unsigned long template struct zerobit_counter { @@ -114,6 +117,7 @@ struct zerobit_counter { return (value) ? __builtin_ctzl(value) : std::numeric_limits::digits; } }; +#endif } // namespace detail