Skip to content

Commit

Permalink
Do not fail compilation of TscClock example on unsupported platforms
Browse files Browse the repository at this point in the history
  • Loading branch information
erenon committed Mar 25, 2022
1 parent 1b72cef commit 2de2fa0
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions example/TscClock.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,16 @@
#include <fstream>
#include <iostream>

// Make __rdtsc available. Works on GCC, Clang, MSVC.
// Make __rdtsc available. Works on x86 GCC, Clang, MSVC.
// Other platforms might need different treatment.
#ifdef _WIN32
#include <intrin.h>
#pragma intrinsic(__rdtsc)
#else
#elif defined(__i386__) or defined(__x86_64__)
#include <x86intrin.h>
#else
// other platform - provide a dummy implementation
std::uint64_t __rdtsc() { return 0; }
#endif

// Define a log macro, similar to BINLOG_INFO_W,
Expand Down

0 comments on commit 2de2fa0

Please sign in to comment.