diff options
Diffstat (limited to 'src/common')
-rw-r--r-- | src/common/outbound.c | 6 | ||||
-rw-r--r-- | src/common/plugin.c | 4 | ||||
-rw-r--r-- | src/common/plugin.h | 8 |
3 files changed, 13 insertions, 5 deletions
diff --git a/src/common/outbound.c b/src/common/outbound.c index fe6da8c8..96fb7fe4 100644 --- a/src/common/outbound.c +++ b/src/common/outbound.c @@ -2610,7 +2610,7 @@ cmd_load (struct session *sess, char *tbuf, char *word[], char *word_eol[]) } #ifdef USE_PLUGIN - if (g_str_has_suffix (word[2], "."G_MODULE_SUFFIX)) + if (g_str_has_suffix (word[2], "."PLUGIN_SUFFIX)) { arg = NULL; if (word_eol[3][0]) @@ -3616,7 +3616,7 @@ cmd_unload (struct session *sess, char *tbuf, char *word[], char *word_eol[]) #ifdef USE_PLUGIN gboolean by_file = FALSE; - if (g_str_has_suffix (word[2], "."G_MODULE_SUFFIX)) + if (g_str_has_suffix (word[2], "."PLUGIN_SUFFIX)) by_file = TRUE; switch (plugin_kill (word[2], by_file)) @@ -3641,7 +3641,7 @@ cmd_reload (struct session *sess, char *tbuf, char *word[], char *word_eol[]) #ifdef USE_PLUGIN gboolean by_file = FALSE; - if (g_str_has_suffix (word[2], "."G_MODULE_SUFFIX)) + if (g_str_has_suffix (word[2], "."PLUGIN_SUFFIX)) by_file = TRUE; switch (plugin_reload (sess, word[2], by_file)) diff --git a/src/common/plugin.c b/src/common/plugin.c index 3ad3c558..1db11f35 100644 --- a/src/common/plugin.c +++ b/src/common/plugin.c @@ -464,10 +464,10 @@ plugin_auto_load (session *sess) for_files (lib_dir, "hcwinamp.dll", plugin_auto_load_cb); for_files (lib_dir, "hcsysinfo.dll", plugin_auto_load_cb); #else - for_files (lib_dir, "*."G_MODULE_SUFFIX, plugin_auto_load_cb); + for_files (lib_dir, "*."PLUGIN_SUFFIX, plugin_auto_load_cb); #endif - for_files (sub_dir, "*."G_MODULE_SUFFIX, plugin_auto_load_cb); + for_files (sub_dir, "*."PLUGIN_SUFFIX, plugin_auto_load_cb); g_free (sub_dir); } diff --git a/src/common/plugin.h b/src/common/plugin.h index 76ce97a3..fb7da831 100644 --- a/src/common/plugin.h +++ b/src/common/plugin.h @@ -181,4 +181,12 @@ int plugin_show_help (session *sess, char *cmd); void plugin_command_foreach (session *sess, void *userdata, void (*cb) (session *sess, void *userdata, char *name, char *usage)); session *plugin_find_context (const char *servname, const char *channel, server *current_server); +/* On macOS, G_MODULE_SUFFIX says "so" but meson uses "dylib" + * https://github.com/mesonbuild/meson/issues/1160 */ +#if defined(__APPLE__) +# define PLUGIN_SUFFIX "dylib" +#else +# define PLUGIN_SUFFIX G_MODULE_SUFFIX +#endif + #endif |