mirror of
https://github.com/libretro/RetroArch
synced 2025-03-31 01:21:03 +00:00
Fix statically linked targets
This commit is contained in:
parent
b73c7fe4e9
commit
f14797b67c
67
dynamic.c
67
dynamic.c
@ -202,6 +202,40 @@ static bool libretro_get_system_info_static(struct retro_system_info *info,
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/**
|
||||||
|
* libretro_get_system_info:
|
||||||
|
* @path : Path to libretro library.
|
||||||
|
* @info : Pointer to system info information.
|
||||||
|
* @load_no_content : If true, core should be able to auto-start
|
||||||
|
* without any content loaded.
|
||||||
|
*
|
||||||
|
* Gets system info from an arbitrary lib.
|
||||||
|
* The struct returned must be freed as strings are allocated dynamically.
|
||||||
|
*
|
||||||
|
* Returns: true (1) if successful, otherwise false (0).
|
||||||
|
**/
|
||||||
|
bool libretro_get_system_info(const char *path,
|
||||||
|
struct retro_system_info *info, bool *load_no_content)
|
||||||
|
{
|
||||||
|
#ifdef HAVE_DYNAMIC
|
||||||
|
struct retro_system_info dummy_info = {0};
|
||||||
|
dylib_t lib = libretro_get_system_info_lib(path,
|
||||||
|
&dummy_info, load_no_content);
|
||||||
|
if (!lib)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
memcpy(info, &dummy_info, sizeof(*info));
|
||||||
|
info->library_name = strdup(dummy_info.library_name);
|
||||||
|
info->library_version = strdup(dummy_info.library_version);
|
||||||
|
if (dummy_info.valid_extensions)
|
||||||
|
info->valid_extensions = strdup(dummy_info.valid_extensions);
|
||||||
|
dylib_close(lib);
|
||||||
|
return true;
|
||||||
|
#else
|
||||||
|
return libretro_get_system_info_static(info, load_no_content);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
#ifdef HAVE_DYNAMIC
|
#ifdef HAVE_DYNAMIC
|
||||||
/**
|
/**
|
||||||
* libretro_get_environment_info:
|
* libretro_get_environment_info:
|
||||||
@ -281,39 +315,6 @@ static dylib_t libretro_get_system_info_lib(const char *path,
|
|||||||
return lib;
|
return lib;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* libretro_get_system_info:
|
|
||||||
* @path : Path to libretro library.
|
|
||||||
* @info : Pointer to system info information.
|
|
||||||
* @load_no_content : If true, core should be able to auto-start
|
|
||||||
* without any content loaded.
|
|
||||||
*
|
|
||||||
* Gets system info from an arbitrary lib.
|
|
||||||
* The struct returned must be freed as strings are allocated dynamically.
|
|
||||||
*
|
|
||||||
* Returns: true (1) if successful, otherwise false (0).
|
|
||||||
**/
|
|
||||||
bool libretro_get_system_info(const char *path,
|
|
||||||
struct retro_system_info *info, bool *load_no_content)
|
|
||||||
{
|
|
||||||
#ifdef HAVE_DYNAMIC
|
|
||||||
struct retro_system_info dummy_info = {0};
|
|
||||||
dylib_t lib = libretro_get_system_info_lib(path,
|
|
||||||
&dummy_info, load_no_content);
|
|
||||||
if (!lib)
|
|
||||||
return false;
|
|
||||||
|
|
||||||
memcpy(info, &dummy_info, sizeof(*info));
|
|
||||||
info->library_name = strdup(dummy_info.library_name);
|
|
||||||
info->library_version = strdup(dummy_info.library_version);
|
|
||||||
if (dummy_info.valid_extensions)
|
|
||||||
info->valid_extensions = strdup(dummy_info.valid_extensions);
|
|
||||||
dylib_close(lib);
|
|
||||||
return true;
|
|
||||||
#else
|
|
||||||
return libretro_get_system_info_static(info, load_no_content);
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
static void load_dynamic_core(void)
|
static void load_dynamic_core(void)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user