Skip to content

Commit 195da3d

Browse files
michaelrj-googleflovent
authored andcommitted
[libc] fix get_epoch constexpr error (llvm#126818)
get_epoch calls mktime_internal which isn't constexpr. For now, just remove the constexpr from get_epoch.
1 parent 3008086 commit 195da3d

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

libc/src/time/time_utils.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -328,9 +328,7 @@ class TMReader final {
328328
return BASE_YEAR + IS_NEXT_YEAR;
329329
}
330330

331-
LIBC_INLINE constexpr time_t get_epoch() const {
332-
return mktime_internal(timeptr);
333-
}
331+
LIBC_INLINE time_t get_epoch() const { return mktime_internal(timeptr); }
334332

335333
// returns the timezone offset in microwave time:
336334
// return (hours * 100) + minutes;

0 commit comments

Comments
 (0)