Ported some more Apple-related fixes from PCem.

This commit is contained in:
OBattler
2021-09-03 19:23:50 +02:00
parent dc33476e0d
commit 136c136608
2 changed files with 21 additions and 0 deletions

View File

@@ -26,6 +26,13 @@
#include <string.h>
#include <time.h>
#include <wchar.h>
#ifdef __APPLE__
#include <string.h>
#include <dispatch/dispatch.h>
#ifdef __aarch64__
#include <pthread.h>
#endif
#endif
#define HAVE_STDARG_H
#include <86box/86box.h>
@@ -780,7 +787,13 @@ pc_init_modules(void)
mem_init();
#ifdef USE_DYNAREC
#if defined(__APPLE__) && defined(__aarch64__)
pthread_jit_write_protect_np(0);
#endif
codegen_init();
#if defined(__APPLE__) && defined(__aarch64__)
pthread_jit_write_protect_np(1);
#endif
#endif
keyboard_init();
@@ -1104,7 +1117,12 @@ pc_run(void)
if (title_update) {
swprintf(temp, sizeof_w(temp), mouse_msg[!!mouse_capture], fps);
#ifdef __APPLE__
/* Needed due to modifying the UI on the non-main thread is a big no-no. */
dispatch_async_f(dispatch_get_main_queue(), strdup(temp), _ui_window_title);
#else
ui_window_title(temp);
#endif
title_update = 0;
}
}

View File

@@ -3,6 +3,9 @@
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#if defined(__APPLE__) && defined(__aarch64__)
#include <pthread.h>
#endif
#include <wchar.h>
#include <math.h>
#ifndef INFINITY