Skip to content

Commit a4e87da

Browse files
authored
[libc] Make headers compatible with C++ < 11 (llvm#123260)
C++11 introduced `noexcept`, but `throw()` can be used in older versions of the language.
1 parent 421fc04 commit a4e87da

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

libc/include/__llvm-libc-common.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,11 @@
3939
#define _Thread_local thread_local
4040

4141
#undef __NOEXCEPT
42+
#if __cplusplus >= 201103L
4243
#define __NOEXCEPT noexcept
44+
#else
45+
#define __NOEXCEPT throw()
46+
#endif
4347

4448
#else // not __cplusplus
4549

0 commit comments

Comments
 (0)