diff --git a/src/plugins/platforms/cocoa/qcocoahelpers.h b/src/plugins/platforms/cocoa/qcocoahelpers.h index 456129ffec5..22ea569c673 100644 --- a/src/plugins/platforms/cocoa/qcocoahelpers.h +++ b/src/plugins/platforms/cocoa/qcocoahelpers.h @@ -178,10 +178,6 @@ T qt_mac_resolveOption(const T &fallback, QWindow *window, const QByteArray &pro // ------------------------------------------------------------------------- -#if QT_POINTER_SIZE == 4 -#error "32-bit builds are not supported" -#endif - class QMacVersion { public: diff --git a/src/plugins/platforms/cocoa/qcocoahelpers.mm b/src/plugins/platforms/cocoa/qcocoahelpers.mm index 240f184be47..2048bccf657 100644 --- a/src/plugins/platforms/cocoa/qcocoahelpers.mm +++ b/src/plugins/platforms/cocoa/qcocoahelpers.mm @@ -406,7 +406,9 @@ QMacVersion::VersionTuple QMacVersion::versionsForImage(const mach_header *machH ); }; - auto commandCursor = uintptr_t(machHeader) + sizeof(mach_header_64); + const bool is64Bit = machHeader->magic == MH_MAGIC_64 || machHeader->magic == MH_CIGAM_64; + auto commandCursor = uintptr_t(machHeader) + (is64Bit ? sizeof(mach_header_64) : sizeof(mach_header)); + for (uint32_t i = 0; i < machHeader->ncmds; ++i) { load_command *loadCommand = reinterpret_cast(commandCursor); if (loadCommand->cmd == LC_VERSION_MIN_MACOSX) {