v4l2: Fix type compatibility issue with glibc 2.30
authorNicolas Dufresne <nicolas.dufresne@collabora.com>
Wed, 7 Aug 2019 02:27:40 +0000 (22:27 -0400)
committerTim-Philipp Müller <tim@centricular.com>
Sat, 10 Aug 2019 11:13:00 +0000 (12:13 +0100)
From now on, we will use linux/types.h on Linux, and use typedef of the
various flavour of BSD.

Fixes #635

sys/v4l2/ext/types-compat.h

index d3673dd..ea21c95 100644 (file)
 #ifndef __TYPES_COMPAT_H__
 #define __TYPES_COMPAT_H__
 
+#ifdef   __linux__
+#include <linux/types.h>
+#include <asm/ioctl.h>
+
+#else /* One of the BSDs */
 /* From linux/types.h */
 #ifndef __bitwise__
 #  ifdef __CHECKER__
 #  endif
 #endif
 
-#define __u64 guint64
-#define __u32 guint32
-#define __u16 guint16
-#define __u8 guint8
-#define __s64 gint64
-#define __s32 gint32
-#define __le32 guint32 __bitwise
+typedef guint8  __u8;
+typedef guint16 __u16;
+typedef gint32  __s32;
+typedef guint32 __u32;
+typedef gint64  __s64;
+typedef guint64 __u64;
+typedef guint32 __bitwise __le32;
+
+#endif
 
 #endif /* __TYPES_COMPAT_H__ */