1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-25 10:41:16 +02:00

Merge pull request #8699 from tweag/nix-c-bindings

(Towards) stable C bindings for libutil, libexpr
This commit is contained in:
Robert Hensing 2024-04-04 17:50:52 +02:00 committed by GitHub
commit 12ec3154b8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
47 changed files with 3624 additions and 20 deletions

View file

@ -345,6 +345,12 @@ void initPlugins()
dlopen(file.c_str(), RTLD_LAZY | RTLD_LOCAL);
if (!handle)
throw Error("could not dynamically open plugin file '%s': %s", file, dlerror());
/* Older plugins use a statically initialized object to run their code.
Newer plugins can also export nix_plugin_entry() */
void (*nix_plugin_entry)() = (void (*)())dlsym(handle, "nix_plugin_entry");
if (nix_plugin_entry)
nix_plugin_entry();
}
}
@ -403,6 +409,7 @@ void assertLibStoreInitialized() {
}
void initLibStore() {
if (initLibStoreDone) return;
initLibUtil();