feature: add DRANG_BIT_CAST macro for type-safe bit casting

This commit is contained in:
MechSlayer 2025-09-06 01:25:14 +02:00
parent b8e697cfd0
commit 4f3ae943db

View file

@ -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