I've been working on IPC and got stuck with a compiler error...
I'm trying to be able to use the ipc_response type in both kernel/ipc.h and kernel/task.h (as well as any files that include these headers).
It is defined in kernel/ipc.h which is included by task.h, but I keep getting the following error:
Code: Select all
include/kernel/task.h:21:1: error: unknown type name 'ipc_response'
ipc_response *get_ipc_responses(uint32_t pid);
^~~~~~~~~~~~
I've also tried moving the type definition to task.h, but it just shows a similar error for ipc.h instead.
I realize the headers are circularly dependent (ipc.h relies on a few functions from task.h, and vice versa), but since there's header guards it shouldn't matter.
I've also tried adding the definition to BOTH headers, but it says
Code: Select all
tritium-os/sysroot/usr/include/kernel/task.h:15:27: error: conflicting types for 'ipc_response'
} __attribute__((packed)) ipc_response;
^~~~~~~~~~~~
Code in following post.