From 9de9d0dacd4a53fa639af0b4ab1eb30c3e76c6e5 Mon Sep 17 00:00:00 2001 From: Andy Green Date: Wed, 25 May 2016 21:43:58 +0800 Subject: [PATCH] windows adapt plugin name format vs functions Signed-off-by: Andy Green --- lib/libuv.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/lib/libuv.c b/lib/libuv.c index 0b6b60f7..11b779fe 100644 --- a/lib/libuv.c +++ b/lib/libuv.c @@ -491,9 +491,15 @@ lws_plat_plugins_init(struct lws_context * context, const char * const *d) goto bail; } /* we could open it, can we get his init function? */ +#if !defined(WIN32) m = snprintf(path, sizeof(path) - 1, "init_%s", dent.name + 3 /* snip lib... */); path[m - 3] = '\0'; /* snip the .so */ +#else + m = snprintf(path, sizeof(path) - 1, "init_%s", + dent.name); + path[m - 4] = '\0'; /* snip the .dll */ +#endif if (uv_dlsym(&lib, path, &v)) { uv_dlerror(&lib); lwsl_err("Failed to get init on %s: %s", @@ -554,8 +560,13 @@ lws_plat_plugins_destroy(struct lws_context * context) while (plugin) { p = plugin; +#if !defined(WIN32) m = snprintf(path, sizeof(path) - 1, "destroy_%s", plugin->name + 3); path[m - 3] = '\0'; +#else + m = snprintf(path, sizeof(path) - 1, "destroy_%s", plugin->name); + path[m - 4] = '\0'; +#endif if (uv_dlsym(&plugin->lib, path, &v)) { uv_dlerror(&plugin->lib);