Skip to content

Commit

Permalink
Fix Mac build break
Browse files Browse the repository at this point in the history
gmtime_r takes in a time_t, which is not necessarily
the same type as an int64_t.

Change-Id: I0c049ca373b71b6718d3a5e718802a48c7460b3d
  • Loading branch information
jduo committed Jun 23, 2022
1 parent 963c1cd commit 03f9ae5
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/test/src/result-conversions-test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,10 @@
namespace {
void GetTimeForMillisSinceEpoch(tm& date, int64_t value) {
#if defined(_WIN32)
gmtime_s(&date, &value);
gmtime_s(&date, &value);
#else
gmtime_r(&value, &date);
time_t time_value = static_cast<time_t>(value);
gmtime_r(&time_value, &date);
#endif
}

Expand Down

0 comments on commit 03f9ae5

Please sign in to comment.