Skip to content

Commit

Permalink
Merge pull request #1288 from 0-wiz-0/master
Browse files Browse the repository at this point in the history
Portability fixes
  • Loading branch information
bynect authored Feb 29, 2024
2 parents ab38321 + 8baccb8 commit b6a8a19
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ SYSCONF_FORCE_NEW ?= $(shell [ -f ${DESTDIR}${SYSCONFFILE} ] || echo 1)
CFLAGS := ${DEFAULT_CPPFLAGS} ${CPPFLAGS} ${DEFAULT_CFLAGS} ${CFLAGS} ${INCS} -MMD -MP
LDFLAGS := ${DEFAULT_LDFLAGS} ${LDFLAGS} ${LIBS}

SRC := $(sort $(shell ${FIND} src/ -not \( -path src/wayland -prune -o -path src/x11 -prune \) -name '*.c'))
SRC := $(sort $(shell ${FIND} src/ ! \( -path src/wayland -prune -o -path src/x11 -prune \) -name '*.c'))

ifneq (0,${WAYLAND})
# with Wayland support
Expand Down
7 changes: 7 additions & 0 deletions src/input.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,14 @@
#include "settings.h"
#include "queues.h"
#include <stddef.h>
#if defined(__linux__) || defined(__FreeBSD__)
#include <linux/input-event-codes.h>
#else
#define BTN_LEFT (0x110)
#define BTN_RIGHT (0x111)
#define BTN_MIDDLE (0x112)
#define BTN_TOUCH (0x14a)
#endif

int get_notification_clickable_height(struct notification *n, bool first, bool last)
{
Expand Down
7 changes: 7 additions & 0 deletions src/x11/x.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,14 @@
#include <X11/Xlib.h>
#include <X11/Xresource.h>
#include <X11/Xutil.h>
#if defined(__linux__) || defined(__FreeBSD__)
#include <linux/input-event-codes.h>
#else
#define BTN_LEFT (0x110)
#define BTN_RIGHT (0x111)
#define BTN_MIDDLE (0x112)
#define BTN_TOUCH (0x14a)
#endif

#include "../dbus.h"
#include "../draw.h"
Expand Down
2 changes: 2 additions & 0 deletions test/utils.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#if defined(__linux__)
#include <features.h>
#endif

#include "../src/utils.c"
#include "greatest.h"
Expand Down

0 comments on commit b6a8a19

Please sign in to comment.