P99

◆ P99_DECLARE_INLINE_EXPRESSION

#define P99_DECLARE_INLINE_EXPRESSION (   EXT,
  BASE,
  EXP,
  ... 
)

Declare an inline function of basename BASE for expression EXP, applied to the builtin type EXT.

The motivation for declaring such functions is for expressions that evaluate their arguments multiple times.

The argument list contains the names of the function parameters as they should appear inside EXP. The name of the declared function has EXT appended to BASE. E.g for a function operating on two unsigned values:

P99_DECLARE_INLINE_EXPRESSION(u, my_max, ((a >= b) ? a : b), a, b);

This declares an inline function with the following prototype:

unsigned p00_gen_my_maxu(unsigned, unsigned);
Remarks
For the moment, the number of arguments that can appear in the expression is limited to 6, but this could be augmented easily if there is need for it.
See also
P99_BUILTIN_TYPE for the shorthands that can be used for the Type facilities
P99_DECLARE_INLINE_EXPRESSIONS to create this type of functions for a whole list of types

Definition at line 890 of file p99_generic.h.

P99_DECLARE_INLINE_EXPRESSION
#define P99_DECLARE_INLINE_EXPRESSION(EXT, BASE, EXP,...)
Declare an inline function of basename BASE for expression EXP, applied to the builtin type EXT.
Definition: p99_generic.h:890