Add defined(__clang__) to defined(__GNUC__) checks

This commit is contained in:
Nigel Tao committed 2021-10-17 12:14:54 +11:00
1 parent db5a407bab
commit e317f04bfd
4 files changed
+26 -16

No files matched your search

+7 -4
View File
@@ -274,8 +274,9 @@ wuffs_base__cpu_arch__have_x86_sse42() {
#endif
#endif
// Clang also defines "__GNUC__".
#if defined(__GNUC__)
// The "defined(__clang__)" isn't redundant. While vanilla clang defines
// __GNUC__, clang-cl (which mimics MSVC's cl.exe) does not.
#if defined(__GNUC__) || defined(__clang__)
#define WUFFS_BASE__POTENTIALLY_UNUSED __attribute__((unused))
#define WUFFS_BASE__WARN_UNUSED_RESULT __attribute__((warn_unused_result))
#else
@@ -736,7 +737,9 @@ wuffs_base__multiply_u64(uint64_t x, uint64_t y) {
// --------
#if defined(__GNUC__) && (__SIZEOF_LONG__ == 8)
// The "defined(__clang__)" isn't redundant. While vanilla clang defines
// __GNUC__, clang-cl (which mimics MSVC's cl.exe) does not.
#if (defined(__GNUC__) || defined(__clang__)) && (__SIZEOF_LONG__ == 8)
static inline uint32_t //
wuffs_base__count_leading_zeroes_u64(uint64_t u) {
@@ -780,7 +783,7 @@ wuffs_base__count_leading_zeroes_u64(uint64_t u) {
return n;
}
#endif // defined(__GNUC__) && (__SIZEOF_LONG__ == 8)
#endif // (defined(__GNUC__) || defined(__clang__)) && (__SIZEOF_LONG__ == 8)
// --------