static dylib_t libretro_get_system_info_lib(const char *path, struct retro_system_info *info, bool *load_no_rom) { dylib_t lib = dylib_load(path); if (!lib) return NULL; void (*proc)(struct retro_system_info*) = (void (*)(struct retro_system_info*))dylib_proc(lib, "retro_get_system_info"); if (!proc) { dylib_close(lib); return NULL; } proc(info); if (load_no_rom) { *load_no_rom = false; void (*set_environ)(retro_environment_t) = (void (*)(retro_environment_t))dylib_proc(lib, "retro_set_environment"); if (!set_environ) return lib; libretro_get_environment_info(set_environ, load_no_rom); } return lib; }
static dylib_t libretro_get_system_info_lib(const char *path, struct retro_system_info *info, bool *load_no_content) { dylib_t lib = dylib_load(path); void (*proc)(struct retro_system_info*); if (!lib) { RARCH_ERR("%s: \"%s\"\n", msg_hash_to_str(MSG_FAILED_TO_OPEN_LIBRETRO_CORE), path); RARCH_ERR("Error(s): %s\n", dylib_error()); return NULL; } proc = (void (*)(struct retro_system_info*)) dylib_proc(lib, "retro_get_system_info"); if (!proc) { dylib_close(lib); return NULL; } proc(info); if (load_no_content) { void (*set_environ)(retro_environment_t); *load_no_content = false; set_environ = (void (*)(retro_environment_t)) dylib_proc(lib, "retro_set_environment"); if (!set_environ) return lib; libretro_get_environment_info(set_environ, load_no_content); } return lib; }
static dylib_t libretro_get_system_info_lib(const char *path, struct retro_system_info *info, bool *load_no_content) { dylib_t lib = dylib_load(path); void (*proc)(struct retro_system_info*); if (!lib) { RARCH_ERR("Failed to open libretro core: \"%s\"\n", path); RARCH_ERR("Error(s): %s\n", dylib_error()); return NULL; } proc = (void (*)(struct retro_system_info*)) dylib_proc(lib, "retro_get_system_info"); if (!proc) { dylib_close(lib); return NULL; } proc(info); if (load_no_content) { void (*set_environ)(retro_environment_t); *load_no_content = false; set_environ = (void (*)(retro_environment_t)) dylib_proc(lib, "retro_set_environment"); if (!set_environ) return lib; libretro_get_environment_info(set_environ, load_no_content); } return lib; }