Skip to content

Commit

Permalink
Merge pull request #52 from jibsen/fix-platform-msvc
Browse files Browse the repository at this point in the history
Fix preprocessor check for inline asm.

With MSVC inline asm is only available when compiling for x86. WIN32 is defined for all of x86, x64, and ARM. This checks for MSVC and x86 instead.

See
https://docs.microsoft.com/en-us/cpp/assembler/inline/inline-assembler
https://docs.microsoft.com/en-us/cpp/preprocessor/predefined-macros
  • Loading branch information
eeide committed Oct 31, 2017
2 parents 88701eb + f4207b8 commit b58bdca
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/platform.cpp
Expand Up @@ -64,7 +64,7 @@ static inline unsigned long read_time(void)
asm volatile("mftb %0" : "=r" (a));
return a;
}
# elif defined(WIN32)
# elif defined(_MSC_VER) && defined(_M_IX86)
static unsigned __int64 read_time(void)
{
unsigned l, h;
Expand Down

0 comments on commit b58bdca

Please sign in to comment.