feature: add DRANG_BIT_CAST macro for type-safe bit casting
This commit is contained in:
parent
b8e697cfd0
commit
4f3ae943db
1 changed files with 4 additions and 6 deletions
|
|
@ -36,11 +36,9 @@
|
|||
# define DRANG_ALLOC_ALIGN_ATTR(idx) __attribute__((alloc_align(idx)))
|
||||
# define DRANG_MALLOC_ATTR __attribute__((malloc))
|
||||
|
||||
|
||||
#define DRANG_BIT_CAST(_Expr_, _From_, _To_) __builtin_bit_cast(_To_, _Expr_)
|
||||
|
||||
#else
|
||||
# define DRANG_PRINTF_ATTR(fmt_idx, arg_idx)
|
||||
# define DRANG_VPRINTF_ATTR(fmt_idx)
|
||||
# define DRANG_ALLOC_SIZE_COUNT_ATTR(idx, count)
|
||||
# define DRANG_ALLOC_SIZE_ATTR(idx)
|
||||
# define DRANG_ALLOC_ALIGN_ATTR(idx)
|
||||
# define DRANG_MALLOC_ATTR
|
||||
#error "Unsupported compiler, please implement attribute macros"
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue