branch: elpa/sweeprolog commit 77d08bdd1401dea2def2cf2d3b31f88ccfc7aab4 Author: Jan Wielemaker <j...@swi-prolog.org> Commit: Jan Wielemaker <j.wielema...@vu.nl>
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 a21ba6b502..202aed5041 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 3e8f1565ba..d64249830f 100644 --- a/sweep.c +++ b/sweep.c @@ -30,7 +30,6 @@ POSSIBILITY OF SUCH DAMAGE. */ -#include <emacs-module.h> #include <SWI-Prolog.h> #include <SWI-Stream.h> #include <stdlib.h> @@ -45,7 +44,10 @@ #define EXPORT #endif +#include <emacs-module.h> + 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();