File: 0011-build-lirc.h-Configure-includes-in-lirc.h-234.patch

package info (click to toggle)
lirc 0.9.4c-9
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 8,264 kB
  • ctags: 5,536
  • sloc: ansic: 26,459; cpp: 9,138; sh: 5,492; python: 2,996; makefile: 873; xml: 63
file content (55 lines) | stat: -rw-r--r-- 1,535 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
From f86da92490ff32465a1aba8754c0c856191e6907 Mon Sep 17 00:00:00 2001
From: Alec Leamas <leamas.alec@gmail.com>
Date: Sun, 23 Oct 2016 15:45:52 +0200
Subject: [PATCH] build: lirc.h: Configure includes in lirc.h (#234).

Fall back to sys/ioctl.h instead of linux/ioctl.h etc. on
non-linux platform i. e., MacOS.
---
 configure.ac         |  5 +++--
 include/media/lirc.h | 11 +++++++++++
 2 files changed, 14 insertions(+), 2 deletions(-)

diff --git a/configure.ac b/configure.ac
index 20933a8..cde9813 100644
--- a/configure.ac
+++ b/configure.ac
@@ -48,8 +48,9 @@ LIBUSB_CONFIG="pkg-config libusb"
 dnl Checks for header files.
 AC_HEADER_STDC
 AC_HEADER_TIME
-AC_CHECK_HEADERS([fcntl.h limits.h poll.h sys/ioctl.h sys/poll.h sys/time.h ])
-AC_CHECK_HEADERS([syslog.h unistd.h util.h libutil.h pty.h])
+AC_CHECK_HEADERS([fcntl.h limits.h linux/ioctl.h poll.h sys/ioctl.h \
+		  sys/poll.h sys/time.h syslog.h unistd.h util.h \
+		  libutil.h pty.h])
 
 dnl Checks for typedefs, structures, and compiler characteristics.
 AC_C_CONST
diff --git a/include/media/lirc.h b/include/media/lirc.h
index 991ab45..84af7ed 100644
--- a/include/media/lirc.h
+++ b/include/media/lirc.h
@@ -6,8 +6,19 @@
 #ifndef _LINUX_LIRC_H
 #define _LINUX_LIRC_H
 
+#include <config.h>
+
+#ifdef HAVE_LINUX_TYPES_H
 #include <linux/types.h>
+#else
+#include <sys/types.h>
+#endif
+
+#ifdef HAVE_LINUX_IOCTL_H
 #include <linux/ioctl.h>
+#else
+#include <sys/ioctl.h>
+#endif
 
 #define PULSE_BIT       0x01000000
 #define PULSE_MASK      0x00FFFFFF
-- 
2.5.5