Loading...
Searching...
No Matches
Utils

Misc utils. More...

## Macros

#define | EC_CAST(x, old_type, new_type)
| Cast a variable into a type, ensuring its initial type first.
#define | EC_VA_END ((void *)1)
| Mark the end of the arguments list in some functions.
#define | EC_COUNT_OF(x)
| Count number of elements in an array.
#define | EC_DEPRECATED(msg)
| Mark a function or type as deprecated.
#define | EC_DEPRECATED_MACRO_(x)
| Emit a deprecation warning when a macro is expanded.
#define | EC_DEPRECATED_MACRO(msg)

## Detailed Description

Misc utils.

## Macro Definition Documentation

## EC_CAST

#define EC_CAST | ( |  | x,
|  |  | old_type,
|  |  | new_type )

Value:
({ \
__typeof__(old_type) __x = (x); \
(__typeof__(new_type))__x; \
})

Cast a variable into a type, ensuring its initial type first.

Definition at line 17 of file utils.h.

## EC_VA_END

#define EC_VA_END ((void *)1)

Mark the end of the arguments list in some functions.

Definition at line 26 of file utils.h.

## EC_COUNT_OF

#define EC_COUNT_OF | ( |  | x | ) |

Value:
((sizeof(x) / sizeof(0 [x])) / ((size_t)(!(sizeof(x) % sizeof(0 [x])))))

Count number of elements in an array.

Definition at line 31 of file utils.h.

## EC_DEPRECATED

#define EC_DEPRECATED | ( |  | msg | ) |

Value:
__attribute__((deprecated(msg)))

Mark a function or type as deprecated.

Definition at line 36 of file utils.h.

## EC_DEPRECATED_MACRO_

#define EC_DEPRECATED_MACRO_ | ( |  | x | ) |

Value:
_Pragma(#x)

Emit a deprecation warning when a macro is expanded.

Definition at line 41 of file utils.h.

## EC_DEPRECATED_MACRO

#define EC_DEPRECATED_MACRO | ( |  | msg | ) |

Value:
EC_DEPRECATED_MACRO_(GCC warning msg)
EC_DEPRECATED_MACRO_
#define EC_DEPRECATED_MACRO_(x)
Emit a deprecation warning when a macro is expanded.
Definition utils.h:41

Definition at line 42 of file utils.h.