There can be builds that are statically built against a libretro core

but still have dylib support
This commit is contained in:
libretroadmin 2022-11-16 16:51:53 +01:00
parent 0b71407b62
commit 63153620a7
6 changed files with 22 additions and 22 deletions

View File

@ -18,7 +18,7 @@
#include "d3d10_common.h"
#include "d3dcompiler_common.h"
#if defined(HAVE_DYNAMIC) && !defined(__WINRT__)
#if defined(HAVE_DYLIB) && !defined(__WINRT__)
#include <dynamic/dylib.h>
typedef HRESULT(WINAPI* PFN_D3D10_CREATE_DEVICE_AND_SWAP_CHAIN)(

View File

@ -20,7 +20,7 @@
#include "d3d11_common.h"
#include "d3dcompiler_common.h"
#if defined(HAVE_DYNAMIC) && !defined(__WINRT__)
#if defined(HAVE_DYLIB) && !defined(__WINRT__)
#include <dynamic/dylib.h>
HRESULT WINAPI D3D11CreateDevice(

View File

@ -27,7 +27,7 @@
#include "../verbosity.h"
#include "../../configuration.h"
#ifdef HAVE_DYNAMIC
#if defined(HAVE_DYLIB) && !defined(__WINRT__)
#include <dynamic/dylib.h>
#endif
@ -76,7 +76,7 @@ DEFINE_GUIDW(IID_ID3D12DebugCommandList, 0x09e0bf36, 0x54ac, 0x484f, 0x88, 0x47,
#endif
#endif
#if defined(HAVE_DYNAMIC) && !defined(__WINRT__)
#if defined(HAVE_DYLIB) && !defined(__WINRT__)
static dylib_t d3d12_dll;
HRESULT WINAPI D3D12CreateDevice(

View File

@ -48,7 +48,7 @@ typedef enum hdr_root_constants
} hdr_root_constants_t;
#endif
#if defined(HAVE_DYNAMIC) && !defined(__WINRT__)
#if defined(HAVE_DYLIB) && !defined(__WINRT__)
#include <dynamic/dylib.h>
HRESULT WINAPI CreateDXGIFactory1(REFIID riid, void** ppFactory)

View File

@ -70,11 +70,11 @@ typedef struct
/* TODO/FIXME - static globals */
static int g_xinput_pad_indexes[MAX_USERS];
static unsigned g_last_xinput_pad_idx;
static bool g_xinput_block_pads;
#ifdef HAVE_DYNAMIC
static unsigned g_last_xinput_pad_idx = 0;
static bool g_xinput_block_pads = false;
#if defined(HAVE_DYLIB) && !defined(__WINRT__)
/* For xinput1_n.dll */
static dylib_t g_xinput_dll = NULL;
static dylib_t g_xinput_dll = NULL;
#endif
/* Function pointer, to be assigned with dylib_proc */
typedef uint32_t (__stdcall *XInputGetStateEx_t)(uint32_t, XINPUT_STATE*);
@ -346,7 +346,7 @@ static void *xinput_joypad_init(void *data)
unsigned i, j;
XINPUT_STATE dummy_state;
#if defined(HAVE_DYNAMIC) && !defined(__WINRT__)
#if defined(HAVE_DYLIB) && !defined(__WINRT__)
if (!g_xinput_dll)
if (!load_xinput_dll())
goto error;
@ -370,7 +370,7 @@ static void *xinput_joypad_init(void *data)
* XInputGetState, at the cost of losing guide button support.
*/
g_xinput_guide_button_supported = false;
#if defined(HAVE_DYNAMIC) && !defined(__WINRT__)
#if defined(HAVE_DYLIB) && !defined(__WINRT__)
g_XInputGetStateEx = (XInputGetStateEx_t)dylib_proc(
g_xinput_dll, "XInputGetState");
#else
@ -380,7 +380,7 @@ static void *xinput_joypad_init(void *data)
if (!g_XInputGetStateEx)
{
RARCH_ERR("[XInput]: Failed to init: DLL is invalid or corrupt.\n");
#if defined(HAVE_DYNAMIC) && !defined(__WINRT__)
#if defined(HAVE_DYLIB) && !defined(__WINRT__)
dylib_close(g_xinput_dll);
#endif
/* DLL was loaded but did not contain the correct function. */
@ -389,7 +389,7 @@ static void *xinput_joypad_init(void *data)
RARCH_WARN("[XInput]: No guide button support.\n");
}
#if defined(HAVE_DYNAMIC) && !defined(__WINRT__)
#if defined(HAVE_DYLIB) && !defined(__WINRT__)
g_XInputSetState = (XInputSetState_t)dylib_proc(
g_xinput_dll, "XInputSetState");
#else
@ -398,7 +398,7 @@ static void *xinput_joypad_init(void *data)
if (!g_XInputSetState)
{
RARCH_ERR("[XInput]: Failed to init: DLL is invalid or corrupt.\n");
#if defined(HAVE_DYNAMIC) && !defined(__WINRT__)
#if defined(HAVE_DYLIB) && !defined(__WINRT__)
dylib_close(g_xinput_dll);
#endif
goto error; /* DLL was loaded but did not contain the correct function. */
@ -671,7 +671,7 @@ static void xinput_joypad_destroy(void)
g_xinput_states[i].connected = false;
}
#if defined(HAVE_DYNAMIC) && !defined(__WINRT__)
#if defined(HAVE_DYLIB) && !defined(__WINRT__)
dylib_close(g_xinput_dll);
g_xinput_dll = NULL;

View File

@ -56,7 +56,7 @@ typedef uint32_t (__stdcall *XInputGetStateEx_t)(uint32_t, XINPUT_STATE*);
typedef uint32_t (__stdcall *XInputSetState_t)(uint32_t, XINPUT_VIBRATION*);
/* TODO/FIXME - static globals */
#ifdef HAVE_DYNAMIC
#if defined(HAVE_DYLIB) && !defined(__WINRT__)
/* For xinput1_n.dll */
static dylib_t g_xinput_dll = NULL;
#endif
@ -121,7 +121,7 @@ static void *xinput_joypad_init(void *data)
unsigned i, j;
XINPUT_STATE dummy_state;
#if defined(HAVE_DYNAMIC) && !defined(__WINRT__)
#if defined(HAVE_DYLIB) && !defined(__WINRT__)
if (!g_xinput_dll)
if (!load_xinput_dll())
goto error;
@ -145,7 +145,7 @@ static void *xinput_joypad_init(void *data)
* XInputGetState, at the cost of losing guide button support.
*/
g_xinput_guide_button_supported = false;
#if defined(HAVE_DYNAMIC) && !defined(__WINRT__)
#if defined(HAVE_DYLIB) && !defined(__WINRT__)
g_XInputGetStateEx = (XInputGetStateEx_t)dylib_proc(
g_xinput_dll, "XInputGetState");
#else
@ -155,7 +155,7 @@ static void *xinput_joypad_init(void *data)
if (!g_XInputGetStateEx)
{
RARCH_ERR("[XInput]: Failed to init: DLL is invalid or corrupt.\n");
#if defined(HAVE_DYNAMIC) && !defined(__WINRT__)
#if defined(HAVE_DYLIB) && !defined(__WINRT__)
dylib_close(g_xinput_dll);
#endif
/* DLL was loaded but did not contain the correct function. */
@ -164,7 +164,7 @@ static void *xinput_joypad_init(void *data)
RARCH_WARN("[XInput]: No guide button support.\n");
}
#if defined(HAVE_DYNAMIC) && !defined(__WINRT__)
#if defined(HAVE_DYLIB) && !defined(__WINRT__)
g_XInputSetState = (XInputSetState_t)dylib_proc(
g_xinput_dll, "XInputSetState");
#else
@ -173,7 +173,7 @@ static void *xinput_joypad_init(void *data)
if (!g_XInputSetState)
{
RARCH_ERR("[XInput]: Failed to init: DLL is invalid or corrupt.\n");
#if defined(HAVE_DYNAMIC) && !defined(__WINRT__)
#if defined(HAVE_DYLIB) && !defined(__WINRT__)
dylib_close(g_xinput_dll);
#endif
goto error; /* DLL was loaded but did not contain the correct function. */
@ -263,7 +263,7 @@ static void xinput_joypad_destroy(void)
g_xinput_states[i].connected = false;
}
#if defined(HAVE_DYNAMIC) && !defined(__WINRT__)
#if defined(HAVE_DYLIB) && !defined(__WINRT__)
dylib_close(g_xinput_dll);
g_xinput_dll = NULL;