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:
Siva Mahadevan 2026-02-28 18:49:59 -05:00 committed by Siva Mahadevan
parent a2d03cf618
commit 0928b2115e
5 changed files with 61 additions and 69 deletions

View file

@ -10,7 +10,7 @@ primarily in terms of functionality, and secondarily in terms of
philosophy. Like [dwm], dwl is:
- Easy to understand, hack on, and extend with patches
- One C source file (or a very small number) configurable via `config.h`
- One C source file configurable via `config.h`
- Tied to as few external dependencies as possible
## Getting Started: