diff options
| author | meltq <tejasvipin76@gmail.com> | 2024-06-30 22:36:11 +0530 |
|---|---|---|
| committer | Tejas Vipin <tejasvipin76@gmail.com> | 2024-07-11 17:44:04 +0000 |
| commit | 0cecde304f4f78b439d2edaaab6d9b543b30a5c0 (patch) | |
| tree | 6619eae3a6e4106550b90995fa45d23b3fba3b15 /src/connection.c | |
| parent | tests: add enum bitfield test (diff) | |
| download | wayland-0cecde304f4f78b439d2edaaab6d9b543b30a5c0.tar wayland-0cecde304f4f78b439d2edaaab6d9b543b30a5c0.tar.gz wayland-0cecde304f4f78b439d2edaaab6d9b543b30a5c0.tar.bz2 wayland-0cecde304f4f78b439d2edaaab6d9b543b30a5c0.tar.lz wayland-0cecde304f4f78b439d2edaaab6d9b543b30a5c0.tar.xz wayland-0cecde304f4f78b439d2edaaab6d9b543b30a5c0.tar.zst wayland-0cecde304f4f78b439d2edaaab6d9b543b30a5c0.zip | |
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>
Diffstat (limited to 'src/connection.c')
| -rw-r--r-- | src/connection.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/connection.c b/src/connection.c index 8870fd2..fb6a4be 100644 --- a/src/connection.c +++ b/src/connection.c @@ -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; } |
