Skip to content

Commit 704e13f

Browse files
committed
fix(win): oiiotool --buildinfo misreported platform on MSVS (#5027)
Need to test some MSVS-specific macros to determine what architecture to report. And especially, if it doesn't know the processor architecture, it still should be *appending* that to the platform, not replacing it! This caused MSVS-compiled OIIO on Windows to report "unknown arch?" Signed-off-by: Larry Gritz <lg@larrygritz.com>
1 parent 08dec42 commit 704e13f

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/libOpenImageIO/imageio.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -257,14 +257,15 @@ oiio_build_platform()
257257
platform = "UnknownOS";
258258
#endif
259259
platform += "/";
260-
#if defined(__x86_64__)
260+
#if defined(__x86_64__) || defined(_M_AMD64)
261261
platform += "x86_64";
262-
#elif defined(__i386__)
262+
#elif defined(__i386__) || defined(_M_IX86)
263263
platform += "i386";
264-
#elif defined(_M_ARM64) || defined(__aarch64__) || defined(__aarch64)
264+
#elif defined(_M_ARM64) || defined(__aarch64__) || defined(__aarch64) \
265+
|| defined(__ARM_ARCH)
265266
platform += "ARM";
266267
#else
267-
platform = "unknown arch?";
268+
platform += "unknown arch?";
268269
#endif
269270
return platform;
270271
}

0 commit comments

Comments
 (0)