mirror of
https://codeberg.org/dwl/dwl.git
synced 2026-03-27 07:58:11 -04:00
move util.c to util.h
This allows single-source compilation and whole-program optimization using something like: make CFLAGS='-flto -ffunction-sections -fdata-sections -Wl,--gc-sections' Furthermore, move more compositor-agnostic utility functions/macros to util.h, similar to the original dwm sources.
This commit is contained in:
parent
a2d03cf618
commit
0928b2115e
5 changed files with 61 additions and 69 deletions
4
dwl.c
4
dwl.c
|
|
@ -72,12 +72,8 @@
|
|||
#include "util.h"
|
||||
|
||||
/* macros */
|
||||
#define MAX(A, B) ((A) > (B) ? (A) : (B))
|
||||
#define MIN(A, B) ((A) < (B) ? (A) : (B))
|
||||
#define CLEANMASK(mask) (mask & ~WLR_MODIFIER_CAPS)
|
||||
#define VISIBLEON(C, M) ((M) && (C)->mon == (M) && ((C)->tags & (M)->tagset[(M)->seltags]))
|
||||
#define LENGTH(X) (sizeof X / sizeof X[0])
|
||||
#define END(A) ((A) + LENGTH(A))
|
||||
#define TAGMASK ((1u << TAGCOUNT) - 1)
|
||||
#define LISTEN(E, L, H) wl_signal_add((E), ((L)->notify = (H), (L)))
|
||||
#define LISTEN_STATIC(E, H) do { struct wl_listener *_l = ecalloc(1, sizeof(*_l)); _l->notify = (H); wl_signal_add((E), _l); } while (0)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue