Skip to content

Commit 97ad4a7

Browse files
committed
Applied feedback
- headers fixed - included `stdint-macros.h` instead of `stdint.h` - Updated dependencies of `char16_t` and `char32_t` - Added uchar support for linux-riscv - Added uchar & wchar support for linux-arm & linux-aarch64 - Added UCharAPI type to linux/api.td
1 parent 5e96b86 commit 97ad4a7

File tree

8 files changed

+39
-13
lines changed

8 files changed

+39
-13
lines changed

libc/config/linux/aarch64/headers.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ set(TARGET_PUBLIC_HEADERS
2525
libc.include.threads
2626
libc.include.time
2727
libc.include.unistd
28+
libc.include.wchar
29+
libc.include.uchar
2830

2931
libc.include.sys_ioctl
3032
# Disabled due to epoll_wait syscalls not being available on this platform.

libc/config/linux/api.td

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,15 @@ def WCharAPI : PublicAPI<"wchar.h"> {
206206
];
207207
}
208208

209+
def UCharAPI : PublicAPI<"uchar.h"> {
210+
let Types = [
211+
"mbstate_t",
212+
"char8_t",
213+
"char16_t",
214+
"char32_t",
215+
];
216+
}
217+
209218
def SysRandomAPI : PublicAPI<"sys/random.h"> {
210219
let Types = ["size_t", "ssize_t"];
211220
}

libc/config/linux/arm/headers.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ set(TARGET_PUBLIC_HEADERS
1212
libc.include.string
1313
libc.include.strings
1414
libc.include.search
15+
libc.include.wchar
16+
libc.include.uchar
1517

1618
# Disabled due to epoll_wait syscalls not being available on this platform.
1719
# libc.include.sys_epoll

libc/config/linux/riscv/headers.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ set(TARGET_PUBLIC_HEADERS
2828
libc.include.time
2929
libc.include.unistd
3030
libc.include.wchar
31+
libc.include.uchar
3132

3233
libc.include.arpa_inet
3334

libc/include/llvm-libc-types/CMakeLists.txt

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,20 @@ add_header(struct_termios HDR struct_termios.h DEPENDS .cc_t .speed_t .tcflag_t)
9191
add_header(__getoptargv_t HDR __getoptargv_t.h)
9292
add_header(wchar_t HDR wchar_t.h)
9393
add_header(char8_t HDR char8_t.h)
94-
add_header(char16_t HDR char16_t.h)
95-
add_header(char32_t HDR char32_t.h)
94+
add_header(
95+
char16_t
96+
HDR
97+
char16_t.h
98+
DEPENDS
99+
libc.include.llvm-libc-macros.stdint_macros
100+
)
101+
add_header(
102+
char32_t
103+
HDR
104+
char32_t.h
105+
DEPENDS
106+
libc.include.llvm-libc-macros.stdint_macros
107+
)
96108
add_header(wint_t HDR wint_t.h)
97109
add_header(sa_family_t HDR sa_family_t.h)
98110
add_header(socklen_t HDR socklen_t.h)
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
1-
//===-- Definition of clock_t type ----------------------------------------===//
1+
//===-- Definition of char16_t type ---------------------------------------===//
22
//
33
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
44
// See https://llvm.org/LICENSE.txt for license information.
55
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
66
//
77
//===----------------------------------------------------------------------===//
88

9-
#ifndef LLVM_LIBC_TYPES_CHAR8_T_H
10-
#define LLVM_LIBC_TYPES_CHAR8_T_H
9+
#ifndef LLVM_LIBC_TYPES_CHAR16_T_H
10+
#define LLVM_LIBC_TYPES_CHAR16_T_H
1111

1212
#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L
13-
#include <stdint.h>
13+
#include "../llvm-libc-macros/stdint-macros.h"
1414
typedef uint_least16_t char16_t;
1515
#endif
1616

17-
#endif // LLVM_LIBC_TYPES_CHAR8_T_H
17+
#endif // LLVM_LIBC_TYPES_CHAR16_T_H
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
1-
//===-- Definition of clock_t type ----------------------------------------===//
1+
//===-- Definition of char32_t type ---------------------------------------===//
22
//
33
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
44
// See https://llvm.org/LICENSE.txt for license information.
55
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
66
//
77
//===----------------------------------------------------------------------===//
88

9-
#ifndef LLVM_LIBC_TYPES_CHAR8_T_H
10-
#define LLVM_LIBC_TYPES_CHAR8_T_H
9+
#ifndef LLVM_LIBC_TYPES_CHAR32_T_H
10+
#define LLVM_LIBC_TYPES_CHAR32_T_H
1111

1212
#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L
13-
#include <stdint.h>
13+
#include "../llvm-libc-macros/stdint-macros.h"
1414
typedef uint_least32_t char32_t;
1515
#endif
1616

17-
#endif // LLVM_LIBC_TYPES_CHAR8_T_H
17+
#endif // LLVM_LIBC_TYPES_CHAR32_T_H

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//===-- Definition of clock_t type ----------------------------------------===//
1+
//===-- Definition of char8_t type ----------------------------------------===//
22
//
33
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
44
// See https://llvm.org/LICENSE.txt for license information.

0 commit comments

Comments
 (0)