icc: use compound literal rather than static object to return pointer

thus make mkcmessage reentrant (and a macro, rather than a function)
This commit is contained in:
Lucas de Sena
2026-01-31 01:25:50 +00:00
parent 1212e7a78c
commit 5bbae05fec
2 changed files with 9 additions and 14 deletions

9
icc.h
View File

@@ -24,4 +24,13 @@ extern Atom wm_state, wm_change_state, wm_protocols, wm_delete, wm_take_focus, w
#define Psizeright 8
#define Psizetrans 16
#define mkcmessage(w, a, x, ...) (&(XEvent){.xclient = { \
.type = ClientMessage, \
.window = (w), \
.message_type = (a), \
.format = 32, \
.data.l = {(long)(x), CurrentTime, __VA_ARGS__}, \
}})
#endif