P99

◆ P99_SIZE_INDICATOR

#define P99_SIZE_INDICATOR (   UI,
  ... 
)

Classify expression UI according to its value and return 1 if the value is in the list and 0, otherwise.

UI is evaluated only at compile time and the resulting value is cast to size_t. It must not be 0.

if (P99_SIZE_INDICATOR(sizeof(toto), 1, 2, 4, 8)) {
.. do something easy ..
} else {
.. have some fallback for weirdos ...
}
Warning
The range of allowed values for UI is platform dependent. The only known fixed guarantee is UINT16_MAX, but the result of a sizeof operator should always work.

Definition at line 856 of file p99_generic.h.

P99_SIZE_INDICATOR
#define P99_SIZE_INDICATOR(UI,...)
Classify expression UI according to its value and return 1 if the value is in the list and 0,...
Definition: p99_generic.h:856