diff --git a/src/ecmascript/ecmascript-c.h b/src/ecmascript/ecmascript-c.h index fc1d8faf..961f2cbe 100644 --- a/src/ecmascript/ecmascript-c.h +++ b/src/ecmascript/ecmascript-c.h @@ -1,6 +1,8 @@ #ifndef EL__ECMASCRIPT_ECMASCRIPT_C_H #define EL__ECMASCRIPT_ECMASCRIPT_C_H +#include "main/module.h" + #ifdef __cplusplus extern "C" { #endif @@ -10,6 +12,8 @@ struct session; int ecmascript_get_interpreter_count(void); void toggle_ecmascript(struct session *ses); +extern struct module ecmascript_module; + #ifdef __cplusplus } #endif diff --git a/src/ecmascript/ecmascript.h b/src/ecmascript/ecmascript.h index f3d05554..9c73631a 100644 --- a/src/ecmascript/ecmascript.h +++ b/src/ecmascript/ecmascript.h @@ -205,8 +205,6 @@ extern char *console_log_filename; extern char *local_storage_filename; extern int local_storage_ready; -extern struct module ecmascript_module; - #ifdef __cplusplus } #endif diff --git a/src/main/Makefile b/src/main/Makefile index db2b4f8d..b9b670d7 100644 --- a/src/main/Makefile +++ b/src/main/Makefile @@ -3,6 +3,6 @@ include $(top_builddir)/Makefile.config OBJS-$(CONFIG_INTERLINK) += interlink.o -OBJS = event.o main.o module.obj select.o timer.obj version.o +OBJS = event.o main.o module.o select.o timer.obj version.o include $(top_srcdir)/Makefile.lib diff --git a/src/main/meson.build b/src/main/meson.build index a6b54bbe..a2e2155b 100644 --- a/src/main/meson.build +++ b/src/main/meson.build @@ -1,4 +1,4 @@ if conf_data.get('CONFIG_INTERLINK') srcs += files('interlink.c') endif -srcs += files('event.c', 'main.c', 'module.cpp', 'select.c', 'timer.cpp', 'version.c') +srcs += files('event.c', 'main.c', 'module.c', 'select.c', 'timer.cpp', 'version.c') diff --git a/src/main/module.cpp b/src/main/module.c similarity index 96% rename from src/main/module.cpp rename to src/main/module.c index b74febde..124cc192 100644 --- a/src/main/module.cpp +++ b/src/main/module.c @@ -21,7 +21,9 @@ #include "dialogs/exmode.h" #include "document/css/css.h" #include "document/document.h" -#include "ecmascript/ecmascript.h" +#if defined(CONFIG_ECMASCRIPT_SMJS) || defined(CONFIG_MUJS) || defined(CONFIG_QUICKJS) +#include "ecmascript/ecmascript-c.h" +#endif #include "formhist/formhist.h" #include "globhist/globhist.h" #ifdef CONFIG_NLS