Skip to content

Commit

Permalink
[libc] Move struct timespec from POSIX to StdC (llvm#85010)
Browse files Browse the repository at this point in the history
`struct timespec` is actually defined in the C standard, not POSIX.
  • Loading branch information
petrhosek committed Mar 13, 2024
1 parent 096d061 commit 34cf684
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
4 changes: 0 additions & 4 deletions libc/spec/posix.td
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,6 @@ def StructDirentPtr : PtrType<StructDirent>;
def StructDirentPtrPtr : PtrType<StructDirentPtr>;
def ConstStructDirentPtrPtr : ConstType<StructDirentPtrPtr>;

def StructTimeSpec : NamedType<"struct timespec">;
def StructTimeSpecPtr : PtrType<StructTimeSpec>;
def ConstStructTimeSpecPtr : ConstType<StructTimeSpecPtr>;

def StructSchedParam : NamedType<"struct sched_param">;
def StructSchedParamPtr : PtrType<StructSchedParam>;
def ConstStructSchedParamPtr : ConstType<StructSchedParamPtr>;
Expand Down
4 changes: 4 additions & 0 deletions libc/spec/spec.td
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,10 @@ def SigHandlerT : NamedType<"__sighandler_t">;

def TimeTType : NamedType<"time_t">;

def StructTimeSpec : NamedType<"struct timespec">;
def StructTimeSpecPtr : PtrType<StructTimeSpec>;
def ConstStructTimeSpecPtr : ConstType<StructTimeSpecPtr>;

def BSearchCompareT : NamedType<"__bsearchcompare_t">;
def QSortCompareT : NamedType<"__qsortcompare_t">;

Expand Down
1 change: 1 addition & 0 deletions libc/spec/stdc.td
Original file line number Diff line number Diff line change
Expand Up @@ -1202,6 +1202,7 @@ def StdC : StandardSpec<"stdc"> {
[ // Types
ClockT,
StructTmType,
StructTimeSpec,
TimeTType,
],
[], // Enumerations
Expand Down

0 comments on commit 34cf684

Please sign in to comment.