≈ the.bay.news

Replace `*const anyopaque` with `anytype` when expecting function pointers

Ziggit
Replace `*const anyopaque` with `anytype` when expecting function pointers
There are situations in which function pointers have attributes, like addrspace. This is generally true on (some) microcontrollers, where the address space of a pointer is important because the instructions required to interact with them may differ (harvard architecture). The signature of @export is: @export(comptime ptr: *const anyopaque, comptime options: ExportOptions) void so I could not do this: const ptr: *const addrspace(.flash) fn() void = &myFun; @export(ptr, .{...}); This is used ...

0 comments

Sign in to join the discussion — your thebay.events account works here.

No comments yet.