Skip to content

Commit a4c095a

Browse files
committed
build fixes
1 parent b42aef5 commit a4c095a

File tree

8 files changed

+43
-3
lines changed

8 files changed

+43
-3
lines changed

libc/hdr/CMakeLists.txt

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

213213
add_header_library(wchar_overlay HDRS wchar_overlay.h)
214214

215+
add_header_library(uchar_overlay HDRS uchar_overlay.h)
216+
215217
add_proxy_header_library(
216218
wchar_macros
217219
HDRS

libc/hdr/types/CMakeLists.txt

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,26 @@
1+
2+
add_proxy_header_library(
3+
char8_t
4+
HDRS
5+
char8_t.h
6+
DEPENDS
7+
libc.hdr.uchar_overlay
8+
FULL_BUILD_DEPENDS
9+
libc.include.llvm-libc-types.char8_t
10+
libc.include.uchar
11+
)
12+
13+
add_proxy_header_library(
14+
char32_t
15+
HDRS
16+
char32_t.h
17+
DEPENDS
18+
libc.hdr.uchar_overlay
19+
FULL_BUILD_DEPENDS
20+
libc.include.llvm-libc-types.char32_t
21+
libc.include.uchar
22+
)
23+
124
add_proxy_header_library(
225
div_t
326
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
@@ -381,3 +381,5 @@ add_subdirectory(HashTable)
381381
add_subdirectory(fixed_point)
382382

383383
add_subdirectory(time)
384+
385+
add_subdirectory(wchar)

libc/src/__support/wchar/mbstate.h

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

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

libc/src/__support/wchar/utf_ret.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,13 @@
1010
#define LLVM_LIBC_SRC___SUPPORT_UTF_RET_H
1111

1212
namespace LIBC_NAMESPACE_DECL {
13-
13+
namespace internal {
1414
template <typename T> struct utf_ret {
1515
T out;
1616
int error;
1717
};
1818

19+
} // namespace internal
1920
} // namespace LIBC_NAMESPACE_DECL
2021

2122
#endif // LLVM_LIBC_SRC___SUPPORT_UTF_RET_H

libc/test/src/__support/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -275,3 +275,4 @@ add_subdirectory(fixed_point)
275275
add_subdirectory(HashTable)
276276
add_subdirectory(time)
277277
add_subdirectory(threads)
278+
add_subdirectory(wchar)
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
add_custom_target(libc-support-wchar-tests)
2+
3+
add_libc_test(
4+
utf32_to_8_test
5+
SUITE
6+
libc-support-tests
7+
SRCS
8+
utf32_to_8_test.cpp
9+
DEPENDS
10+
libc.src.__support.wchar.character_converter
11+
)

0 commit comments

Comments
 (0)