Minimum value functions utility header.
More...
Go to the source code of this file.
|
| #define | MINOF2(a, b) |
| |
| #define | MINOF3(a, b, c) |
| |
| #define | MINOF4(a, b, c, d) |
| |
| #define | DISPATCH_MINOF(_1, _2, _3, _4, NAME, ...) |
| |
| #define | MINOF(...) |
| |
Minimum value functions utility header.
Typesafe, supporting ints and floats. Generic MINOF interface for 2, 3, or 4 arguments. Integer promotions also cover int8_t, uint8_t, int16_t, uint16_t
- Author
- Irving Wang (irvin.nosp@m.gw@p.nosp@m.urdue.nosp@m..edu)
◆ DISPATCH_MINOF
| #define DISPATCH_MINOF |
( |
| _1, |
|
|
| _2, |
|
|
| _3, |
|
|
| _4, |
|
|
| NAME, |
|
|
| ... ) |
◆ MINOF
Value:DISPATCH_MINOF(__VA_ARGS__, MINOF4, MINOF3, MINOF2)(__VA_ARGS__)
◆ MINOF2
Value: _Generic((a) + (b), \
signed int: min2_signed, \
unsigned int: min2_unsigned, \
float: min2_float \
)(a, b)
◆ MINOF3
| #define MINOF3 |
( |
| a, |
|
|
| b, |
|
|
| c ) |
◆ MINOF4
| #define MINOF4 |
( |
| a, |
|
|
| b, |
|
|
| c, |
|
|
| d ) |
Value:MINOF2(MINOF2(a, b), MINOF2(c, d))