Following from this question I asked before. I want to know how could I define an inline
function in global scope.
I want to declare inline
function in test.h, define it in main.c and call it from test.c.
main.c and test.c both #include "test.h"
(for code sample please click the link above).
This is basiclly some sort of callback function that user can enable/disable. And only one file should have the function defined.
I know inline
is just a suggestion to the compiler and it doesnt make much difference on modern CPUs but this is for 8-bit microcontroller and would really need it.
EDIT:
I have a function in test.c which calls this inlined function. I just want to replace the call with the body of function defined in main.c. I hope that makes sense.