Skip to content

Commit 3d2c898

Browse files
authored
Merge pull request #82154 from phausler/pr/timespec_cast_fixes
static cast the tv_sec for the timespec constructions is the dispatch scheduler
2 parents 2237d86 + 1e0b914 commit 3d2c898

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

stdlib/public/Concurrency/DispatchGlobalExecutor.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -319,9 +319,14 @@ clock_and_value_to_time(int clock, long long sec, long long nsec) {
319319
.tv_sec = sec,
320320
.tv_nsec = static_cast<long>(nsec)
321321
};
322+
#elif defined(__APPLE__)
323+
struct timespec ts = {
324+
.tv_sec = static_cast<__darwin_time_t>(sec),
325+
.tv_nsec = nsec
326+
};
322327
#else
323328
struct timespec ts = {
324-
.tv_sec = sec,
329+
.tv_sec = static_cast<long>(sec),
325330
.tv_nsec = nsec
326331
};
327332
#endif

0 commit comments

Comments
 (0)