From c96f4c71774fa65df1ccf2803950a86ca14f8371 Mon Sep 17 00:00:00 2001 From: Witold Filipczyk Date: Fri, 5 May 2023 20:48:14 +0200 Subject: [PATCH] [meson] Removed CONFIG_XML --- meson.build | 7 ------- meson_options.txt | 1 - src/document/document.cpp | 11 +++++------ src/document/libdom/mapa.cpp | 7 +++++++ src/document/libdom/mapa.h | 2 ++ 5 files changed, 14 insertions(+), 14 deletions(-) diff --git a/meson.build b/meson.build index d30c1c04..f33ee670 100644 --- a/meson.build +++ b/meson.build @@ -99,7 +99,6 @@ conf_data.set('CONFIG_OPENSSL', get_option('openssl')) conf_data.set('CONFIG_LIBEV', get_option('libev')) conf_data.set('CONFIG_LIBEVENT', get_option('libevent')) conf_data.set('CONFIG_X', get_option('x')) -conf_data.set('CONFIG_XML', get_option('xml')) conf_data.set('CONFIG_QUICKJS', get_option('quickjs')) conf_data.set('CONFIG_MUJS', get_option('mujs')) conf_data.set('CONFIG_CODEPOINT', get_option('codepoint')) @@ -405,7 +404,6 @@ endif if conf_data.get('CONFIG_ECMASCRIPT_SMJS') or conf_data.get('CONFIG_QUICKJS') or conf_data.get('CONFIG_MUJS') sqlite3deps = dependency('sqlite3', static: st) deps += sqlite3deps - conf_data.set('CONFIG_XML', true) endif if conf_data.get('CONFIG_ECMASCRIPT_SMJS') or conf_data.get('CONFIG_QUICKJS') or conf_data.get('CONFIG_MUJS') @@ -447,11 +445,6 @@ if conf_data.get('CONFIG_GPM') deps += libgpmdeps endif -if conf_data.get('CONFIG_XML') - xmlplusplusdeps = dependency('libxml++-5.0', static: st) - deps += xmlplusplusdeps -endif - if conf_data.get('CONFIG_SCRIPTING_PYTHON') python3deps = dependency('python3-embed', static: st) deps += python3deps diff --git a/meson_options.txt b/meson_options.txt index 47c4a95f..12e15b68 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -60,7 +60,6 @@ option('openssl', type: 'boolean', value: true, description: 'OpenSSL support') option('libev', type: 'boolean', value: false, description: 'compile with libev (libevent compatibility mode)') option('libevent', type: 'boolean', value: false, description: 'compile with libevent. Note that libev has precedence') option('x', type: 'boolean', value: false, description: 'use the X Window System') -option('xml', type: 'boolean', value: false, description: 'libxml++') option('gemini', type: 'boolean', value: false, description: 'gemini protocol support') option('gettext', type: 'boolean', value: false, description: 'use external gettext library') option('quickjs', type: 'boolean', value: false, description: 'use quickjs library') diff --git a/src/document/document.cpp b/src/document/document.cpp index 5c7bc052..3d202e26 100644 --- a/src/document/document.cpp +++ b/src/document/document.cpp @@ -68,9 +68,8 @@ #include "ecmascript/spidermonkey.h" #endif -#if defined(CONFIG_ECMASCRIPT_SMJS) || defined(CONFIG_QUICKJS) || defined(CONFIG_MUJS) -#include -#include +#ifdef CONFIG_LIBDOM +#include "document/libdom/mapa.h" #endif #include "main/module.h" @@ -385,10 +384,10 @@ done_document(struct document *document) free_document(document->dom); if (document->element_map) { - std::map *mapa = (std::map *)document->element_map; + void *mapa = document->element_map; - mapa->clear(); - delete mapa; + clear_map(mapa); + delete_map(mapa); } #endif diff --git a/src/document/libdom/mapa.cpp b/src/document/libdom/mapa.cpp index 94fc2932..11e8438d 100644 --- a/src/document/libdom/mapa.cpp +++ b/src/document/libdom/mapa.cpp @@ -30,6 +30,13 @@ clear_map(void *m) mapa->clear(); } +void +delete_map(void *m) +{ + std::map *mapa = static_cast *>(m); + delete mapa; +} + void * find_in_map(void *m, int offset) { diff --git a/src/document/libdom/mapa.h b/src/document/libdom/mapa.h index f88bf275..8eedb024 100644 --- a/src/document/libdom/mapa.h +++ b/src/document/libdom/mapa.h @@ -8,6 +8,8 @@ extern "C" { void save_in_map(void *m, void *node, int length); void *create_new_element_map(void); void clear_map(void *m); +void delete_map(void *m); + void *find_in_map(void *m, int offset); #ifdef __cplusplus