Open v1993 opened 1 year ago
I'm not quite sure if it's the cause of this issue, but it's worth noting that corresponding quark
functions are appropriated by similarly named classes, e.g. Device.error_quark
.
Is it because the GUsbDevice error uses G_DEFINE_QUARK
? the g_usb_source_error_quark() seems to be written out manually.
That's plausible but would be pretty odd; G_DEFINE_QUARK
is what official GLib docs recommend. It might have to do with header layout, although I'm not sure.
As an aside, I'm currently using a manually modified VAPI file on my end to work around this issue.
As an aside, I'm currently using a manually modified VAPI file
Can you share what you're adding? I see
[CCode (cheader_filename = "gusb.h", cprefix = "G_USB_DEVICE_ERROR_", has_type_id = false)]
public enum DeviceError {
INTERNAL,
IO,
TIMED_OUT,
NOT_SUPPORTED,
NO_DEVICE,
NOT_OPEN,
ALREADY_OPEN,
CANCELLED,
FAILED,
PERMISSION_DENIED,
BUSY,
LAST
}
All I do is replace enum
with errordomain
for affected domains. This is enough to get things working, although static quark()
methods also, ideally, should be relocated there from classes they got stuck to.
@v1993 If you can work out the fix I'm happy to review and then tag a new release.
I'm currently bundling a modified vapi file with my application, which is good enough to get it working; hopefully will look into a proper fix later.
As of right now, only
SourceError
is properly declared as an error in generated files (see e.g. valadoc). This is a big issue for language bindings, since it removes the ability to (nicely) selectively catch exceptions from GUsb.