1
0
Fork 0
mirror of https://github.com/yshui/picom.git synced 2024-11-25 14:06:08 -05:00

compiler: abort in debug build if unreachable() is reached

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
This commit is contained in:
Yuxuan Shui 2024-02-13 23:52:12 +00:00
parent 9b6b6855d7
commit 8d0284da1b
No known key found for this signature in database
GPG key ID: D3A4405BE6CC17F4

View file

@ -105,9 +105,9 @@
#ifndef unreachable #ifndef unreachable
# if defined(__GNUC__) || defined(__clang__) # if defined(__GNUC__) || defined(__clang__)
# define unreachable() __builtin_unreachable() # define unreachable() assert(false); __builtin_unreachable()
# else # else
# define unreachable() do {} while(0) # define unreachable() assert(false); do {} while(0)
# endif # endif
#endif #endif