mirror of
https://github.com/rkd77/elinks.git
synced 2024-12-04 14:46:47 -05:00
[smjs] Compilation fixes when -Dsm-scripting=true and -Dspidermonkey=false. Refs #176
This commit is contained in:
parent
dfa578d7d9
commit
4790ae9981
@ -363,12 +363,12 @@ if conf_data.get('CONFIG_BZIP2')
|
||||
deps += bz2deps
|
||||
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)
|
||||
deps += mozjsdeps
|
||||
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)
|
||||
deps += sqlite3deps
|
||||
conf_data.set('CONFIG_XML', true)
|
||||
|
@ -278,7 +278,7 @@ reset_document(struct document *document)
|
||||
#ifdef CONFIG_CSS
|
||||
free_uri_list(&document->css_imports);
|
||||
#endif
|
||||
#ifdef CONFIG_ECMASCRIPT
|
||||
#if defined(CONFIG_ECMASCRIPT_SMJS) || defined(CONFIG_QUICKJS)
|
||||
free_string_list(&document->onload_snippets);
|
||||
free_uri_list(&document->ecmascript_imports);
|
||||
mem_free_set(&document->text, NULL);
|
||||
@ -348,7 +348,7 @@ done_document(struct document *document)
|
||||
#ifdef CONFIG_CSS
|
||||
free_uri_list(&document->css_imports);
|
||||
#endif
|
||||
#ifdef CONFIG_ECMASCRIPT
|
||||
#if defined(CONFIG_ECMASCRIPT_SMJS) || defined(CONFIG_QUICKJS)
|
||||
free_string_list(&document->onload_snippets);
|
||||
free_uri_list(&document->ecmascript_imports);
|
||||
kill_timer(&document->timeout);
|
||||
|
@ -86,7 +86,9 @@ struct ecmascript_interpreter {
|
||||
#ifdef CONFIG_QUICKJS
|
||||
JSValueConst fun;
|
||||
#else
|
||||
#ifdef CONFIG_ECMASCRIPT_SMJS
|
||||
JS::RootedValue fun;
|
||||
#endif
|
||||
#endif
|
||||
bool changed;
|
||||
};
|
||||
|
@ -33,7 +33,7 @@
|
||||
#include "util/memory.h"
|
||||
#include "util/time.h"
|
||||
|
||||
#ifdef CONFIG_ECMASCRIPT
|
||||
#if defined(CONFIG_ECMASCRIPT_SMJS) || defined(CONFIG_QUICKJS)
|
||||
#include "ecmascript/timer.h"
|
||||
#endif
|
||||
|
||||
@ -106,7 +106,7 @@ check_timers(timeval_T *last_time)
|
||||
break;
|
||||
|
||||
del_from_list(timer);
|
||||
#ifdef CONFIG_ECMASCRIPT
|
||||
#if defined(CONFIG_ECMASCRIPT_SMJS) || defined(CONFIG_QUICKJS)
|
||||
del_from_map_timer(timer);
|
||||
#endif
|
||||
/* 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);
|
||||
}
|
||||
#ifdef CONFIG_ECMASCRIPT
|
||||
#if defined(CONFIG_ECMASCRIPT_SMJS) || defined(CONFIG_QUICKJS)
|
||||
add_to_map_timer(new_timer);
|
||||
#endif
|
||||
}
|
||||
@ -206,7 +206,7 @@ kill_timer(timer_id_T *id)
|
||||
if (*id == TIMER_ID_UNDEF) return;
|
||||
timer = *id;
|
||||
del_from_list(timer);
|
||||
#ifdef CONFIG_ECMASCRIPT
|
||||
#if defined(CONFIG_ECMASCRIPT_SMJS) || defined(CONFIG_QUICKJS)
|
||||
del_from_map_timer(timer);
|
||||
#endif
|
||||
|
||||
|
@ -672,7 +672,7 @@ do_action(struct session *ses, main_action_T action_id, int verbose)
|
||||
break;
|
||||
|
||||
case ACT_MAIN_TOGGLE_ECMASCRIPT:
|
||||
#ifdef CONFIG_ECMASCRIPT
|
||||
#if defined(CONFIG_ECMASCRIPT_SMJS) || defined(CONFIG_QUICKJS)
|
||||
toggle_ecmascript(ses);
|
||||
#endif
|
||||
break;
|
||||
|
@ -355,7 +355,7 @@ find_form_by_form_view(struct document *document, struct form_view *fv)
|
||||
void
|
||||
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);
|
||||
#endif
|
||||
mem_free_if(fs->value);
|
||||
@ -367,7 +367,7 @@ done_form_state(struct form_state *fs)
|
||||
void
|
||||
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);
|
||||
#endif
|
||||
mem_free(fv);
|
||||
|
Loading…
Reference in New Issue
Block a user