Skip to content

Commit

Permalink
Fix Visual Studio on ARM Compilation (#1315)
Browse files Browse the repository at this point in the history
* Fix Visual Studio on ARM Compilation.

This fixes Windows on ARM native Visual Studio compilation. The current #ifdef
logic assumes that Visual Studio always targets x86/x64, which is no longer the case.

Unfortunately based on:

https://learn.microsoft.com/en-us/cpp/preprocessor/predefined-macros?view=msvc-170

there doesn't seem to be a single macro to test Intel vs ARM compilation.

With this change, OpenEXR compiles native to ARM on Windows and passes its
test suite.

Signed-off-by: Jean-Francois Panisset <panisset@gmail.com>

* Typo fix

Signed-off-by: Jean-Francois Panisset <panisset@gmail.com>

Signed-off-by: Jean-Francois Panisset <panisset@gmail.com>
  • Loading branch information
jfpanisset authored Nov 16, 2022
1 parent 7aa8489 commit bef47cf
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/lib/OpenEXR/ImfSystemSpecific.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ cpuid (int n, int& eax, int& ebx, int& ecx, int& edx)
: /* Clobber */);
}

#elif defined(_MSC_VER)
#elif defined(_MSC_VER) && ( defined(_M_IX86) || ( defined(_M_AMD64) && !defined(_M_ARM64EC) ) )

// Helper functions for MSVC
void
Expand Down

0 comments on commit bef47cf

Please sign in to comment.