1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-06-21 00:25:37 +00:00

[dialogs] Rename info.cpp to info.c

Long term goal is to able compile by only C compiler
if ecmascript is not compiled-in.
This commit is contained in:
Witold Filipczyk 2023-11-25 13:07:29 +01:00
parent 27c513cb61
commit 7acee28e2d
9 changed files with 37 additions and 13 deletions

View File

@ -593,7 +593,7 @@ if not compiler.links('''#include <stdint.h>
return (int)__atomic_load_n(x.v, __ATOMIC_ACQUIRE) & (int)__atomic_add_fetch(x.v, (uint64_t)1, __ATOMIC_ACQ_REL);
}''',
name: 'GCC atomic builtins required -latomic')
dep_atomic = compiler.find_library('atomic', static: st)
dep_atomic = compiler.find_library('atomic', static: st)
endif
if conf_data.get('CONFIG_QUICKJS')

View File

@ -3,6 +3,6 @@ include $(top_builddir)/Makefile.config
OBJS-$(CONFIG_EXMODE) += exmode.o
OBJS = document.o download.o edit.o info.obj menu.o options.o progress.o status.o
OBJS = document.o download.o edit.o info.o menu.o options.o progress.o status.o
include $(top_srcdir)/Makefile.lib

View File

@ -23,7 +23,9 @@
#include "config/options.h"
#include "dialogs/info.h"
#include "document/renderer.h"
#include "ecmascript/ecmascript.h"
#ifdef CONFIG_ECMASCRIPT_SMJS
#include "ecmascript/ecmascript-c.h"
#endif
#include "intl/libintl.h"
#include "main/select.h"
#include "main/timer.h"

View File

@ -1,4 +1,4 @@
if conf_data.get('CONFIG_EXMODE')
srcs += files('exmode.c')
endif
srcs += files('document.c', 'download.c', 'edit.c', 'info.cpp', 'menu.c', 'options.c', 'progress.c', 'status.c')
srcs += files('document.c', 'download.c', 'edit.c', 'info.c', 'menu.c', 'options.c', 'progress.c', 'status.c')

View File

@ -0,0 +1,15 @@
/* ECMAScript helper functions */
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include "ecmascript/ecmascript-c.h"
extern int interpreter_count;
int
ecmascript_get_interpreter_count(void)
{
return interpreter_count;
}

View File

@ -0,0 +1,14 @@
#ifndef EL__ECMASCRIPT_ECMASCRIPT_C_H
#define EL__ECMASCRIPT_ECMASCRIPT_C_H
#ifdef __cplusplus
extern "C" {
#endif
int ecmascript_get_interpreter_count(void);
#ifdef __cplusplus
}
#endif
#endif

View File

@ -99,7 +99,7 @@ static union option_info ecmascript_options[] = {
NULL_OPTION_INFO,
};
static int interpreter_count;
int interpreter_count;
static INIT_LIST_OF(struct string_list_item, allowed_urls);
static INIT_LIST_OF(struct string_list_item, disallowed_urls);
@ -300,12 +300,6 @@ ecmascript_put_interpreter(struct ecmascript_interpreter *interpreter)
--interpreter_count;
}
int
ecmascript_get_interpreter_count(void)
{
return interpreter_count;
}
static void
delayed_reload(void *data)
{

View File

@ -156,7 +156,6 @@ void ecmascript_free_urls(struct module *module);
struct ecmascript_interpreter *ecmascript_get_interpreter(struct view_state*vs);
void ecmascript_put_interpreter(struct ecmascript_interpreter *interpreter);
int ecmascript_get_interpreter_count(void);
void ecmascript_detach_form_view(struct form_view *fv);
void ecmascript_detach_form_state(struct form_state *fs);

View File

@ -1,6 +1,6 @@
#INCLUDES += $(SPIDERMONKEY_CFLAGS)
if conf_data.get('CONFIG_ECMASCRIPT_SMJS')
srcs += files('ecmascript.cpp', 'localstorage-db.cpp', 'spidermonkey.cpp', 'timer.cpp')
srcs += files('ecmascript.cpp', 'ecmascript-c.cpp', 'localstorage-db.cpp', 'spidermonkey.cpp', 'timer.cpp')
subdir('spidermonkey')
endif