Skip to content

Commit 6a98752

Browse files
committed
CLANG_ONLY
Created using spr 1.3.4
1 parent 08cb293 commit 6a98752

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

libcxx/src/iostream.cpp

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,20 @@ union stream_data {
3838
#define CHAR_MANGLING_wchar_t "_W"
3939
#define CHAR_MANGLING(CharT) CHAR_MANGLING_##CharT
4040

41+
#ifdef _LIBCPP_COMPILER_CLANG_BASED
42+
# define STRING_DATA_CONSTINIT constinit
43+
#else
44+
# define STRING_DATA_CONSTINIT
45+
#endif
46+
4147
#ifdef _LIBCPP_ABI_MICROSOFT
4248
# define STREAM(StreamT, BufferT, CharT, var) \
43-
constinit stream_data<StreamT<CharT>, BufferT<CharT>> var __asm__( \
49+
STRING_DATA_CONSTINIT stream_data<StreamT<CharT>, BufferT<CharT>> var __asm__( \
4450
"?" #var "@" ABI_NAMESPACE_STR "@std@@3V?$" #StreamT \
4551
"@" CHAR_MANGLING(CharT) "U?$char_traits@" CHAR_MANGLING(CharT) "@" ABI_NAMESPACE_STR "@std@@@12@A") var = {}
4652
#else
47-
# define STREAM(StreamT, BufferT, CharT, var) constinit stream_data<StreamT<CharT>, BufferT<CharT>> var = {}
53+
# define STREAM(StreamT, BufferT, CharT, var) \
54+
STRING_DATA_CONSTINIT stream_data<StreamT<CharT>, BufferT<CharT>> var = {}
4855
#endif
4956

5057
// These definitions and the declarations in <iostream> technically cause ODR violations, since they have different

0 commit comments

Comments
 (0)