Skip to content

Commit a605ec7

Browse files
authored
[cxx-interop] Fix libstdc++ build failure on CentOS 7
CentOS 7 is shipped with an outdated version of libstdc++, which does not include `codecvt` stdlib header. Let's wrap the `#include` with `#if __has_include`.
1 parent 6707f33 commit a605ec7

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

stdlib/public/Cxx/libstdcxx.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@
3333
#include "array"
3434
#include "atomic"
3535
#include "chrono"
36-
#include "codecvt"
3736
#include "condition_variable"
3837
#include "forward_list"
3938
#include "future"
@@ -51,6 +50,11 @@
5150
#include "unordered_map"
5251
#include "unordered_set"
5352

53+
// libstdc++ 4.8.5 bundled with CentOS 7 does not include corecvt.
54+
#if __has_include("codecvt")
55+
#include "codecvt"
56+
#endif
57+
5458
// C++17 and newer:
5559

5660
#if __has_include("any")

0 commit comments

Comments
 (0)