macOS moltenVK support and SIGBUS handling (#11252)

This commit is contained in:
nastys 2021-12-12 21:35:56 +01:00 committed by GitHub
parent 2f93df480b
commit 08333e0876
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 26 additions and 5 deletions

View file

@ -49,7 +49,7 @@ DYNAMIC_IMPORT("ntdll.dll", NtSetTimerResolution, NTSTATUS(ULONG DesiredResoluti
#include <sys/resource.h>
#endif
#ifdef __APPLE__
#if defined(__APPLE__) && defined(BLOCKS) // BLOCKS is required for dispatch_sync, but GCC-11 does not support it
#include <dispatch/dispatch.h>
#endif
@ -130,8 +130,9 @@ LOG_CHANNEL(q_debug, "QDEBUG");
dlg.exec();
};
#ifdef __APPLE__
#if defined(__APPLE__) && defined(BLOCKS) // BLOCKS is required for dispatch_sync, but GCC-11 does not support it
// Cocoa access is not allowed outside of the main thread
// Prevents crash dialogs from freezing the program
if (!pthread_main_np())
{
dispatch_sync(dispatch_get_main_queue(), ^ { show_report(text); });