Skip to content

Commit 92770b6

Browse files
authored
[SYCL] Add support for libc++ in iostream_proxy.hpp (#6547)
1 parent 3d2b25e commit 92770b6

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

sycl/include/sycl/detail/iostream_proxy.hpp

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,13 @@
22
#include <istream>
33
#include <ostream>
44

5+
// Hotfix to account for the different namespaces in libstdc++ and libc++
6+
#ifdef _LIBCPP_BEGIN_NAMESPACE_STD
7+
_LIBCPP_BEGIN_NAMESPACE_STD
8+
#else
59
namespace std {
10+
#endif
11+
612
#if defined(_MT) && defined(_DLL)
713
#define __SYCL_EXTERN_STREAM_ATTRS __declspec(dllimport)
814
#else
@@ -18,4 +24,9 @@ extern __SYCL_EXTERN_STREAM_ATTRS ostream cerr;
1824
/// Linked to standard error (buffered)
1925
extern __SYCL_EXTERN_STREAM_ATTRS ostream clog;
2026
#undef __SYCL_EXTERN_STREAM_ATTRS
21-
} // namespace std
27+
28+
#ifdef _LIBCPP_END_NAMESPACE_STD
29+
_LIBCPP_END_NAMESPACE_STD
30+
#else
31+
} // namespace std
32+
#endif

0 commit comments

Comments
 (0)