Skip to content

Commit 2c64c40

Browse files
[chrono] Avoid redefining CLOCK_PROCESS_CPUTIME_ID and CLOCK_THREAD_CPUTIME_ID on Windows (#10650)
1 parent 22ae053 commit 2c64c40

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

engine/util/chrono.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,12 @@ namespace
2626
{
2727
#if defined(SC_WINDOWS)
2828

29-
enum : int { CLOCK_PROCESS_CPUTIME_ID, CLOCK_THREAD_CPUTIME_ID };
29+
#ifndef CLOCK_PROCESS_CPUTIME_ID
30+
constexpr int CLOCK_PROCESS_CPUTIME_ID = 2;
31+
#endif
32+
#ifndef CLOCK_THREAD_CPUTIME_ID
33+
constexpr int CLOCK_THREAD_CPUTIME_ID = 3;
34+
#endif
3035
std::chrono::nanoseconds do_clock_gettime( int clock_id )
3136
{
3237
FILETIME lpCreationTime, lpExitTime, lpKernelTime, lpUserTime;

0 commit comments

Comments
 (0)