P99

◆ P99_INSTANTIATE

#define P99_INSTANTIATE (   RT,
  NAME,
  ... 
)    RT NAME(__VA_ARGS__)

Instantiate an inline function.

For functions that are declared inline in C99, the compiler doesn't generate an external symbol unless explicitly told to. But often you will need such an external symbol, e.g if you switch on debugging or if you pass a function pointer as a callback to another function.

The syntax for this feature is a bit crude and not all compilers agree upon the interpretation. Therefore we provide a wrapper that does just this. Put such a call to P99_INSTANTIATE in exactly one .c file (compilation unit) of you liking. The external symbol will then be generated there.

See also
P99_PROTOTYPE for the syntax of this macro.
Remarks
This should be "macro-safe" that is if NAME is overloaded with a macro, P99_INSTANTIATE should still be able to instantiate the corresponding function.
Examples
test-p99-pow.c.

Definition at line 241 of file p99_defarg.h.