Closed GeopJr closed 5 months ago
What glib version changed this? I'm running on 2.78.4
here and it seems fine.
>= 2.79 https://gitlab.gnome.org/GNOME/glib/-/commit/726eca7c898ade4c69ca03220c1a2d69b1842074
gthread: introduce g_onceinit{enter,leave}_pointer
These functions can be used to initalize pointer-type variables rather than a gsize. This is required to support CHERI-enabled platforms where gsize cannot be used to store pointers. Follow-up changes will migrate the uses of g_once_init that store pointers to the new API
Helps: #2842
And my guess on location becoming pointer of pointer in gi is https://gitlab.gnome.org/GNOME/glib/-/commit/56daac02d1fff1a268c61e07562af19189b0859e
If I understood correctly these changes only matter if we desire to support these architectures, and if I use the new added functions instead the current one I'll need to do some checks to work with new and old glib.
So I think the better thing to do meanwhile is nothing π , since I believe no one is using gi-crystal on those architectures.
100% agree! But it also changed location from Pointer(Void)
to Pointer(Pointer(Void))
and the compiler complains:
Showing last frame. Use --error-trace for full trace.
There was a problem expanding macro 'inherited'
Code in src/collision/window.cr:27:3
27 | class Window < Adw::ApplicationWindow
^
Called macro defined in lib/gi-crystal/src/bindings/g_object/object.cr:63:5
63 | macro inherited
Which expanded to:
> 21 |
> 22 | def self.g_type : UInt64
> 23 | if LibGLib.g_once_init_enter(pointerof(@@_g_type)) != 0
^--------
Error: undefined method 'to_unsafe' for Pointer(UInt64)
Error: module collision: Child process exited with code 1
edit: or am I completely off mark and the problem is somewhere else?
now it needs to be fixed π.
Thanks for the quick fix :heart:
I was waiting the package land on ArchLinux and become a blocker for me too π , so I wouldn't need to compile g_lib, setup a lot of environment variables, etc...
On the latest glib, the following:
became:
g_once_init_enter
andg_once_init_leave
are used in object and enum