mirror of https://github.com/PentHertz/srsLTE.git
add precompiler guards to restrict builtin use to gcc and clang
This commit is contained in:
parent
8ed8b94ca5
commit
ac375f07d9
|
@ -89,6 +89,7 @@ struct zerobit_counter {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#ifdef __GNUC__ // clang and gcc
|
||||||
/// Specializations for unsigned
|
/// Specializations for unsigned
|
||||||
template <typename Integer>
|
template <typename Integer>
|
||||||
struct zerobit_counter<Integer, sizeof(unsigned)> {
|
struct zerobit_counter<Integer, sizeof(unsigned)> {
|
||||||
|
@ -101,7 +102,9 @@ struct zerobit_counter<Integer, sizeof(unsigned)> {
|
||||||
return (value) ? __builtin_ctz(value) : std::numeric_limits<Integer>::digits;
|
return (value) ? __builtin_ctz(value) : std::numeric_limits<Integer>::digits;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef __GNUC__ // clang and gcc
|
||||||
/// Specializations for unsigned long
|
/// Specializations for unsigned long
|
||||||
template <typename Integer>
|
template <typename Integer>
|
||||||
struct zerobit_counter<Integer, sizeof(unsigned long)> {
|
struct zerobit_counter<Integer, sizeof(unsigned long)> {
|
||||||
|
@ -114,6 +117,7 @@ struct zerobit_counter<Integer, sizeof(unsigned long)> {
|
||||||
return (value) ? __builtin_ctzl(value) : std::numeric_limits<Integer>::digits;
|
return (value) ? __builtin_ctzl(value) : std::numeric_limits<Integer>::digits;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
#endif
|
||||||
|
|
||||||
} // namespace detail
|
} // namespace detail
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue