From: Jan Wielemaker Date: Fri, 1 Sep 2023 15:57:19 +0000 (+0200) Subject: PORT: MSVC X-Git-Tag: V9.1.16 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=83f44f176856d86b25d6834ac3b66d75aeb27685;p=sweep.git PORT: MSVC Need to get DLL linkage correct. This also requires a change in SWI-Prolog.h --- 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();