Always use dlopen and dlsym to load libsolv
Previous implementation used weak symbols on all platforms except Haiku. Mac OS X also does not support this use of weak symbols. In the discussion of #10028 it was decided that probably more platforms will have problems with this approach, so instead use the approach that always works.
This commit is contained in:
parent
b617a7b410
commit
57405de578
|
@ -38,9 +38,6 @@
|
|||
// abort()s. Obviously that isn't good behavior for a library.
|
||||
|
||||
|
||||
#ifdef __HAIKU__
|
||||
|
||||
|
||||
BSolver*
|
||||
BPackageKit::create_solver()
|
||||
{
|
||||
|
@ -48,19 +45,6 @@ BPackageKit::create_solver()
|
|||
}
|
||||
|
||||
|
||||
#else
|
||||
|
||||
|
||||
extern "C" BSolver*
|
||||
__create_libsolv_solver()
|
||||
{
|
||||
return new(std::nothrow) LibsolvSolver;
|
||||
}
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
struct LibsolvSolver::SolvQueue : Queue {
|
||||
SolvQueue()
|
||||
{
|
||||
|
|
|
@ -13,9 +13,6 @@
|
|||
typedef BPackageKit::BSolver* CreateSolverFunction();
|
||||
|
||||
|
||||
#ifdef __HAIKU__
|
||||
|
||||
|
||||
#include <dlfcn.h>
|
||||
#include <pthread.h>
|
||||
|
||||
|
@ -41,16 +38,6 @@ load_libsolv_solver_add_on()
|
|||
dlclose(imageHandle);
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
|
||||
static BPackageKit::BSolver* __create_libsolv_solver()
|
||||
__attribute__((weakref("__create_libsolv_solver")));
|
||||
static CreateSolverFunction* sCreateSolver = &__create_libsolv_solver;
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
namespace BPackageKit {
|
||||
|
||||
|
@ -68,9 +55,7 @@ BSolver::~BSolver()
|
|||
/*static*/ status_t
|
||||
BSolver::Create(BSolver*& _solver)
|
||||
{
|
||||
#ifdef __HAIKU__
|
||||
pthread_once(&sLoadLibsolvSolverAddOnInitOnce, &load_libsolv_solver_add_on);
|
||||
#endif
|
||||
if (sCreateSolver == NULL)
|
||||
return B_NOT_SUPPORTED;
|
||||
|
||||
|
|
Loading…
Reference in New Issue