Skip to content

Commit 42a8ff8

Browse files
authored
[libc] Add "struct tm" declaration to <wchar.h> (#165795)
`<wchar.h>` should at least include the forward declaration of `struct tm`, since it's needed for the `wcsftime` declaration (also, see https://man7.org/linux/man-pages/man0/wchar.h.0p.html). Even though we don't yet have `wcsftime`, some downstream users (notably - libcxx) expects to see `struct tm` declaration there, to re-declare it under `std` namespace: https://github.com/llvm/llvm-project/blob/c46bfed1a484d30cd251a9a225649d74e3bf0af5/libcxx/include/cwchar#L135 So, add this type declaration to llvm-libc version of `wchar.h` now.
1 parent 067e205 commit 42a8ff8

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

libc/include/wchar.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ macros:
66
types:
77
- type_name: FILE
88
- type_name: size_t
9+
# TODO: Remove this once we have a function declaration using "struct tm"
10+
# (wcsftime). We're declaring it here now, since libc++ expects
11+
# forward-declaration of "struct tm" in the <wchar.h> header.
12+
- type_name: struct_tm
913
- type_name: wint_t
1014
- type_name: wchar_t
1115
- type_name: mbstate_t

0 commit comments

Comments
 (0)