From 04b7cd62ee0b929b60b9f3ac0ecb21d4f8e37c67 Mon Sep 17 00:00:00 2001 From: UnknownShadow200 Date: Thu, 9 Jul 2020 21:35:16 +1000 Subject: [PATCH] Use DynamicLib_Get2 instead of dlsym for GetMenuBarEventTarget using -2 for lib probably breaks powerpc, which I will get around to fixing eventually --- src/Window.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Window.c b/src/Window.c index c617db267..413ba8201 100644 --- a/src/Window.c +++ b/src/Window.c @@ -2058,7 +2058,6 @@ void Window_DisableRawMouse(void) { *#########################################################################################################################*/ #if defined CC_BUILD_CARBON #include -#include static WindowRef win_handle; static cc_bool win_fullscreen, showingDialog; @@ -2311,8 +2310,9 @@ static void HookEvents(void) { /* However, we cannot use that since the event loop is managed by us instead. */ /* Unfortunately, there is no proper API to duplicate that behaviour, so reply */ /* on the undocumented GetMenuBarEventTarget to achieve similar behaviour. */ - /* TODO: Use DynamicLib API instead of dlsym */ - getMenuBarEventTarget = dlsym(RTLD_DEFAULT, "GetMenuBarEventTarget"); + /* TODO: Check if this still works on PowerPC */ +#define _RTLD_DEFAULT ((void*)-2) + getMenuBarEventTarget = DynamicLib_Get2(_RTLD_DEFAULT, "GetMenuBarEventTarget"); InstallStandardEventHandler(GetApplicationEventTarget()); /* TODO: Why does this not work properly until user activates another window */