From: Vadim Zhestikov Date: Wed, 19 Mar 2025 16:12:45 +0000 (-0700) Subject: QuickJS: using JS_AddIntrinsicBigInt() if detected. X-Git-Tag: 0.8.10~13 X-Git-Url: http://www.kaiwu.me/postgresql/commit/static/gitweb.js?a=commitdiff_plain;h=f3454f01588a6eabfc7c883577544019fbb50f76;p=njs.git QuickJS: using JS_AddIntrinsicBigInt() if detected. --- diff --git a/auto/quickjs b/auto/quickjs index 97432142..e4eecd29 100644 --- a/auto/quickjs +++ b/auto/quickjs @@ -137,6 +137,29 @@ if [ $NJS_TRY_QUICKJS = YES ]; then . auto/feature + njs_feature="QuickJS JS_AddIntrinsicBigInt()" + njs_feature_name=NJS_HAVE_QUICKJS_ADD_INTRINSIC_BIG_INT + njs_feature_test="#if defined(__GNUC__) && (__GNUC__ >= 8) + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored \"-Wcast-function-type\" + #endif + + #include + + int main() { + JSRuntime *rt; + JSContext *ctx; + + rt = JS_NewRuntime(); + ctx = JS_NewContextRaw(rt); + JS_AddIntrinsicBigInt(ctx); + JS_FreeContext(ctx); + JS_FreeRuntime(rt); + return 0; + }" + + . auto/feature + njs_feature="QuickJS version" njs_feature_name=NJS_QUICKJS_VERSION njs_feature_run=value diff --git a/src/qjs.c b/src/qjs.c index 38015bb9..7763c165 100644 --- a/src/qjs.c +++ b/src/qjs.c @@ -165,7 +165,9 @@ qjs_new_context(JSRuntime *rt, qjs_module_t **addons) JS_AddIntrinsicMapSet(ctx); JS_AddIntrinsicTypedArrays(ctx); JS_AddIntrinsicPromise(ctx); +#ifdef NJS_HAVE_QUICKJS_ADD_INTRINSIC_BIG_INT JS_AddIntrinsicBigInt(ctx); +#endif JS_AddIntrinsicEval(ctx); for (module = qjs_modules; *module != NULL; module++) {