From 5f861f0f0b81f77bd6ebf3d7e666af2fa0fca2b1 Mon Sep 17 00:00:00 2001 From: Fabrice Date: Tue, 10 Feb 2026 08:24:06 +0100 Subject: wl state --- src/utils.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/utils.h') diff --git a/src/utils.h b/src/utils.h index a89f498..5f9d1cb 100644 --- a/src/utils.h +++ b/src/utils.h @@ -4,10 +4,8 @@ #include #include -extern "C" { #include "xdg-shell.h" #include -} typedef uint8_t u8; typedef uint16_t u16; @@ -28,6 +26,8 @@ typedef struct xdg_wm_base *xdg_wm_base_t; typedef struct xdg_surface *xdg_surface_t; typedef struct xdg_toplevel *xdg_toplevel_t; +static inline u32 wayc_min(u32 a, u32 b) { return a > b ? a : b; } + [[noreturn]] static inline void wayc_panic_impl(const char *file, int line, const char *func, const char *fmt, ...) { @@ -40,7 +40,7 @@ typedef struct xdg_toplevel *xdg_toplevel_t; exit(EXIT_FAILURE); } -#define wayc_panic(...) \ +#define wayc_panic(...) \ wayc_panic_impl(__FILE__, __LINE__, __func__, __VA_ARGS__) #define wayc_assert(expr) \ @@ -48,3 +48,5 @@ typedef struct xdg_toplevel *xdg_toplevel_t; if (!(expr)) \ wayc_panic("Assertion failed: %s", #expr); \ } while (0) + +#define wayc_notnull(expr) wayc_assert(expr != NULL) -- cgit v1.2.3