From: Dmitry Volyntsev Date: Wed, 23 Oct 2024 01:50:46 +0000 (-0700) Subject: QuickJS: improved library discovery. X-Git-Tag: 0.8.8~19 X-Git-Url: http://www.kaiwu.me/postgresql/commit/?a=commitdiff_plain;h=606ceb243c49ce336be8d34085ee158f3723e271;p=njs.git QuickJS: improved library discovery. Add explicit testing for JS_GetClassID() function since it is not available in older QuickJS versions. This closes #801 issue on Github. --- diff --git a/auto/quickjs b/auto/quickjs index 8451d44d..9aeb485a 100644 --- a/auto/quickjs +++ b/auto/quickjs @@ -25,7 +25,6 @@ if [ $NJS_TRY_QUICKJS = YES ]; then JSRuntime *rt; rt = JS_NewRuntime(); - (void) JS_GetClassID; JS_FreeRuntime(rt); return 0; }" @@ -56,6 +55,28 @@ if [ $NJS_TRY_QUICKJS = YES ]; then if [ $njs_found = yes ]; then + njs_feature="QuickJS JS_GetClassID()" + njs_feature_test="#if defined(__GNUC__) && (__GNUC__ >= 8) + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored \"-Wcast-function-type\" + #endif + + #include + + int main() { + (void) JS_GetClassID; + return 0; + }" + + . auto/feature + + if [ $njs_found = no ]; then + echo + echo $0: error: QuickJS library found, but JS_GetClassID\(\) is missing. + echo + exit 1; + fi + njs_feature="QuickJS JS_NewTypedArray()" njs_feature_test="#if defined(__GNUC__) && (__GNUC__ >= 8) #pragma GCC diagnostic push