Skip to content

Commit 035bfdf

Browse files
[libc] improve macro guards
1 parent 43126f7 commit 035bfdf

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

libc/src/__support/macros/attributes.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -91,25 +91,25 @@ LIBC_THREAD_MODE_EXTERNAL.
9191
#define LIBC_NO_SANITIZE_OOB_ACCESS
9292
#endif
9393

94-
#if __has_attribute(lifetimebound)
94+
#if __has_cpp_attribute(clang::lifetimebound)
9595
#define LIBC_LIFETIME_BOUND [[clang::lifetimebound]]
9696
#else
9797
#define LIBC_LIFETIME_BOUND
9898
#endif
9999

100-
#if __has_attribute(lifetime_capture_by)
100+
#if __has_cpp_attribute(clang::lifetime_capture_by)
101101
#define LIBC_LIFETIME_CAPTURE_BY(X) [[clang::lifetime_capture_by(X)]]
102102
#else
103103
#define LIBC_LIFETIME_CAPTURE_BY(X)
104104
#endif
105105

106-
#if defined(__clang__)
106+
#if __has_cpp_attribute(gsl::Pointer)
107107
#define LIBC_GSL_POINTER [[gsl::Pointer]]
108108
#else
109109
#define LIBC_GSL_POINTER
110110
#endif
111111

112-
#if defined(__clang__)
112+
#if __has_cpp_attribute(gsl::Owner)
113113
#define LIBC_GSL_OWNER [[gsl::Owner]]
114114
#else
115115
#define LIBC_GSL_OWNER

0 commit comments

Comments
 (0)