mirror of
https://github.com/zoriya/zig-wayland.git
synced 2026-05-31 18:13:10 +00:00
common: fix build on aarch64 and others
On aarch64 for example, function alignment is 4 so we need to @alignCast() when casting ?*const anyopaque to function pointers.
This commit is contained in:
+2
-1
@@ -100,7 +100,8 @@ pub fn Dispatcher(comptime Obj: type, comptime Data: type) type {
|
||||
}
|
||||
}
|
||||
|
||||
@ptrCast(*const fn (*Obj, Payload, Data) void, implementation)(
|
||||
const HandlerFn = fn (*Obj, Payload, Data) void;
|
||||
@ptrCast(*const HandlerFn, @alignCast(@alignOf(HandlerFn), implementation))(
|
||||
@ptrCast(*Obj, object),
|
||||
@unionInit(Payload, payload_field.name, payload_data),
|
||||
@intToPtr(Data, @ptrToInt(object.getUserData())),
|
||||
|
||||
Reference in New Issue
Block a user