godbus / dbus

Native Go bindings for D-Bus
BSD 2-Clause "Simplified" License
959 stars 222 forks source link

Fix compilation on FreeBSD #359

Closed Jacalz closed 1 year ago

Jacalz commented 1 year ago

This code was copied from the syscall package in Go but it does not seem to be working as salign is of type _Ctype_int and salen is an int (strange). This fixes the compile error of mismatched types by converting to int.

Jacalz commented 1 year ago

Sorry to ask @guelfey but is there any chance to get this reviewed? One of my PRs downstream in Fyne is blocked because of this. Thanks :)

guelfey commented 1 year ago

Sorry for the delay @Jacalz. I don't quite understand why this is necessary - unix.SizeofPtr is an untyped integer constant from autogenerated files from golang.org/x/sys/unix. So by default any expression using it will just be an int. Can you show how/where exactly this is causing an issue upstream?

Jacalz commented 1 year ago

Hmm. You are right. Something is very strange. I was getting a compile error just like the one Andrew was mentioning in https://github.com/fyne-io/fyne/pull/2896#issuecomment-1466234559 where it was complaining that salign is of type _Ctype_int and salen is an int. However, I reran the code today after rebasing my branch on develop and after having updated my FreeBSD install and the compile error seems to be gone now. I guess it might have been a bug in the compiler or something else strange?

Either way. Sorry for the fuss. I will go ahead and close this.