1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-09-27 02:56:18 -04:00

[smjs] Compilation fixes when -Dsm-scripting=true and -Dspidermonkey=false. Refs #176

This commit is contained in:
Witold Filipczyk 2022-06-16 17:33:06 +02:00
parent dfa578d7d9
commit 4790ae9981
6 changed files with 13 additions and 11 deletions

View File

@ -363,12 +363,12 @@ if conf_data.get('CONFIG_BZIP2')
deps += bz2deps deps += bz2deps
endif endif
if conf_data.get('CONFIG_ECMASCRIPT_SMJS') if conf_data.get('CONFIG_ECMASCRIPT_SMJS') or conf_data.get('CONFIG_SCRIPTING_SPIDERMONKEY')
mozjsdeps = dependency('mozjs-78', static: st) mozjsdeps = dependency('mozjs-78', static: st)
deps += mozjsdeps deps += mozjsdeps
endif endif
if conf_data.get('CONFIG_ECMASCRIPT') if conf_data.get('CONFIG_ECMASCRIPT_SMJS') or conf_data.get('CONFIG_QUICKJS')
sqlite3deps = dependency('sqlite3', static: st) sqlite3deps = dependency('sqlite3', static: st)
deps += sqlite3deps deps += sqlite3deps
conf_data.set('CONFIG_XML', true) conf_data.set('CONFIG_XML', true)

View File

@ -278,7 +278,7 @@ reset_document(struct document *document)
#ifdef CONFIG_CSS #ifdef CONFIG_CSS
free_uri_list(&document->css_imports); free_uri_list(&document->css_imports);
#endif #endif
#ifdef CONFIG_ECMASCRIPT #if defined(CONFIG_ECMASCRIPT_SMJS) || defined(CONFIG_QUICKJS)
free_string_list(&document->onload_snippets); free_string_list(&document->onload_snippets);
free_uri_list(&document->ecmascript_imports); free_uri_list(&document->ecmascript_imports);
mem_free_set(&document->text, NULL); mem_free_set(&document->text, NULL);
@ -348,7 +348,7 @@ done_document(struct document *document)
#ifdef CONFIG_CSS #ifdef CONFIG_CSS
free_uri_list(&document->css_imports); free_uri_list(&document->css_imports);
#endif #endif
#ifdef CONFIG_ECMASCRIPT #if defined(CONFIG_ECMASCRIPT_SMJS) || defined(CONFIG_QUICKJS)
free_string_list(&document->onload_snippets); free_string_list(&document->onload_snippets);
free_uri_list(&document->ecmascript_imports); free_uri_list(&document->ecmascript_imports);
kill_timer(&document->timeout); kill_timer(&document->timeout);

View File

@ -86,7 +86,9 @@ struct ecmascript_interpreter {
#ifdef CONFIG_QUICKJS #ifdef CONFIG_QUICKJS
JSValueConst fun; JSValueConst fun;
#else #else
#ifdef CONFIG_ECMASCRIPT_SMJS
JS::RootedValue fun; JS::RootedValue fun;
#endif
#endif #endif
bool changed; bool changed;
}; };

View File

@ -33,7 +33,7 @@
#include "util/memory.h" #include "util/memory.h"
#include "util/time.h" #include "util/time.h"
#ifdef CONFIG_ECMASCRIPT #if defined(CONFIG_ECMASCRIPT_SMJS) || defined(CONFIG_QUICKJS)
#include "ecmascript/timer.h" #include "ecmascript/timer.h"
#endif #endif
@ -106,7 +106,7 @@ check_timers(timeval_T *last_time)
break; break;
del_from_list(timer); del_from_list(timer);
#ifdef CONFIG_ECMASCRIPT #if defined(CONFIG_ECMASCRIPT_SMJS) || defined(CONFIG_QUICKJS)
del_from_map_timer(timer); del_from_map_timer(timer);
#endif #endif
/* At this point, *@timer is to be considered invalid /* At this point, *@timer is to be considered invalid
@ -192,7 +192,7 @@ install_timer(timer_id_T *id, milliseconds_T delay, void (*func)(void *), void *
add_at_pos(timer->prev, new_timer); add_at_pos(timer->prev, new_timer);
} }
#ifdef CONFIG_ECMASCRIPT #if defined(CONFIG_ECMASCRIPT_SMJS) || defined(CONFIG_QUICKJS)
add_to_map_timer(new_timer); add_to_map_timer(new_timer);
#endif #endif
} }
@ -206,7 +206,7 @@ kill_timer(timer_id_T *id)
if (*id == TIMER_ID_UNDEF) return; if (*id == TIMER_ID_UNDEF) return;
timer = *id; timer = *id;
del_from_list(timer); del_from_list(timer);
#ifdef CONFIG_ECMASCRIPT #if defined(CONFIG_ECMASCRIPT_SMJS) || defined(CONFIG_QUICKJS)
del_from_map_timer(timer); del_from_map_timer(timer);
#endif #endif

View File

@ -672,7 +672,7 @@ do_action(struct session *ses, main_action_T action_id, int verbose)
break; break;
case ACT_MAIN_TOGGLE_ECMASCRIPT: case ACT_MAIN_TOGGLE_ECMASCRIPT:
#ifdef CONFIG_ECMASCRIPT #if defined(CONFIG_ECMASCRIPT_SMJS) || defined(CONFIG_QUICKJS)
toggle_ecmascript(ses); toggle_ecmascript(ses);
#endif #endif
break; break;

View File

@ -355,7 +355,7 @@ find_form_by_form_view(struct document *document, struct form_view *fv)
void void
done_form_state(struct form_state *fs) done_form_state(struct form_state *fs)
{ {
#if defined(CONFIG_ECMASCRIPT) || defined(CONFIG_ECMASCRIPT_SMJS) #if defined(CONFIG_ECMASCRIPT_SMJS) || defined(CONFIG_QUICKJS)
ecmascript_detach_form_state(fs); ecmascript_detach_form_state(fs);
#endif #endif
mem_free_if(fs->value); mem_free_if(fs->value);
@ -367,7 +367,7 @@ done_form_state(struct form_state *fs)
void void
done_form_view(struct form_view *fv) done_form_view(struct form_view *fv)
{ {
#if defined(CONFIG_ECMASCRIPT) || defined(CONFIG_ECMASCRIPT_SMJS) #if defined(CONFIG_ECMASCRIPT_SMJS) || defined(CONFIG_QUICKJS)
ecmascript_detach_form_view(fv); ecmascript_detach_form_view(fv);
#endif #endif
mem_free(fv); mem_free(fv);