From d229ebe89cb2a5e08e9d0af98faaa59ba2089fb3 Mon Sep 17 00:00:00 2001 From: Witold Filipczyk Date: Fri, 9 Sep 2022 11:30:21 +0200 Subject: [PATCH 1/4] [options] Do not compile-in mouse related functions when mouse support is disabled. Refs #189 --- src/config/options.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/config/options.c b/src/config/options.c index 7b82be22c..f4887c010 100644 --- a/src/config/options.c +++ b/src/config/options.c @@ -896,6 +896,7 @@ change_hook_ui_double_esc(struct session *ses, struct option *current, struct op return 0; } +#ifdef CONFIG_MOUSE static int change_hook_ui_mouse_disable(struct session *ses, struct option *current, struct option *changed) { @@ -911,7 +912,7 @@ change_hook_ui_mouse_disable(struct session *ses, struct option *current, struct } return 0; } - +#endif /** Make option templates visible or invisible in the option manager. * This is called once on startup, and then each time the value of the @@ -988,7 +989,9 @@ static const struct change_hook_info change_hooks[] = { { "ui.colors", change_hook_ui_colors }, { "ui.double_esc", change_hook_ui_double_esc }, { "ui.language", change_hook_language }, +#ifdef CONFIG_MOUSE { "ui.mouse_disable", change_hook_ui_mouse_disable }, +#endif { "ui", change_hook_ui }, { NULL, NULL }, }; From 516d6aa314b1e354f9c3190b8511766db27dc7e2 Mon Sep 17 00:00:00 2001 From: Witold Filipczyk Date: Sat, 10 Sep 2022 12:26:57 +0200 Subject: [PATCH 2/4] [dos] Try to fix Dockerfile --- docker/djgpp/Dockerfile | 16 ++++++++-------- docker/djgpp/mes_djgpp.sh | 1 + docker/djgpp/mes_djgpp_js.sh | 1 + src/osdep/dos/Makefile | 2 +- src/osdep/dos/{dos.c => dos.cpp} | 0 src/osdep/dos/meson.build | 2 +- 6 files changed, 12 insertions(+), 10 deletions(-) rename src/osdep/dos/{dos.c => dos.cpp} (100%) diff --git a/docker/djgpp/Dockerfile b/docker/djgpp/Dockerfile index 01e24eef4..59c3eb21a 100644 --- a/docker/djgpp/Dockerfile +++ b/docker/djgpp/Dockerfile @@ -11,9 +11,9 @@ FROM fedora:latest RUN dnf -y update && dnf -y install bash wget \ rsync vim screen git make automake meson unzip cmake patch -RUN cd /root; wget http://ftp.delorie.com/pub/djgpp/rpms/djcross-gcc-12.1.0/djcross-gcc-12.1.0-1ap.x86_64.rpm ; \ -wget http://ftp.delorie.com/pub/djgpp/rpms/djcross-gcc-12.1.0/djcross-gcc-c++-12.1.0-1ap.x86_64.rpm ; \ -wget http://ftp.delorie.com/pub/djgpp/rpms/djcross-gcc-12.1.0/djcross-gcc-tools-12.1.0-1ap.x86_64.rpm ; \ +RUN cd /root; wget http://ftp.delorie.com/pub/djgpp/rpms/djcross-gcc-12.2.0/djcross-gcc-12.2.0-1ap.x86_64.rpm ; \ +wget http://ftp.delorie.com/pub/djgpp/rpms/djcross-gcc-12.2.0/djcross-gcc-c++-12.2.0-1ap.x86_64.rpm ; \ +wget http://ftp.delorie.com/pub/djgpp/rpms/djcross-gcc-12.2.0/djcross-gcc-tools-12.2.0-1ap.x86_64.rpm ; \ wget http://ftp.delorie.com/pub/djgpp/rpms/djcross-binutils-2.34-1ap.x86_64.rpm ; \ wget http://ftp.delorie.com/pub/djgpp/rpms/djcrx-2.05-5.x86_64.rpm ; \ rpm -Uhv *.rpm @@ -84,14 +84,14 @@ make install; \ rm -rf /root/tmp # libxml++5 -RUN dnf -y install mm-common libtool +RUN dnf -y install mm-common libtool xz # libxml++5 cd RUN mkdir /root/tmp; cd /root/tmp; \ -git clone https://github.com/libxmlplusplus/libxmlplusplus; \ -cd libxmlplusplus; -ADD build_xmlplusplus.sh /root/tmp/libxmlplusplus/build_xmlplusplus.sh -RUN cd /root/tmp/libxmlplusplus; \ +wget https://github.com/libxmlplusplus/libxmlplusplus/releases/download/5.0.2/libxml++-5.0.2.tar.xz; \ +tar -xf libxml++-5.0.2.tar.xz; +ADD build_xmlplusplus.sh /root/tmp/libxml++-5.0.2/build_xmlplusplus.sh +RUN cd /root/tmp/libxml++-5.0.2; \ ./build_xmlplusplus.sh # quickjs diff --git a/docker/djgpp/mes_djgpp.sh b/docker/djgpp/mes_djgpp.sh index 46609d6de..beb7d4d52 100755 --- a/docker/djgpp/mes_djgpp.sh +++ b/docker/djgpp/mes_djgpp.sh @@ -6,6 +6,7 @@ LIBRARY_PATH="/usr/local/lib" \ PKG_CONFIG_PATH="/usr/local/lib/pkgconfig" \ C_INCLUDE_PATH="/usr/local/include" \ CFLAGS="-O2 -I/usr/local/include -DWATT32_NO_NAMESPACE" \ +CXXFLAGS="-O2 -I/usr/local/include -DWATT32_NO_NAMESPACE" \ LDFLAGS="-L/usr/local/lib" \ meson /tmp/builddir --cross-file cross/linux-djgpp.txt \ -D88-colors=false \ diff --git a/docker/djgpp/mes_djgpp_js.sh b/docker/djgpp/mes_djgpp_js.sh index bc351308f..4ed36d136 100755 --- a/docker/djgpp/mes_djgpp_js.sh +++ b/docker/djgpp/mes_djgpp_js.sh @@ -7,6 +7,7 @@ LIBRARY_PATH="/usr/local/lib" \ PKG_CONFIG_PATH="/usr/local/lib/pkgconfig" \ C_INCLUDE_PATH="/usr/local/include" \ CFLAGS="-I/usr/local/include -DWATT32_NO_NAMESPACE" \ +CXXFLAGS="-I/usr/local/include -DWATT32_NO_NAMESPACE" \ LDFLAGS="-L/usr/local/lib" \ meson /tmp/builddir2 --cross-file cross/linux-djgpp.txt \ -D88-colors=false \ diff --git a/src/osdep/dos/Makefile b/src/osdep/dos/Makefile index 7c37c345a..afd85cdc9 100644 --- a/src/osdep/dos/Makefile +++ b/src/osdep/dos/Makefile @@ -1,6 +1,6 @@ top_builddir=../../.. include $(top_builddir)/Makefile.config -OBJS = dos.o +OBJS = dos.obj include $(top_srcdir)/Makefile.lib diff --git a/src/osdep/dos/dos.c b/src/osdep/dos/dos.cpp similarity index 100% rename from src/osdep/dos/dos.c rename to src/osdep/dos/dos.cpp diff --git a/src/osdep/dos/meson.build b/src/osdep/dos/meson.build index 3a4ed999b..f5bab831c 100644 --- a/src/osdep/dos/meson.build +++ b/src/osdep/dos/meson.build @@ -1 +1 @@ -srcs += files('dos.c') +srcs += files('dos.cpp') From e7603f2b211428ba387e1437a4333e171bbc880d Mon Sep 17 00:00:00 2001 From: Witold Filipczyk Date: Sat, 10 Sep 2022 12:40:21 +0200 Subject: [PATCH 3/4] [dos] compilation fixes --- docker/djgpp/Dockerfile | 2 +- src/osdep/dos/dos.cpp | 12 ++++++------ src/osdep/dos/vpipe.inc | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/docker/djgpp/Dockerfile b/docker/djgpp/Dockerfile index 59c3eb21a..4f0c42492 100644 --- a/docker/djgpp/Dockerfile +++ b/docker/djgpp/Dockerfile @@ -111,7 +111,7 @@ make -f Makefile.dos install # get elinks source RUN dnf -y install pkgconf-pkg-config gettext -RUN cd /root; git clone https://github.com/rkd77/elinks +RUN cd /root; git clone https://github.com/rkd77/elinks ADD mes_djgpp.sh /root/elinks/mes_djgpp.sh RUN cd /root/elinks; \ ./mes_djgpp.sh; diff --git a/src/osdep/dos/dos.cpp b/src/osdep/dos/dos.cpp index 6f33a73e6..f0b423657 100644 --- a/src/osdep/dos/dos.cpp +++ b/src/osdep/dos/dos.cpp @@ -345,9 +345,9 @@ static void dos_mouse_enqueue(int x, int y, int b) overalloc(); } if (dos_mouse_queue == NULL) { - dos_mouse_queue = mem_alloc((dos_mouse_queue_n + 1) * sizeof(struct interlink_event)); + dos_mouse_queue = (struct interlink_event *)mem_alloc((dos_mouse_queue_n + 1) * sizeof(struct interlink_event)); } else { - dos_mouse_queue = mem_realloc(dos_mouse_queue, (dos_mouse_queue_n + 1) * sizeof(struct interlink_event)); + dos_mouse_queue = (struct interlink_event *)mem_realloc(dos_mouse_queue, (dos_mouse_queue_n + 1) * sizeof(struct interlink_event)); } set_last: dos_mouse_queue[dos_mouse_queue_n].ev = EVENT_MOUSE; @@ -510,7 +510,7 @@ void save_terminal(void) screen_backbuffer = NULL; mem_free(sc); } - sc = mem_alloc(2 * screen_backbuffer_x * screen_backbuffer_y); + sc = (unsigned char *)mem_alloc(2 * screen_backbuffer_x * screen_backbuffer_y); ScreenRetrieve(sc); ScreenGetCursor(&saved_cursor_y, &saved_cursor_x); screen_backbuffer = sc; @@ -779,7 +779,7 @@ int dos_write(int fd, const void *buf, size_t size) /*printf("dos_write(%d,%d) : %d,%d\n", r, errno, fd, size);*/ if (r != -2) return r; if (fd == 1) { - ansi_write(buf, size); + ansi_write((const unsigned char *)buf, size); return size; } return write(fd, buf, size); @@ -1001,8 +1001,8 @@ void os_seed_random(unsigned char **pool, int *pool_size) { unsigned *random_pool, *tmp_pool; int a, i; - random_pool = mem_alloc(RANDOM_POOL_SIZE); - tmp_pool = mem_alloc(RANDOM_POOL_SIZE); + random_pool = (unsigned *)mem_alloc(RANDOM_POOL_SIZE); + tmp_pool = (unsigned *)mem_alloc(RANDOM_POOL_SIZE); for (a = 0; a <= 640 * 1024 - RANDOM_POOL_SIZE; a += RANDOM_POOL_SIZE) { dosmemget(a, RANDOM_POOL_SIZE, tmp_pool); for (i = 0; i < RANDOM_POOL_SIZE / 4; i++) diff --git a/src/osdep/dos/vpipe.inc b/src/osdep/dos/vpipe.inc index 2aab9ac68..6dbdeb253 100644 --- a/src/osdep/dos/vpipe.inc +++ b/src/osdep/dos/vpipe.inc @@ -147,7 +147,7 @@ static int vpipe_create(int fd[2]) errno = EMFILE; goto err2; } - desc = malloc(sizeof(struct virtual_pipe)); + desc = (struct virtual_pipe *)malloc(sizeof(struct virtual_pipe)); if (!desc) goto err2; desc->used = 0; desc->n_rd = 1; From ea7094ecb1ccc1f77e9ed28237d2aa4922596443 Mon Sep 17 00:00:00 2001 From: Witold Filipczyk Date: Sun, 11 Sep 2022 13:42:40 +0200 Subject: [PATCH 4/4] [spidermonkey] Show version of mozjs in About dialog --- src/ecmascript/spidermonkey.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/ecmascript/spidermonkey.cpp b/src/ecmascript/spidermonkey.cpp index 1e4013828..4332c59b0 100644 --- a/src/ecmascript/spidermonkey.cpp +++ b/src/ecmascript/spidermonkey.cpp @@ -122,9 +122,14 @@ reported: JS_ClearPendingException(ctx); } +static char spidermonkey_version[32]; + static void -spidermonkey_init(struct module *xxx) +spidermonkey_init(struct module *module) { + snprintf(spidermonkey_version, 31, "mozjs %s", JS_GetImplementationVersion()); + module->name = spidermonkey_version; + js_module_init_ok = spidermonkey_runtime_addref(); }