From 23b483249018087d63c5a26bd49c7f4b0f3173fc Mon Sep 17 00:00:00 2001 From: Pierre Pronchery Date: Thu, 2 Jun 2011 20:18:14 +0000 Subject: [PATCH] Compilation fix for Windows --- src/appinterface.c | 16 ++++++---------- src/project.conf | 2 +- 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/src/appinterface.c b/src/appinterface.c index 0d6c694..e7ce6c1 100644 --- a/src/appinterface.c +++ b/src/appinterface.c @@ -21,7 +21,6 @@ #include #include #include -#include #include #include #ifdef WITH_SSL @@ -273,6 +272,7 @@ static int _new_foreach(char const * key, Hash * value, break; if(_new_append_arg(appinterface, p) != 0) { + /* FIXME may crash here? */ appinterface->error = 1; return -1; } @@ -340,32 +340,28 @@ static int _new_append_arg(AppInterface * ai, char const * arg) AppInterface * appinterface_new_server(char const * app) { AppInterface * ai; - void * handle; + Plugin * handle; size_t i; String * name; - if((handle = dlopen(NULL, RTLD_LAZY)) == NULL) - { - error_set_code(1, "%s", dlerror()); + if((handle = plugin_new_self()) == NULL) return NULL; - } if((ai = appinterface_new(app)) == NULL) return NULL; for(i = 0; i < ai->calls_cnt; i++) { name = string_new_append(ai->name, "_", ai->calls[i].name, NULL); - ai->calls[i].func = dlsym(handle, name); + ai->calls[i].func = plugin_lookup(handle, name); string_delete(name); if(ai->calls[i].func == NULL) { - error_set_code(1, "%s", dlerror()); appinterface_delete(ai); - dlclose(handle); + plugin_delete(handle); return NULL; } } - dlclose(handle); + plugin_delete(handle); return ai; } diff --git a/src/project.conf b/src/project.conf index 252029e..738a6ea 100644 --- a/src/project.conf +++ b/src/project.conf @@ -9,7 +9,7 @@ dist=Makefile,appinterface.h [libApp] type=library sources=appclient.c,appinterface.c,appserver.c -ldflags=`pkg-config --libs libSystem` -ldl -lsocket +ldflags=`pkg-config --libs libSystem` -lsocket install=$(LIBDIR) [appclient.c]