summaryrefslogtreecommitdiff
path: root/lib/library.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/library.c')
-rw-r--r--lib/library.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/lib/library.c b/lib/library.c
index c7f5e60..7fca099 100644
--- a/lib/library.c
+++ b/lib/library.c
@@ -34,24 +34,28 @@ load(const char *file, struct bm_renderer *renderer)
const char* (*regfun)(struct render_api*);
if (!(regfun = chckDlLoadSymbol(handle, "register_renderer", &error)))
- goto fail;
+ goto load_fail;
const char *name;
if (!(name = regfun(&renderer->api)))
goto fail;
- if (strcmp(renderer->api.version, BM_VERSION))
- goto fail;
+ if (strcmp(renderer->api.version, BM_PLUGIN_VERSION))
+ goto mismatch_fail;
renderer->handle = handle;
renderer->name = bm_strdup(name);
renderer->file = bm_strdup(file);
return true;
+load_fail:
+ fprintf(stderr, "%s\n", error);
+ goto fail;
+mismatch_fail:
+ fprintf(stderr, "%s: version mismatch (%s != %s)\n", name, renderer->api.version, BM_PLUGIN_VERSION);
fail:
if (handle)
chckDlUnload(handle);
- fprintf(stderr, "%s\n", error);
return false;
}