From 77d08bdd1401dea2def2cf2d3b31f88ccfc7aab4 Mon Sep 17 00:00:00 2001 From: Jan Wielemaker Date: Fri, 1 Sep 2023 17:57:19 +0200 Subject: [PATCH] PORT: MSVC Need to get DLL linkage correct. This also requires a change in SWI-Prolog.h --- emacs-module.h | 6 +++++- sweep.c | 6 ++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/emacs-module.h b/emacs-module.h index a21ba6b..202aed5 100644 --- a/emacs-module.h +++ b/emacs-module.h @@ -748,7 +748,11 @@ struct emacs_env_28 }; /* Every module should define a function as follows. */ -extern int emacs_module_init (struct emacs_runtime *runtime) +#ifndef EXPORT +#define EXPORT extern +#endif + +EXPORT int emacs_module_init (struct emacs_runtime *runtime) EMACS_NOEXCEPT EMACS_ATTRIBUTE_NONNULL (1); diff --git a/sweep.c b/sweep.c index 3e8f156..d642498 100644 --- a/sweep.c +++ b/sweep.c @@ -30,7 +30,6 @@ POSSIBILITY OF SUCH DAMAGE. */ -#include #include #include #include @@ -45,7 +44,10 @@ #define EXPORT #endif +#include + EXPORT int plugin_is_GPL_compatible; +int plugin_is_GPL_compatible; struct sweep_env { term_t output_term; @@ -586,7 +588,7 @@ sweep_initialize(emacs_env *env, ptrdiff_t nargs, emacs_value *args, void *data) PL_register_foreign("sweep_funcall", 2, sweep_funcall0, 0); PL_register_foreign("sweep_fd_open", 2, sweep_fd_open, 0); - r = PL_initialise(nargs, argv); + r = PL_initialise((int)nargs, argv); sweep_thread_id = PL_thread_self(); -- 2.39.2