aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKenny Levinsen <kl@kl.wtf>2020-08-01 00:21:07 +0000
committerKenny Levinsen <kl@kl.wtf>2020-08-01 16:53:44 +0200
commitdc9c7bff71cb843c6ba7b68e977d130ae8098201 (patch)
tree815c5625eed574065f0a64d4485c9cbad3de8f47
parent956a378adb63292ce586d124c8aed959e6056a5b (diff)
devices: FreeBSD support in drm and evdev code
-rw-r--r--common/drm.c5
-rw-r--r--common/evdev.c11
2 files changed, 13 insertions, 3 deletions
diff --git a/common/drm.c b/common/drm.c
index 4b70b64..3234e81 100644
--- a/common/drm.c
+++ b/common/drm.c
@@ -1,7 +1,10 @@
#include <sys/ioctl.h>
-#include <sys/sysmacros.h>
#include <sys/types.h>
+#ifdef __linux__
+#include <sys/sysmacros.h>
+#endif
+
#include "drm.h"
// From libdrm
diff --git a/common/evdev.c b/common/evdev.c
index fe6922d..f3b39c6 100644
--- a/common/evdev.c
+++ b/common/evdev.c
@@ -1,9 +1,16 @@
-#include <linux/input.h>
#include <stdlib.h>
#include <sys/ioctl.h>
-#include <sys/sysmacros.h>
#include <sys/types.h>
+#if defined(__linux__)
+#include <linux/input.h>
+#include <sys/sysmacros.h>
+#elif defined(__FreeBSD__)
+#include <dev/evdev/input.h>
+#else
+#error Unsupported platform
+#endif
+
#include "evdev.h"
int evdev_revoke(int fd) {