i have ended putting many little small inline function in a header file which i include in many compilation units, the code is correctly inlined by the compiler and the program works like a charm.
but now the header file is something very unusual (for being a header file), to make it more readable i thought to do something like this:
#ifndef MY_HEADER_H
#define MU_HEADER_H
static inline
void my_fnct (my_param a);
#include "my_header.inline.c"
#endif
and the file my_header.inline.c
will be like:
static inline
void my_fnct (my_param a)
{
// .. my code ..
}
then, when i want these functions i just include the header file.
my question is: there is a better way to accomplish this without filling a header file with too much code? or i can do this and expect other developers to understand this code without problems?