Commit de7032816bd71d0edda30a78721e79b5b6af735c added the use of BUS_BLUETOOTH which on GNU/Linux comes from linux/input.h. Also check for dev/evdev/input.h to support other platforms such as FreeBSD.
Signed-off-by: Gerald Pfeifer gerald@pfeifer.com --- configure | 1 + configure.ac | 1 + dlls/winebus.sys/bus_udev.c | 4 ++++ include/config.h.in | 3 +++ 4 files changed, 9 insertions(+)
diff --git a/configure b/configure index d1edbdc684a..93bf6571d56 100755 --- a/configure +++ b/configure @@ -7475,6 +7475,7 @@ for ac_header in \ arpa/nameser.h \ asm/types.h \ asm/user.h \ + dev/evdev/input.h \ dirent.h \ elf.h \ float.h \ diff --git a/configure.ac b/configure.ac index da6ecf5a7a8..b281bb274b2 100644 --- a/configure.ac +++ b/configure.ac @@ -445,6 +445,7 @@ AC_CHECK_HEADERS(\ arpa/nameser.h \ asm/types.h \ asm/user.h \ + dev/evdev/input.h \ dirent.h \ elf.h \ float.h \ diff --git a/dlls/winebus.sys/bus_udev.c b/dlls/winebus.sys/bus_udev.c index b857ba25df8..10b4b4eadd6 100644 --- a/dlls/winebus.sys/bus_udev.c +++ b/dlls/winebus.sys/bus_udev.c @@ -59,6 +59,10 @@ # endif #endif
+#ifdef HAVE_DEV_EVDEV_INPUT_H +#include <dev/evdev/input.h> +#endif + #include <pthread.h>
#include "ntstatus.h" diff --git a/include/config.h.in b/include/config.h.in index f899dc27459..9bbf400e550 100644 --- a/include/config.h.in +++ b/include/config.h.in @@ -49,6 +49,9 @@ /* Define to 1 if you have the <cups/ppd.h> header file. */ #undef HAVE_CUPS_PPD_H
+/* Define to 1 if you have the <dev/evdev/input.h> header file. */ +#undef HAVE_DEV_EVDEV_INPUT_H + /* Define to 1 if you have the <dirent.h> header file. */ #undef HAVE_DIRENT_H
On 10/17/21 11:10 PM, Gerald Pfeifer wrote:
Commit de7032816bd71d0edda30a78721e79b5b6af735c added the use of BUS_BLUETOOTH which on GNU/Linux comes from linux/input.h. Also check for dev/evdev/input.h to support other platforms such as FreeBSD.
Signed-off-by: Gerald Pfeifer gerald@pfeifer.com
Thanks, I was wondering whether we should define this constant instead, or use HAS_PROPER_INPUT_HEADER to guard it too. Then I believe I found some references in some FreeBSD port files, but I probably missed that it needed a specific include.
Is this header file also providing other defines like SYN_DROPPED, EVIOCGBIT, EV_ABS or BTN_PINKIE? Would it be better if we do as with SYN_DROPPED and define it if it's not?
On Mon, 18 Oct 2021, Rémi Bernon wrote:
Thanks, I was wondering whether we should define this constant instead, or use HAS_PROPER_INPUT_HEADER to guard it too. Then I believe I found some references in some FreeBSD port files, but I probably missed that it needed a specific include.
Yes, includes can be ... painful ... at times. :-) (Ask me. :-) )
Is this header file also providing other defines like SYN_DROPPED, EVIOCGBIT, EV_ABS or BTN_PINKIE? Would it be better if we do as with SYN_DROPPED and define it if it's not?
I'll have to defer to the pros on the latter question.
Regarding the other #defines, it seems that header covers them as well (except for EVIOCGBIT which is in yet another one):
% egrep -r 'SYN_DROPPED|EVIOCGBIT|EV_ABS|BTN_PINKIE' /usr/include/ /usr/include/dev/evdev/input.h:#define EVIOCGBIT(ev,len) _IOC(IOC_OUT, EVDEV_IOC_MAGIC, 0x20 + (ev), len) /* get event bits */ /usr/include/dev/evdev/input-event-codes.h:#define EV_ABS 0x03 /usr/include/dev/evdev/input-event-codes.h:#define SYN_DROPPED 3 /usr/include/dev/evdev/input-event-codes.h:#define BTN_PINKIE 0x125
(I've not been using FreeBSD on the desktop or Wine on FreeBSD for a while, but happy to test build a patch or two or giving a try at answering questions.)
Gerald
On 10/18/21 3:04 PM, Gerald Pfeifer wrote:
On Mon, 18 Oct 2021, Rémi Bernon wrote:
Thanks, I was wondering whether we should define this constant instead, or use HAS_PROPER_INPUT_HEADER to guard it too. Then I believe I found some references in some FreeBSD port files, but I probably missed that it needed a specific include.
Yes, includes can be ... painful ... at times. :-) (Ask me. :-) )
Is this header file also providing other defines like SYN_DROPPED, EVIOCGBIT, EV_ABS or BTN_PINKIE? Would it be better if we do as with SYN_DROPPED and define it if it's not?
I'll have to defer to the pros on the latter question.
Regarding the other #defines, it seems that header covers them as well (except for EVIOCGBIT which is in yet another one):
% egrep -r 'SYN_DROPPED|EVIOCGBIT|EV_ABS|BTN_PINKIE' /usr/include/ /usr/include/dev/evdev/input.h:#define EVIOCGBIT(ev,len) _IOC(IOC_OUT, EVDEV_IOC_MAGIC, 0x20 + (ev), len) /* get event bits */ /usr/include/dev/evdev/input-event-codes.h:#define EV_ABS 0x03 /usr/include/dev/evdev/input-event-codes.h:#define SYN_DROPPED 3 /usr/include/dev/evdev/input-event-codes.h:#define BTN_PINKIE 0x125
(I've not been using FreeBSD on the desktop or Wine on FreeBSD for a while, but happy to test build a patch or two or giving a try at answering questions.)
Gerald
I would be happy if we could remove the HAS_PROPER_INPUT_HEADER ifdefs, but then I'm also not completely sure if that was meant for some other platform than FreeBSD, which would have a partial linux/input.h header.
Anyone knows anything about it?
On 10/18/21 3:52 PM, Rémi Bernon wrote:
On 10/18/21 3:04 PM, Gerald Pfeifer wrote:
On Mon, 18 Oct 2021, Rémi Bernon wrote:
Thanks, I was wondering whether we should define this constant instead, or use HAS_PROPER_INPUT_HEADER to guard it too. Then I believe I found some references in some FreeBSD port files, but I probably missed that it needed a specific include.
Yes, includes can be ... painful ... at times. :-) (Ask me. :-) )
Is this header file also providing other defines like SYN_DROPPED, EVIOCGBIT, EV_ABS or BTN_PINKIE? Would it be better if we do as with SYN_DROPPED and define it if it's not?
I'll have to defer to the pros on the latter question.
Regarding the other #defines, it seems that header covers them as well (except for EVIOCGBIT which is in yet another one):
% egrep -r 'SYN_DROPPED|EVIOCGBIT|EV_ABS|BTN_PINKIE' /usr/include/ /usr/include/dev/evdev/input.h:#define EVIOCGBIT(ev,len) _IOC(IOC_OUT, EVDEV_IOC_MAGIC, 0x20 + (ev), len) /* get event bits */ /usr/include/dev/evdev/input-event-codes.h:#define EV_ABS 0x03 /usr/include/dev/evdev/input-event-codes.h:#define SYN_DROPPED 3 /usr/include/dev/evdev/input-event-codes.h:#define BTN_PINKIE 0x125
(I've not been using FreeBSD on the desktop or Wine on FreeBSD for a while, but happy to test build a patch or two or giving a try at answering questions.)
Gerald
I would be happy if we could remove the HAS_PROPER_INPUT_HEADER ifdefs, but then I'm also not completely sure if that was meant for some other platform than FreeBSD, which would have a partial linux/input.h header.
Anyone knows anything about it?
I sent a different patch to define BUS_BLUETOOTH if it's not, as we're using it for the hidraw backend too, even if linux/input.h is not detected.
I'm still interested if the evdev code can be made more portable, although I don't know FreeBSD at all and I've got no idea if it would work there.