Skip to content

Commit

Permalink
Remove check for _MSC_VER in internal_cpuid.h (AcademySoftwareFoundat…
Browse files Browse the repository at this point in the history
…ion#1528)

As noted in AcademySoftwareFoundation#1445, _MSC_VER should only be used to detect msvc, not
for Windows. The _WIN32 check should be sufficient. The extra check
for _MSC_VER fails when cross-compiling from Linux to Windows.

Signed-off-by: Cary Phillips <cary@ilm.com>
  • Loading branch information
cary-ilm committed Sep 23, 2023
1 parent 5240892 commit 7b80467
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/lib/OpenEXRCore/internal_cpuid.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#endif

#if OPENEXR_ENABLE_X86_SIMD_CHECK
# if defined(_MSC_VER) && defined(_WIN32)
# if defined(_WIN32)
# include <intrin.h>
# else
# include <cpuid.h>
Expand Down Expand Up @@ -51,7 +51,7 @@ check_for_x86_simd (int* f16c, int* avx, int* sse2)

#elif OPENEXR_ENABLE_X86_SIMD_CHECK

# if defined(_MSC_VER) && defined(_WIN32)
# if defined(_WIN32)
int regs[4]={0}, osxsave;

__cpuid (regs, 0);
Expand Down

0 comments on commit 7b80467

Please sign in to comment.