Skip to content

Commit

Permalink
QuickJS: improved library discovery.
Browse files Browse the repository at this point in the history
Add explicit testing for JS_GetClassID() function since it is not available
in older QuickJS versions.

This closes #801 issue on Github.
  • Loading branch information
xeioex committed Oct 23, 2024
1 parent 073a34c commit 606ceb2
Showing 1 changed file with 22 additions and 1 deletion.
23 changes: 22 additions & 1 deletion auto/quickjs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ if [ $NJS_TRY_QUICKJS = YES ]; then
JSRuntime *rt;

rt = JS_NewRuntime();
(void) JS_GetClassID;
JS_FreeRuntime(rt);
return 0;
}"
Expand Down Expand Up @@ -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 <quickjs.h>

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
Expand Down

0 comments on commit 606ceb2

Please sign in to comment.