Skip to content

Commit 6311f03

Browse files
authored
[libc] Build fixes for widechar characterconverter (#143805)
Build fixes for wchar CharacterConverter class
1 parent d1ca8d8 commit 6311f03

File tree

6 files changed

+32
-3
lines changed

6 files changed

+32
-3
lines changed

libc/hdr/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,8 @@ add_proxy_header_library(
221221

222222
add_header_library(wchar_overlay HDRS wchar_overlay.h)
223223

224+
add_header_library(uchar_overlay HDRS uchar_overlay.h)
225+
224226
add_proxy_header_library(
225227
wchar_macros
226228
HDRS

libc/hdr/types/CMakeLists.txt

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,25 @@
1+
add_proxy_header_library(
2+
char8_t
3+
HDRS
4+
char8_t.h
5+
DEPENDS
6+
libc.hdr.uchar_overlay
7+
FULL_BUILD_DEPENDS
8+
libc.include.llvm-libc-types.char8_t
9+
libc.include.uchar
10+
)
11+
12+
add_proxy_header_library(
13+
char32_t
14+
HDRS
15+
char32_t.h
16+
DEPENDS
17+
libc.hdr.uchar_overlay
18+
FULL_BUILD_DEPENDS
19+
libc.include.llvm-libc-types.char32_t
20+
libc.include.uchar
21+
)
22+
123
add_proxy_header_library(
224
div_t
325
HDRS

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,7 @@
99
#ifndef LLVM_LIBC_TYPES_CHAR8_T_H
1010
#define LLVM_LIBC_TYPES_CHAR8_T_H
1111

12-
#if !defined(__cplusplus) && defined(__STDC_VERSION__) && \
13-
__STDC_VERSION__ >= 202311L
12+
#if !(defined(__cplusplus) && defined(__cpp_char8_t))
1413
typedef unsigned char char8_t;
1514
#endif
1615

libc/src/__support/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -391,4 +391,6 @@ add_subdirectory(fixed_point)
391391

392392
add_subdirectory(time)
393393

394+
add_subdirectory(wchar)
395+
394396
add_subdirectory(math)

libc/src/__support/wchar/mbstate.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
#define LLVM_LIBC_SRC___SUPPORT_MBSTATE_H
1111

1212
#include "hdr/types/char32_t.h"
13+
#include "src/__support/common.h"
1314
#include <stdint.h>
1415

1516
namespace LIBC_NAMESPACE_DECL {

libc/src/__support/wchar/utf_ret.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,16 @@
99
#ifndef LLVM_LIBC_SRC___SUPPORT_UTF_RET_H
1010
#define LLVM_LIBC_SRC___SUPPORT_UTF_RET_H
1111

12-
namespace LIBC_NAMESPACE_DECL {
12+
#include "src/__support/common.h"
1313

14+
namespace LIBC_NAMESPACE_DECL {
15+
namespace internal {
1416
template <typename T> struct utf_ret {
1517
T out;
1618
int error;
1719
};
1820

21+
} // namespace internal
1922
} // namespace LIBC_NAMESPACE_DECL
2023

2124
#endif // LLVM_LIBC_SRC___SUPPORT_UTF_RET_H

0 commit comments

Comments
 (0)