-
Notifications
You must be signed in to change notification settings - Fork 139
Description
There's currently no way to use multiple versions of libxkbcommon with standard dynamic linking. You're forced to use dlopen if you're going to support both Arch (on version 1.13.0 atm) and Ubuntu (on version 1.7.0).
This is very inconvenient because now you're forced to manually load all the symbols and check whether they exist to figure out which version you're on. There's versions that don't differ in exposed symbols though, so you're actually supposed to query the system package database (?) to deal with breaking changes. Or just assume you don't have access to functionality newer than 1.7.0.
In my case (Rust bindings) I want to bind xkb_keymap_new_from_names2, but return a VersionNotSupported error if the specified format is too new and fall back on xkb_keymap_new_from_names.
Solution
Provide a global xkb_get_version function that returns a pointer to a static version triplet (e.g. [uint8; 3]) which would allow the libraries to query the installed version of the library on the system and change some logic based on that.