diff options
Diffstat (limited to 'src/x11_window.c')
-rw-r--r-- | src/x11_window.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/x11_window.c b/src/x11_window.c index 7bf7d2b..1b7f724 100644 --- a/src/x11_window.c +++ b/src/x11_window.c @@ -2,6 +2,7 @@ #include <assert.h> #include <fcntl.h> +#include <limits.h> #include <poll.h> #include <stdlib.h> #include <string.h> @@ -44,6 +45,9 @@ static void set_nonblocking(int fd) struct imv_window *imv_window_create(int w, int h, const char *title) { + /* Ensure event writes will always be atomic */ + assert(sizeof(struct imv_event) <= PIPE_BUF); + struct imv_window *window = calloc(1, sizeof *window); window->pointer.last.x = -1; window->pointer.last.y = -1; |