BSolver: fix build host build for gcc 2
gcc 2 doesn't support the weakref attribute. Rather use the regular (target) method to initialize sCreateSolver instead (pthread once, dlopen()). Since we know that we're on Haiku, that doesn't add any dependencies that aren't available anyway.
This commit is contained in:
@@ -9,16 +9,15 @@
|
||||
|
||||
#include <package/solver/Solver.h>
|
||||
|
||||
#ifdef HAIKU_TARGET_PLATFORM_HAIKU
|
||||
# include <dlfcn.h>
|
||||
# include <pthread.h>
|
||||
#endif
|
||||
|
||||
|
||||
typedef BPackageKit::BSolver* CreateSolverFunction();
|
||||
|
||||
|
||||
#ifdef HAIKU_TARGET_PLATFORM_HAIKU
|
||||
#if defined(HAIKU_TARGET_PLATFORM_HAIKU) || __GNUC__ == 2
|
||||
|
||||
|
||||
#include <dlfcn.h>
|
||||
#include <pthread.h>
|
||||
|
||||
|
||||
static CreateSolverFunction* sCreateSolver = NULL;
|
||||
@@ -29,7 +28,11 @@ static pthread_once_t sLoadLibsolvSolverAddOnInitOnce = PTHREAD_ONCE_INIT;
|
||||
static void
|
||||
load_libsolv_solver_add_on()
|
||||
{
|
||||
#if defined(HAIKU_TARGET_PLATFORM_HAIKU) || __GNUC__ == 2
|
||||
void* imageHandle = dlopen("libpackage-add-on-libsolv.so", 0);
|
||||
#else
|
||||
void* imageHandle = dlopen("libpackage-add-on-libsolv_build.so", 0);
|
||||
#endif
|
||||
if (imageHandle == NULL)
|
||||
return;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user