#confused about : expected type '*main.GUID', found '*const main.GUID'
1 messages · Page 1 of 1 (latest)
the const is applying to the pointer, a const pointer cant coerce to a mutable pointer so you have to change a const to var somewhere.
only because taking the address of a const gives you a *const T, while the address of a var gives *T
is it too much code to post? you can use something like zigbin.io
in this situation i would change compareGUIDs's signature to fn compareGUIDs(right: GUID, left: GUID) bool, since you don't have to mutate them to compare them (you'd also need to change it so you dont pass by address on line 33)
taking by const is always preferrable since mutable things can coerce to immutable things, but not the other way around
if you did need to mutate them, changing const first and const second to var first and var second would fix it
np 
hmm now i get this main.zig:73:24: error: parameter of type 'main.GUID' not allowed in function with calling convention 'C'
yea, do you need to have compareGUIDs as export? like are you exposing it to a static/dynamic library? if you do you have to make GUID an extern struct