Skip to content

Commit

Permalink
Add LoadKernelExtension
Browse files Browse the repository at this point in the history
  • Loading branch information
limakzi authored and ChrisJefferson committed Aug 26, 2024
1 parent 1e63995 commit bd52ebc
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion PackageInfo.g
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ Dependencies := rec(
),

AvailabilityTest := function()
if Filename(DirectoriesPackagePrograms("json"), "json.so") = fail then
if IsKernelExtensionAvailable("json") = false then
LogPackageLoadingMessage( PACKAGE_WARNING,
[ "kernel functions for json are not available." ] );
return false;
Expand Down
7 changes: 3 additions & 4 deletions init.g
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,9 @@
#
# Reading the declaration part of the package.
#
_PATH_SO:=Filename(DirectoriesPackagePrograms("json"), "json.so");
if _PATH_SO <> fail then
LoadDynamicModule(_PATH_SO);

if LoadKernelExtension("json", "json") = false then
Error("failed to load json kernel extension");
fi;
Unbind(_PATH_SO);

ReadPackage( "json", "gap/json.gd");

0 comments on commit bd52ebc

Please sign in to comment.