fix clash with VERSION and new C++ header <version> on macos
Some checks failed
ci / Windows MSYS2 (push) Waiting to run
ci / Linux (Ubuntu) (push) Failing after 0s
ci / Linux 32bit (push) Failing after 3s
ci / linux-asan (push) Failing after 3s
ci / Windows (mingw) (push) Failing after 3s
ci / MinGW Windows target (push) Failing after 4s
ci / Linux LTO (push) Failing after 19s
ci / qemu-alpine (linux/386) (push) Failing after 5s
ci / qemu-alpine (linux/arm/v6) (push) Failing after 5s
ci / qemu-alpine (linux/arm/v7) (push) Failing after 4s
ci / qemu-alpine (linux/arm64) (push) Failing after 4s
ci / qemu-alpine (linux/ppc64le) (push) Failing after 4s
ci / qemu-alpine (linux/riscv64) (push) Failing after 4s
ci / qemu-alpine (linux/s390x) (push) Failing after 4s
ci / linux-ubsan (push) Failing after 34s
ci / Cosmopolitan (push) Successful in 1m2s
ci / freebsd (push) Failing after 12m7s
ci / macOS (push) Failing after 4s
ci / macos-asan (push) Failing after 3s
ci / macos-ubsan (push) Failing after 3s

This commit is contained in:
2025-05-05 09:13:36 -05:00
parent ab8b09f183
commit 4908cc5c62
4 changed files with 13 additions and 9 deletions

View File

@@ -147,7 +147,7 @@ CFLAGS+=-fwrapv # ensure that signed overflows behave as expected
ifdef CONFIG_WERROR
CFLAGS+=-Werror
endif
DEFINES:=-D_GNU_SOURCE -DCONFIG_VERSION=\"$(shell cat VERSION)\"
DEFINES:=-D_GNU_SOURCE -DCONFIG_VERSION=\"$(shell cat VERSION.md)\"
ifdef CONFIG_WIN32
DEFINES+=-D__USE_MINGW_ANSI_STDIO # for standard snprintf behavior
endif
@@ -423,7 +423,7 @@ build_doc: $(DOCS)
clean_doc:
rm -f $(DOCS)
doc/version.texi: VERSION
doc/version.texi: VERSION.md
@echo "@set VERSION `cat $<`" > $@
doc/%.pdf: doc/%.texi doc/version.texi

View File

View File

@@ -1,4 +1,4 @@
project('quickjs', 'c')
project('quickjs', 'c', meson_version: '>=1.1')
cc = meson.get_compiler('c')
@@ -8,7 +8,12 @@ deps = []
deps += cc.find_library('m', required:false)
deps += threads
add_project_arguments('-DCONFIG_VERSION="2024-02-14"', '-mcmodel=large', language: 'c')
fs = import('fs')
ver_file = join_paths(meson.current_source_dir(), 'VERSION.md')
qjs_ver = fs.read(ver_file).strip()
add_project_arguments('-DCONFIG_VERSION="@0@"'.format(qjs_ver), '-mcmodel=large', language: 'c')
if get_option('bignum')
add_project_arguments('-DCONFIG_BIGNUM', language : 'c')

View File

@@ -13243,8 +13243,6 @@ static __maybe_unused void JS_DumpObject(FILE *fp, JSRuntime *rt, JSObject *p)
static __maybe_unused void JS_DumpGCObject(FILE *fp, JSRuntime *rt, JSGCObjectHeader *p)
{
struct gc_object obj;
if (p->gc_obj_type == JS_GC_OBJ_TYPE_JS_OBJECT) {
JS_DumpObject(fp, rt, (JSObject *)p);
} else {
@@ -13423,7 +13421,8 @@ int JS_ArrayLength(JSContext *ctx, JSValueConst val)
JSObject *p = JS_VALUE_GET_OBJ(val);
if (p->class_id != JS_CLASS_ARRAY) return 0;
uint32_t len;
js_get_length32(ctx, &len, val);
if (js_get_length32(ctx, &len, val))
return 0;
return len;
}
@@ -54977,7 +54976,7 @@ void js_debug_info(JSContext *js, JSValue fn, js_debug *dbg)
if (!JS_IsObject(fn)) return;
JSObject *p = JS_VALUE_GET_OBJ(fn);
char *fn_name = get_func_name(js,fn);
const char *fn_name = get_func_name(js,fn);
if (!fn_name || fn_name[0] == 0)
dbg->name = js_strdup(js, "<anonymous>");
@@ -54992,7 +54991,7 @@ void js_debug_info(JSContext *js, JSValue fn, js_debug *dbg)
case JS_CLASS_BYTECODE_FUNCTION: {
JSFunctionBytecode *b = p->u.func.function_bytecode;
// get filename
char *filename = JS_AtomToCString(js, b->debug.filename);
const char *filename = JS_AtomToCString(js, b->debug.filename);
if (!filename || filename[0] == 0)
dbg->filename = js_strdup(js, "unknown");
else {