From aa8fe4eb559c5ad9eee916ba07453948dba546cc Mon Sep 17 00:00:00 2001 From: Yifan Zhu Date: Fri, 14 Jun 2024 13:48:53 -0700 Subject: [PATCH] [libc] fix preferred_type attribute detection --- libc/src/__support/macros/attributes.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libc/src/__support/macros/attributes.h b/libc/src/__support/macros/attributes.h index 7e8e2ddfac9b102..c6474673de85a77 100644 --- a/libc/src/__support/macros/attributes.h +++ b/libc/src/__support/macros/attributes.h @@ -42,7 +42,7 @@ #define LIBC_CONSTINIT #endif -#ifdef __clang__ +#if defined(__clang__) && __has_attribute(preferred_type) #define LIBC_PREFERED_TYPE(TYPE) [[clang::preferred_type(TYPE)]] #else #define LIBC_PREFERED_TYPE(TYPE)