-
-
Notifications
You must be signed in to change notification settings - Fork 115
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[FEATURE REQUEST] glib: Add functions to get glib version #1545
Comments
GLIB_VAR const guint glib_major_version;
GLIB_VAR const guint glib_minor_version;
GLIB_VAR const guint glib_micro_version;
GLIB_VAR const guint glib_interface_age;
GLIB_VAR const guint glib_binary_age; from |
For comparison, the bad one is GOBJECT_VAR GType *g_param_spec_types; |
The version constants are already in glib/sys/Gir.toml, but they are marked as ignored. I tried removing them from this list and regenerating the bindings, and it seems to generate fine c: // glib/sys/src/lib.rs
pub const GLIB_MAJOR_VERSION: c_int = 2;
pub const GLIB_MICRO_VERSION: c_int = 0;
pub const GLIB_MINOR_VERSION: c_int = 83; Not sure how useful these are though, since they are fixed to the version defined in Accessing the EDIT: As I thought, those variables have the same issue that we came across before, they are not exported without the
I'm not sure if there is an alternative way of accessing them like we had for Maybe the version number mismatch is something that could be added in the original |
For future reference, the issue comes from Windows not including the unprefixed version of exported variables (they do so for functions), and Rust only being able to pick up the prefixed version if the To check this, you can compile or download the glib |
Ok, so we can't provide access to these variables then because GLib is exporting them wrongly. |
I don't think it really an issue with GLib exporting them wrongly. It is more a combination of the Windows compiler deciding that variables should be explicitly imported with |
Provide equivalents of:
This could be helpful, for example, to print a debug message if glib_check_version fails.
The text was updated successfully, but these errors were encountered: