From 0ab4d7290d9424d39fdf2df86bacb362887fd1f5 Mon Sep 17 00:00:00 2001 From: Kamil Zabielski <50334623+limakzi@users.noreply.github.com> Date: Mon, 26 Aug 2024 10:58:28 +0000 Subject: [PATCH] Add LoadKernelExtension --- PackageInfo.g | 2 +- init.g | 7 +++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/PackageInfo.g b/PackageInfo.g index e7312fc..17b90ef 100644 --- a/PackageInfo.g +++ b/PackageInfo.g @@ -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; diff --git a/init.g b/init.g index 73c3ed8..5f2ccdc 100644 --- a/init.g +++ b/init.g @@ -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");