Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
james-d-mitchell committed Aug 26, 2024
1 parent ef1a0de commit cf302bc
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 10 deletions.
14 changes: 10 additions & 4 deletions PackageInfo.g
Original file line number Diff line number Diff line change
Expand Up @@ -122,11 +122,17 @@ Dependencies := rec(
),

AvailabilityTest := function()
if (not ("datastructures" in SHOW_STAT())) and
(Filename(DirectoriesPackagePrograms("datastructures"), "datastructures.so") = fail) then
return fail;
if CompareVersionNumbers(GAPInfo.Version, "4.12") then
if not LoadKernelExtension("datastructures") then
Error("failed to load the datastructures package kernel extension");
fi;
else
if (not ("datastructures" in SHOW_STAT())) and
(Filename(DirectoriesPackagePrograms("datastructures"), "datastructures.so") = fail) then
return fail;
fi;
return true;
fi;
return true;
end,

TestFile := "tst/testall.g",
Expand Down
18 changes: 12 additions & 6 deletions init.g
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,18 @@
#R Read the declaration files.
##

if (not IsBound(__DATASTRUCTURES_C)) and ("datastructures" in SHOW_STAT()) then
LoadStaticModule("datastructures");
fi;
if (not IsBound(__DATASTRUCTURES_C)) and
(Filename(DirectoriesPackagePrograms("datastructures"), "datastructures.so") <> fail) then
LoadDynamicModule(Filename(DirectoriesPackagePrograms("datastructures"), "datastructures.so"));
if CompareVersionNumbers(GAPInfo.Version, "4.12") then
if not LoadKernelExtension("datastructures") then
Error("failed to load the datastructures package kernel extension");
fi;
else
if (not IsBound(__DATASTRUCTURES_C)) and ("datastructures" in SHOW_STAT()) then
LoadStaticModule("datastructures");
fi;
if (not IsBound(__DATASTRUCTURES_C)) and
(Filename(DirectoriesPackagePrograms("datastructures"), "datastructures.so") <> fail) then
LoadDynamicModule(Filename(DirectoriesPackagePrograms("datastructures"), "datastructures.so"));
fi;
fi;

# interface definitions
Expand Down

0 comments on commit cf302bc

Please sign in to comment.