From 101acff2e5df21378b5764660afc0ec84ce6a1a6 Mon Sep 17 00:00:00 2001 From: Joseph Huber Date: Tue, 13 Aug 2024 16:02:43 -0500 Subject: [PATCH] [libc] Define 'size_t' in `time.h` and `uchar.h` (#103441) Summary: The standard says the following: The header shall define the clock_t, size_t, time_t, types as described in . I couldn't find one for `uchar.h` but it needs it once we define things like `mbrtoc8`. --- libc/include/time.h.def | 2 -- libc/include/uchar.h.def | 1 - libc/newhdrgen/yaml/time.yaml | 1 + libc/newhdrgen/yaml/uchar.yaml | 1 + libc/spec/stdc.td | 2 ++ 5 files changed, 4 insertions(+), 3 deletions(-) diff --git a/libc/include/time.h.def b/libc/include/time.h.def index 3776dfcadad2..2355e8822fad 100644 --- a/libc/include/time.h.def +++ b/libc/include/time.h.def @@ -11,8 +11,6 @@ #include "__llvm-libc-common.h" #include "llvm-libc-macros/time-macros.h" -#include "llvm-libc-types/clock_t.h" -#include "llvm-libc-types/clockid_t.h" %%public_api() diff --git a/libc/include/uchar.h.def b/libc/include/uchar.h.def index 83400f4aba2e..31b7fcb73ded 100644 --- a/libc/include/uchar.h.def +++ b/libc/include/uchar.h.def @@ -10,7 +10,6 @@ #define LLVM_LIBC_UCHAR_H #include "__llvm-libc-common.h" -#include "llvm-libc-types/mbstate_t.h" %%public_api() diff --git a/libc/newhdrgen/yaml/time.yaml b/libc/newhdrgen/yaml/time.yaml index 64a112be091f..d2344671831c 100644 --- a/libc/newhdrgen/yaml/time.yaml +++ b/libc/newhdrgen/yaml/time.yaml @@ -7,6 +7,7 @@ types: - type_name: struct_tm - type_name: time_t - type_name: clock_t + - type_name: size_t enums: [] objects: [] functions: diff --git a/libc/newhdrgen/yaml/uchar.yaml b/libc/newhdrgen/yaml/uchar.yaml index dd111af6294d..18ca840612e0 100644 --- a/libc/newhdrgen/yaml/uchar.yaml +++ b/libc/newhdrgen/yaml/uchar.yaml @@ -7,6 +7,7 @@ types: - type_name: char16_t - type_name: char8_t - type_name: mbstate_t + - type_name: size_t enums: [] objects: [] functions: [] diff --git a/libc/spec/stdc.td b/libc/spec/stdc.td index e06a4f9b268e..74afb60725b7 100644 --- a/libc/spec/stdc.td +++ b/libc/spec/stdc.td @@ -1475,6 +1475,7 @@ def StdC : StandardSpec<"stdc"> { StructTmType, StructTimeSpec, TimeTType, + SizeTType, ], [], // Enumerations [ @@ -1562,6 +1563,7 @@ def StdC : StandardSpec<"stdc"> { Char8TType, Char16TType, Char32TType, + SizeTType, ], [], // Enumerations []