Skip to content

Commit f8a0c53

Browse files
committed
[libc][macros] Define LIBC_CONSTINIT
1 parent d6bbe2e commit f8a0c53

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

libc/src/__support/macros/attributes.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,10 @@
3030
#define LIBC_THREAD_LOCAL thread_local
3131
#endif
3232

33+
#if __cplusplus >= 202002L
34+
#define LIBC_CONSTINIT constinit
35+
#else
36+
#define LIBC_CONSTINIT __attribute__((__require_constant_initialization__))
37+
#endif
38+
3339
#endif // LLVM_LIBC_SRC___SUPPORT_MACROS_ATTRIBUTES_H

0 commit comments

Comments
 (0)