From bd915d9f53216d1998effadf1d8ef25eafdc67a6 Mon Sep 17 00:00:00 2001 From: Ingo Weinhold Date: Fri, 5 Jul 2013 13:16:08 +0200 Subject: [PATCH] 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. --- src/kits/package/solver/Solver.cpp | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/kits/package/solver/Solver.cpp b/src/kits/package/solver/Solver.cpp index eefaf5cb78..29a92c95d5 100644 --- a/src/kits/package/solver/Solver.cpp +++ b/src/kits/package/solver/Solver.cpp @@ -9,16 +9,15 @@ #include -#ifdef HAIKU_TARGET_PLATFORM_HAIKU -# include -# include -#endif - typedef BPackageKit::BSolver* CreateSolverFunction(); -#ifdef HAIKU_TARGET_PLATFORM_HAIKU +#if defined(HAIKU_TARGET_PLATFORM_HAIKU) || __GNUC__ == 2 + + +#include +#include 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;