diff --git a/meson.build b/meson.build index eb433386..f0f9c114 100644 --- a/meson.build +++ b/meson.build @@ -1,4 +1,4 @@ -project('elinks', ['c','cpp'], version:'0.16.GIT', license:'GPLv2') +project('elinks', ['c','cpp'], version:'0.16.GIT', license:'GPLv2', default_options:['cpp_std=gnu++17']) srcs=[] srcdir = meson.source_root() @@ -154,7 +154,7 @@ extracflags = [] extracppflags = [] if conf_data.get('CONFIG_ECMASCRIPT') - extracppflags += ['-fpermissive', '-Wno-sign-compare', '-std=gnu++17'] + extracppflags += ['-fpermissive', '-Wno-sign-compare'] else extracflags += ['-Wc++-compat'] endif @@ -384,6 +384,7 @@ if conf_data.get('CONFIG_BZIP2') deps += bz2deps endif +mozjsdeps = [] if conf_data.get('CONFIG_ECMASCRIPT_SMJS') or conf_data.get('CONFIG_SCRIPTING_SPIDERMONKEY') mozjsdeps = dependency('mozjs-102', static: st) deps += mozjsdeps diff --git a/src/ecmascript/ecmascript.cpp b/src/ecmascript/ecmascript.cpp index b33df88b..7ddd3ebe 100644 --- a/src/ecmascript/ecmascript.cpp +++ b/src/ecmascript/ecmascript.cpp @@ -526,7 +526,6 @@ ecmascript_protocol_handler(struct session *ses, struct uri *uri) done_uri(redirect_uri); } - void ecmascript_timeout_dialog(struct terminal *term, int max_exec_time) { diff --git a/src/ecmascript/ecmascript.h b/src/ecmascript/ecmascript.h index dcb76832..c93973fa 100644 --- a/src/ecmascript/ecmascript.h +++ b/src/ecmascript/ecmascript.h @@ -33,6 +33,10 @@ #include #endif +#ifdef __cplusplus +extern "C" { +#endif + struct document_view; struct form_state; struct form_view; @@ -194,6 +198,10 @@ extern int local_storage_ready; extern struct module ecmascript_module; +#ifdef __cplusplus +} +#endif + #endif #endif diff --git a/src/protocol/test/meson.build b/src/protocol/test/meson.build index 4147924c..18aadcac 100644 --- a/src/protocol/test/meson.build +++ b/src/protocol/test/meson.build @@ -31,7 +31,7 @@ meson.source_root()+'/src/util/env.c') endif exe = executable('uri-test', uri_test_files, -testdeps, dependencies: [idna_dep], +testdeps, dependencies: [idna_dep, mozjsdeps], c_args:['-DHAVE_CONFIG_H'], cpp_args:['-DHAVE_CONFIG_H'], include_directories:['.', '..', '../..', '../../..', '../../../..']) t = find_program('test-normalize-uri') test_lib = environment({'TEST_LIB':meson.source_root()+'/test/libtest.sh'})