Consider this example of a function declaration and definition (in the same translation unit):
inline static int foo(int x);
...
int foo(int x)
{
return
I want to provide detailed information about inline,
you can separate the declaration and definition fine, but that definition must be available in every translation unit that uses the function, i.e in your case
inline static int foo(int x);
Inline functions are included in the ISO C99 standard, but there are currently substantial differences between what GCC implements and what the ISO C99 standard requires.
To declare a function inline, use the inline keyword in its declaration, like this:
static inline int
inc (int *a)
{
return (*a)++;
}
An Inline Function is As Fast As a Macro
Note that certain usages in a function definition can make it unsuitable for inline substitution.
Note that in C, unlike C++, the inline keyword does not affect the linkage of the function.