Skip to content

Commit 2c9ecbb

Browse files
committed
fix: gmtime_r on windows
1 parent 3650aed commit 2c9ecbb

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

cuda_bindings/benchmarks/benchmarks/cpp/bench_support.hpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,11 @@ inline std::string iso_now() {
8383
const auto now = std::chrono::system_clock::now();
8484
const std::time_t t = std::chrono::system_clock::to_time_t(now);
8585
std::tm tm{};
86+
#ifdef _WIN32
87+
gmtime_s(&tm, &t);
88+
#else
8689
gmtime_r(&t, &tm);
90+
#endif
8791
char buf[64];
8892
std::strftime(buf, sizeof(buf), "%Y-%m-%d %H:%M:%S", &tm);
8993
return std::string(buf);

0 commit comments

Comments
 (0)