Skip to content

Commit 4c0d805

Browse files
authored
[libc] Do not redefine wchar_t when compiling in C++ (llvm#110769)
Summary: This is a fundamental type in C++, so we can't redefine it.
1 parent e495231 commit 4c0d805

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

libc/include/llvm-libc-types/wchar_t.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@
99
#ifndef LLVM_LIBC_TYPES_WCHAR_T_H
1010
#define LLVM_LIBC_TYPES_WCHAR_T_H
1111

12+
// wchar_t is a fundamental type in C++.
13+
#ifndef __cplusplus
14+
1215
typedef __WCHAR_TYPE__ wchar_t;
1316

17+
#endif
18+
1419
#endif // LLVM_LIBC_TYPES_WCHAR_T_H

0 commit comments

Comments
 (0)