summaryrefslogtreecommitdiffstats
path: root/main/v4l-utils/fix-compliance.patch
blob: 4ce0cd75366ab2b30ded1ef7e4dfd0ad349c69d7 (plain)
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
--- v4l-utils-1.0.0.orig/lib/libv4l1/v4l1compat.c
+++ v4l-utils-1.0.0/lib/libv4l1/v4l1compat.c
@@ -62,7 +62,7 @@
 	return fd;
 }
 
-#ifdef linux
+#ifdef __GLIBC__
 LIBV4L_PUBLIC int open64(const char *file, int oflag, ...)
 {
 	int fd;
@@ -94,7 +94,11 @@
 	return v4l1_dup(fd);
 }
 
+#ifdef __GLIBC__
 LIBV4L_PUBLIC int ioctl(int fd, unsigned long int request, ...)
+#else
+LIBV4L_PUBLIC int ioctl(int fd, int request, ...)
+#endif
 {
 	void *arg;
 	va_list ap;
@@ -117,7 +121,7 @@
 	return v4l1_mmap(start, length, prot, flags, fd, offset);
 }
 
-#ifdef linux
+#ifdef __GLIBC__
 LIBV4L_PUBLIC void *mmap64(void *start, size_t length, int prot, int flags, int fd,
 		__off64_t offset)
 {
--- v4l-utils-1.0.0.orig/lib/libv4l2/v4l2convert.c
+++ v4l-utils-1.0.0/lib/libv4l2/v4l2convert.c
@@ -86,7 +86,7 @@
 	return fd;
 }
 
-#ifdef linux
+#ifdef __GLIBC__
 LIBV4L_PUBLIC int open64(const char *file, int oflag, ...)
 {
 	int fd;
@@ -121,7 +121,11 @@
 	return v4l2_dup(fd);
 }
 
+#ifdef __GLIBC__
 LIBV4L_PUBLIC int ioctl(int fd, unsigned long int request, ...)
+#else
+LIBV4L_PUBLIC int ioctl(int fd, int request, ...)
+#endif
 {
 	void *arg;
 	va_list ap;
@@ -144,7 +148,7 @@
 	return v4l2_mmap(start, length, prot, flags, fd, offset);
 }
 
-#ifdef linux
+#ifdef __GLIBC__
 LIBV4L_PUBLIC void *mmap64(void *start, size_t length, int prot, int flags, int fd,
 		__off64_t offset)
 {
--- v4l-utils-1.0.0.orig/lib/libv4lconvert/libv4lsyscall-priv.h
+++ v4l-utils-1.0.0/lib/libv4lconvert/libv4lsyscall-priv.h
@@ -41,7 +41,9 @@
 #include <linux/ioctl.h>
 /* On 32 bits archs we always use mmap2, on 64 bits archs there is no mmap2 */
 #ifdef __NR_mmap2
+#ifndef SYS_mmap2
 #define	SYS_mmap2 __NR_mmap2
+#endif
 #define	MMAP2_PAGE_SHIFT 12
 #else
 #define	SYS_mmap2 SYS_mmap
--- v4l-utils-1.0.0.orig/utils/qv4l2/v4l2-api.h
+++ v4l-utils-1.0.0/utils/qv4l2/v4l2-api.h
@@ -21,6 +21,7 @@
 #define V4L2_API_H
 
 #include <QString>
+#include <stdint.h>
 #include <linux/videodev2.h>
 #include <libv4lconvert.h>