summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSébastien Helleu <flashcode@flashtux.org>2023-06-05 21:09:27 +0200
committerSébastien Helleu <flashcode@flashtux.org>2023-06-05 21:09:27 +0200
commit4185e7b9f6f0ccf6d3c17ca501f82cc5f075f099 (patch)
treea417e199bb563d3598fc8e944330a876d1b8288a /src
parent0d92c8703f92a7c5d3fec719cd43ee260ec1a18a (diff)
downloadweechat-4185e7b9f6f0ccf6d3c17ca501f82cc5f075f099.zip
guile: fix crash when plugin is loaded on GNU/Hurd (closes #1951)
Diffstat (limited to 'src')
-rw-r--r--src/plugins/guile/weechat-guile.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/plugins/guile/weechat-guile.c b/src/plugins/guile/weechat-guile.c
index 3be050095..b7b05d456 100644
--- a/src/plugins/guile/weechat-guile.c
+++ b/src/plugins/guile/weechat-guile.c
@@ -1231,6 +1231,19 @@ weechat_guile_port_write (SCM port, const void *data, size_t size)
#endif
/*
+ * Callback called by scm_with_guile().
+ */
+
+void *
+weechat_guile_init (void *data)
+{
+ /* make C compiler happy */
+ (void) data;
+
+ return NULL;
+}
+
+/*
* Initializes guile plugin.
*/
@@ -1276,7 +1289,7 @@ weechat_plugin_init (struct t_weechat_plugin *plugin, int argc, char *argv[])
scm_install_gmp_memory_functions = 0;
#endif /* defined(HAVE_GUILE_GMP_MEMORY_FUNCTIONS) && (SCM_MAJOR_VERSION < 3 || (SCM_MAJOR_VERSION == 3 && SCM_MINOR_VERSION == 0 && SCM_MICRO_VERSION < 8)) */
- scm_init_guile ();
+ scm_with_guile (&weechat_guile_init, NULL);
guile_module_weechat = scm_c_define_module ("weechat",
&weechat_guile_api_module_init,