mirror of
https://github.com/libretro/RetroArch.git
synced 2025-02-26 20:55:39 +00:00
Use HAVE_DYLIB instead of HAVE_DYNAMIC when loading shared libraries
This commit is contained in:
parent
3b38ea195f
commit
6a098d37ac
@ -93,14 +93,14 @@ VOID (WINAPI *DragAcceptFiles_func)(HWND, BOOL);
|
||||
|
||||
/* TODO/FIXME - static global variables */
|
||||
static char win32_cpu_model_name[64] = {0};
|
||||
#ifdef HAVE_DYNAMIC
|
||||
#ifdef HAVE_DYLIB
|
||||
/* We only load this library once, so we let it be
|
||||
* unloaded at application shutdown, since unloading
|
||||
* it early seems to cause issues on some systems.
|
||||
*/
|
||||
static dylib_t dwmlib;
|
||||
static dylib_t shell32lib;
|
||||
static dylib_t nvdalib;
|
||||
static dylib_t dwm_lib;
|
||||
static dylib_t shell32_lib;
|
||||
static dylib_t nvda_lib;
|
||||
#endif
|
||||
|
||||
/* Dynamic loading for Non-Visual Desktop Access support */
|
||||
@ -194,13 +194,13 @@ enum retro_language win32_get_retro_lang_from_langid(unsigned short langid)
|
||||
|
||||
static void gfx_dwm_shutdown(void)
|
||||
{
|
||||
#ifdef HAVE_DYNAMIC
|
||||
if (dwmlib)
|
||||
dylib_close(dwmlib);
|
||||
if (shell32lib)
|
||||
dylib_close(shell32lib);
|
||||
dwmlib = NULL;
|
||||
shell32lib = NULL;
|
||||
#ifdef HAVE_DYLIB
|
||||
if (dwm_lib)
|
||||
dylib_close(dwm_lib);
|
||||
if (shell32_lib)
|
||||
dylib_close(shell32_lib);
|
||||
dwm_lib = NULL;
|
||||
shell32_lib = NULL;
|
||||
#endif
|
||||
}
|
||||
|
||||
@ -214,25 +214,23 @@ static bool gfx_init_dwm(void)
|
||||
|
||||
atexit(gfx_dwm_shutdown);
|
||||
|
||||
#ifdef HAVE_DYNAMIC
|
||||
shell32lib = dylib_load("shell32.dll");
|
||||
if (!shell32lib)
|
||||
#ifdef HAVE_DYLIB
|
||||
if (!(shell32_lib = dylib_load("shell32.dll")))
|
||||
{
|
||||
RARCH_WARN("Did not find shell32.dll.\n");
|
||||
}
|
||||
|
||||
dwmlib = dylib_load("dwmapi.dll");
|
||||
if (!dwmlib)
|
||||
if (!(dwm_lib = dylib_load("dwmapi.dll")))
|
||||
{
|
||||
RARCH_WARN("Did not find dwmapi.dll.\n");
|
||||
return false;
|
||||
}
|
||||
|
||||
DragAcceptFiles_func =
|
||||
(VOID (WINAPI*)(HWND, BOOL))dylib_proc(shell32lib, "DragAcceptFiles");
|
||||
(VOID (WINAPI*)(HWND, BOOL))dylib_proc(shell32_lib, "DragAcceptFiles");
|
||||
|
||||
mmcss =
|
||||
(HRESULT(WINAPI*)(BOOL))dylib_proc(dwmlib, "DwmEnableMMCSS");
|
||||
(HRESULT(WINAPI*)(BOOL))dylib_proc(dwm_lib, "DwmEnableMMCSS");
|
||||
#else
|
||||
DragAcceptFiles_func = DragAcceptFiles;
|
||||
#if 0
|
||||
@ -261,9 +259,9 @@ static void gfx_set_dwm(void)
|
||||
PLAT_WIN32_FLAG_DWM_COMPOSITION_DISABLED))
|
||||
return;
|
||||
|
||||
#ifdef HAVE_DYNAMIC
|
||||
#ifdef HAVE_DYLIB
|
||||
composition_enable =
|
||||
(HRESULT (WINAPI*)(UINT))dylib_proc(dwmlib, "DwmEnableComposition");
|
||||
(HRESULT (WINAPI*)(UINT))dylib_proc(dwm_lib, "DwmEnableComposition");
|
||||
#endif
|
||||
|
||||
if (!composition_enable)
|
||||
@ -442,7 +440,7 @@ static void frontend_win32_init(void *data)
|
||||
{
|
||||
typedef BOOL (WINAPI *isProcessDPIAwareProc)();
|
||||
typedef BOOL (WINAPI *setProcessDPIAwareProc)();
|
||||
#ifdef HAVE_DYNAMIC
|
||||
#ifdef HAVE_DYLIB
|
||||
HMODULE handle =
|
||||
GetModuleHandle("User32.dll");
|
||||
isProcessDPIAwareProc isDPIAwareProc =
|
||||
@ -464,16 +462,16 @@ static void frontend_win32_init(void *data)
|
||||
#ifdef HAVE_NVDA
|
||||
static void init_nvda(void)
|
||||
{
|
||||
#ifdef HAVE_DYNAMIC
|
||||
#ifdef HAVE_DYLIB
|
||||
if ( (g_plat_win32_flags & PLAT_WIN32_FLAG_USE_NVDA)
|
||||
&& !nvdalib)
|
||||
&& !nvda_lib)
|
||||
{
|
||||
if ((nvdalib = dylib_load("nvdaControllerClient64.dll")))
|
||||
if ((nvda_lib = dylib_load("nvdaControllerClient64.dll")))
|
||||
{
|
||||
nvdaController_testIfRunning_func = (unsigned long (__stdcall*)(void))dylib_proc(nvdalib, "nvdaController_testIfRunning");
|
||||
nvdaController_cancelSpeech_func = (unsigned long(__stdcall *)(void))dylib_proc(nvdalib, "nvdaController_cancelSpeech");
|
||||
nvdaController_brailleMessage_func = (unsigned long(__stdcall *)(wchar_t*))dylib_proc(nvdalib, "nvdaController_brailleMessage");
|
||||
nvdaController_speakText_func = (unsigned long(__stdcall *)(wchar_t*))dylib_proc(nvdalib, "nvdaController_speakText");
|
||||
nvdaController_testIfRunning_func = (unsigned long (__stdcall*)(void))dylib_proc(nvda_lib, "nvdaController_testIfRunning");
|
||||
nvdaController_cancelSpeech_func = (unsigned long(__stdcall *)(void))dylib_proc(nvda_lib, "nvdaController_cancelSpeech");
|
||||
nvdaController_brailleMessage_func = (unsigned long(__stdcall *)(wchar_t*))dylib_proc(nvda_lib, "nvdaController_brailleMessage");
|
||||
nvdaController_speakText_func = (unsigned long(__stdcall *)(wchar_t*))dylib_proc(nvda_lib, "nvdaController_speakText");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -2439,7 +2439,7 @@ float win32_get_refresh_rate(void *data)
|
||||
unsigned int NumModeInfoArrayElements = 0;
|
||||
DISPLAYCONFIG_PATH_INFO_CUSTOM *PathInfoArray = NULL;
|
||||
DISPLAYCONFIG_MODE_INFO_CUSTOM *ModeInfoArray = NULL;
|
||||
#ifdef HAVE_DYNAMIC
|
||||
#ifdef HAVE_DYLIB
|
||||
static QUERYDISPLAYCONFIG pQueryDisplayConfig;
|
||||
static GETDISPLAYCONFIGBUFFERSIZES pGetDisplayConfigBufferSizes;
|
||||
if (!pQueryDisplayConfig)
|
||||
|
@ -147,7 +147,7 @@ typedef struct gfx_ctx_wayland_data
|
||||
#ifdef HAVE_LIBDECOR_H
|
||||
struct libdecor *libdecor_context;
|
||||
struct libdecor_frame *libdecor_frame;
|
||||
#ifdef HAVE_DYNAMIC
|
||||
#ifdef HAVE_DYLIB
|
||||
struct dylib_t *libdecor;
|
||||
#define RA_WAYLAND_SYM(rc,fn,params) rc (*fn) params;
|
||||
#include "../../gfx/common/wayland/libdecor_sym.h"
|
||||
|
@ -188,7 +188,7 @@ static typeof(AMotionEvent_getButtonState) *p_AMotionEvent_getButtonState;
|
||||
|
||||
#define AMotionEvent_getButtonState (*p_AMotionEvent_getButtonState)
|
||||
|
||||
#ifdef HAVE_DYNAMIC
|
||||
#ifdef HAVE_DYLIB
|
||||
static void *libandroid_handle;
|
||||
#endif
|
||||
|
||||
@ -451,7 +451,7 @@ static void engine_handle_dpad_default(struct android_app *android,
|
||||
android->analog_state[port][1] = (int16_t)(y * 32767.0f);
|
||||
}
|
||||
|
||||
#ifdef HAVE_DYNAMIC
|
||||
#ifdef HAVE_DYLIB
|
||||
static void engine_handle_dpad_getaxisvalue(struct android_app *android,
|
||||
AInputEvent *event, int port, int source)
|
||||
{
|
||||
@ -490,7 +490,7 @@ static void engine_handle_dpad_getaxisvalue(struct android_app *android,
|
||||
|
||||
static bool android_input_init_handle(void)
|
||||
{
|
||||
#ifdef HAVE_DYNAMIC
|
||||
#ifdef HAVE_DYLIB
|
||||
if (libandroid_handle != NULL) /* already initialized */
|
||||
return true;
|
||||
#if defined (ANDROID_AARCH64) || defined(ANDROID_X64)
|
||||
@ -1664,7 +1664,7 @@ static void android_input_free_input(void *data)
|
||||
|
||||
android_app->input_alive = false;
|
||||
|
||||
#ifdef HAVE_DYNAMIC
|
||||
#ifdef HAVE_DYLIB
|
||||
dylib_close((dylib_t)libandroid_handle);
|
||||
libandroid_handle = NULL;
|
||||
#endif
|
||||
|
@ -29,7 +29,7 @@
|
||||
#include <boolean.h>
|
||||
#include <retro_miscellaneous.h>
|
||||
#include <rthreads/rthreads.h>
|
||||
#ifdef HAVE_DYNAMIC
|
||||
#ifdef HAVE_DYLIB
|
||||
#include <dynamic/dylib.h>
|
||||
#endif
|
||||
#include <string/stdstring.h>
|
||||
@ -751,13 +751,12 @@ static CFRunLoopSourceRef btstack_quit_source;
|
||||
|
||||
static void *btstack_get_handle(void)
|
||||
{
|
||||
#ifdef HAVE_DYNAMIC
|
||||
#ifdef HAVE_DYLIB
|
||||
void *handle = dylib_load("/usr/lib/libBTstack.dylib");
|
||||
|
||||
if (handle)
|
||||
return handle;
|
||||
#endif
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@ -1246,7 +1245,7 @@ static void btpad_packet_handler(uint8_t packet_type,
|
||||
|
||||
static bool btstack_try_load(void)
|
||||
{
|
||||
#ifdef HAVE_DYNAMIC
|
||||
#ifdef HAVE_DYLIB
|
||||
unsigned i;
|
||||
#endif
|
||||
void *handle = NULL;
|
||||
@ -1262,7 +1261,7 @@ static bool btstack_try_load(void)
|
||||
if (!handle)
|
||||
return false;
|
||||
|
||||
#ifdef HAVE_DYNAMIC
|
||||
#ifdef HAVE_DYLIB
|
||||
for (i = 0; grabbers[i].name; i ++)
|
||||
{
|
||||
*grabbers[i].target = dylib_proc(handle, grabbers[i].name);
|
||||
|
@ -21,7 +21,7 @@
|
||||
#include <boolean.h>
|
||||
#include <retro_common_api.h>
|
||||
|
||||
#if defined(HAVE_DYNAMIC) && !defined(__WINRT__)
|
||||
#if defined(HAVE_DYLIB) && !defined(__WINRT__)
|
||||
static bool load_xinput_dll(void)
|
||||
{
|
||||
const char *version = "1.4";
|
||||
|
Loading…
x
Reference in New Issue
Block a user