P99

◆ P99_CONSTANT

#define P99_CONSTANT (   T,
  NAME,
  INIT 
)    register T const NAME = INIT

define a compile time constant NAME of type T with value INIT

INIT can be omitted, resulting in a zero initialized constant.

Remarks
if T is one of the special values int or signed, enumeration constants are defined.

Use this as in the following:

P99_CONSTANT(struct tutu, tutu0);
inline
struct tutu * tutu_init(struct tutu* x) {
if (x) *x = tutu0;
return x;
}

Here tutu0 is defined a the zero initialized value of type struct tutu.

Remarks
This is thought to use the proposed extension of register variables in file scope but we are not yet there.
argument 1 must be an identifier

Definition at line 258 of file p99_enum.h.

P99_CONSTANT
#define P99_CONSTANT(T, NAME, INIT)
define a compile time constant NAME of type T with value INIT
Definition: p99_enum.h:258