From a5ba1534b30dd6f38784c8538f2dbd4d0684b4f6 Mon Sep 17 00:00:00 2001 From: tamasmeszaros Date: Mon, 26 Oct 2020 14:23:44 +0100 Subject: [PATCH] Remove dependency on libudev.h libudev is linked explicitly and only a few structures need to be declared which are passed as pointers to the dynamically loaded functions. No need to require libudev-dev on the build machines. --- src/hidapi/linux/hid.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/hidapi/linux/hid.c b/src/hidapi/linux/hid.c index d68354fe1..5f486c0a9 100644 --- a/src/hidapi/linux/hid.c +++ b/src/hidapi/linux/hid.c @@ -42,10 +42,16 @@ #include #include #include -#include #include "hidapi.h" +// Declare udev structures needed in this module. They are passed by pointers +// to udev functions and not used directly. +struct udev_device; +struct udev_list_entry; +struct udev_enumerate; +struct udev; + typedef const char* (*hid_wrapper_udev_device_get_devnode_type)(struct udev_device *udev_device); typedef struct udev_device* (*hid_wrapper_udev_device_get_parent_with_subsystem_devtype_type)(struct udev_device *udev_device, const char *subsystem, const char *devtype); typedef const char* (*hid_wrapper_udev_device_get_sysattr_value_type)(struct udev_device *udev_device, const char *sysattr);