Skip to content

Commit 6adb80d

Browse files
[libc] Always provide char8/16/32_t
The current definitions only provide these types if the stdc version is 2023 for char8_t or 2011 for char16/32_t. None of our other types are currently handled this way. If we want to provide these headers only under certain circumstances we should add guards to the types in the public header, since internal code should always have access to these types.
1 parent 06f6a77 commit 6adb80d

File tree

3 files changed

+1
-6
lines changed

3 files changed

+1
-6
lines changed

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,7 @@
99
#ifndef LLVM_LIBC_TYPES_CHAR16_T_H
1010
#define LLVM_LIBC_TYPES_CHAR16_T_H
1111

12-
#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L
1312
#include "../llvm-libc-macros/stdint-macros.h"
1413
typedef uint_least16_t char16_t;
15-
#endif
1614

1715
#endif // LLVM_LIBC_TYPES_CHAR16_T_H

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,7 @@
99
#ifndef LLVM_LIBC_TYPES_CHAR32_T_H
1010
#define LLVM_LIBC_TYPES_CHAR32_T_H
1111

12-
#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L
1312
#include "../llvm-libc-macros/stdint-macros.h"
1413
typedef uint_least32_t char32_t;
15-
#endif
1614

1715
#endif // LLVM_LIBC_TYPES_CHAR32_T_H

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

0 commit comments

Comments
 (0)