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

Instantiate an inline function.

Define the necessary symbols for a simple enumeration type.

Functions that are declared inline in C99 don't generate an external symbol unless the compiler is told so explicitly. 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.

Use this with P99_DECLARE_ENUM(), which see.

Remarks:
argument 0 of P99_DEFINE_ENUM should correspond to a type that is not a VLA.
Examples:
test-p99-pow.c.

Definition at line 164 of file p99_enum.h.

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Defines