Invert dependency to avoid compile issues

This commit is contained in:
Henrik Rydgård
2023-01-05 08:38:53 +01:00
parent a3e5e475cd
commit ab6fafb6eb
5 changed files with 57 additions and 36 deletions
+21 -17
View File
@@ -28,6 +28,27 @@
#include "Common/Thread/ThreadUtil.h"
#include "Common/Data/Encoding/Utf8.h"
AttachDetachFunc g_attach;
AttachDetachFunc g_detach;
void AttachThreadToJNI() {
if (g_attach) {
g_attach();
}
}
void DetachThreadFromJNI() {
if (g_detach) {
g_detach();
}
}
void RegisterAttachDetach(AttachDetachFunc attach, AttachDetachFunc detach) {
g_attach = attach;
g_detach = detach;
}
#if (PPSSPP_PLATFORM(ANDROID) || PPSSPP_PLATFORM(LINUX)) && !defined(_GNU_SOURCE)
#define _GNU_SOURCE
#endif
@@ -67,23 +88,6 @@ static EXCEPTION_DISPOSITION NTAPI ignore_handler(EXCEPTION_RECORD *rec,
}
#endif
void AttachThreadToJNI() {
#if PPSSPP_PLATFORM(ANDROID)
Android_AttachThreadToJNI();
#else
// Do nothing
#endif
}
void DetachThreadFromJNI() {
#if PPSSPP_PLATFORM(ANDROID)
Android_DetachThreadFromJNI();
#else
// Do nothing
#endif
}
#if PPSSPP_PLATFORM(WINDOWS) && !PPSSPP_PLATFORM(UWP)
typedef HRESULT (WINAPI *TSetThreadDescription)(HANDLE, PCWSTR);