src: switch asserts to wl_abort

assert()s can be compiled away by #defining NDEBUG. Some build systems
do this. Using wl_abort gives a human readable error message and it
isn't compiled away. This commit closes issue #230.

Signed-off-by: meltq <tejasvipin76@gmail.com>
This commit is contained in:
meltq 2024-06-30 22:36:11 +05:30 committed by Tejas Vipin
parent fa1811ce3e
commit 0cecde304f
5 changed files with 36 additions and 16 deletions

View file

@ -75,7 +75,8 @@ struct wl_connection {
static inline size_t
size_pot(uint32_t size_bits)
{
assert(size_bits < 8 * sizeof(size_t));
if (!(size_bits < 8 * sizeof(size_t)))
wl_abort("Too many bits for size_t\n");
return ((size_t)1) << size_bits;
}