diff --git a/mingw-libvirt.spec.in b/mingw-libvirt.spec.in index 4efa0ddbfa32f6ea5dacd88ac21f79f91aa263ad..183346cf64e3cfb07903ae05fbd3a8be55a8c13b 100644 --- a/mingw-libvirt.spec.in +++ b/mingw-libvirt.spec.in @@ -54,6 +54,8 @@ BuildRequires: mingw32-libxml2 BuildRequires: mingw64-libxml2 BuildRequires: mingw32-portablexdr BuildRequires: mingw64-portablexdr +BuildRequires: mingw32-dlfcn +BuildRequires: mingw64-dlfcn BuildRequires: pkgconfig # Need native version for msgfmt diff --git a/src/driver.c b/src/driver.c index 2e7dd01df8877b97fd53a4819cabd793f15aba00..04dd0a44318bfe0eb264d29501ba6a1084409f2d 100644 --- a/src/driver.c +++ b/src/driver.c @@ -34,10 +34,11 @@ VIR_LOG_INIT("driver"); /* XXX re-implement this for other OS, or use libtools helper lib ? */ - -#include #define DEFAULT_DRIVER_DIR LIBDIR "/libvirt/connection-driver" +#ifdef HAVE_DLFCN_H +# include + static void * virDriverLoadModuleFile(const char *file) @@ -126,6 +127,19 @@ virDriverLoadModuleFull(const char *path, return ret; } +#else /* ! HAVE_DLFCN_H */ +int +virDriverLoadModuleFull(const char *path ATTRIBUTE_UNUSED, + const char *regfunc ATTRIBUTE_UNUSED, + void **handle) +{ + VIR_DEBUG("dlopen not available on this platform"); + if (handle) + *handle = NULL; + return -1; +} +#endif /* ! HAVE_DLFCN_H */ + int virDriverLoadModule(const char *name,