Skip to content

Commit

Permalink
Restrict overmatching MACH ifdef to only trigger on OSX and Mach (#674)
Browse files Browse the repository at this point in the history
  • Loading branch information
Zopolis4 committed Aug 8, 2023
1 parent 4d79489 commit 289e3b1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions include/dmlc/timer.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#endif

#include <time.h>
#ifdef __MACH__
#if defined(__MACH__) && defined(__APPLE__)
#include <mach/clock.h>
#include <mach/mach.h>
#endif
Expand All @@ -28,7 +28,7 @@ inline double GetTime(void) {
#if DMLC_USE_CXX11
return std::chrono::duration<double>(
std::chrono::high_resolution_clock::now().time_since_epoch()).count();
#elif defined __MACH__
#elif defined(__MACH__) && defined(__APPLE__)
clock_serv_t cclock;
mach_timespec_t mts;
host_get_clock_service(mach_host_self(), CALENDAR_CLOCK, &cclock);
Expand Down

0 comments on commit 289e3b1

Please sign in to comment.