]> granicus.if.org Git - strace/commitdiff
v4l2: do not mpersify struct v4l2_create unless it is used by other code
authorDmitry V. Levin <ldv@altlinux.org>
Fri, 19 Jan 2018 17:50:09 +0000 (17:50 +0000)
committerDmitry V. Levin <ldv@altlinux.org>
Fri, 19 Jan 2018 17:50:09 +0000 (17:50 +0000)
This fixes build with mpers support on older systems that lack
definition of struct v4l2_create.

* v4l2.c: Wrap references to struct v4l2_create with
[VIDIOC_CREATE_BUFS].

v4l2.c

diff --git a/v4l2.c b/v4l2.c
index 4a0cbdc48edb69d39df3d309da62be8af7945be2..c1adf74b7c876b55963dc0db37b55b0811a347c3 100644 (file)
--- a/v4l2.c
+++ b/v4l2.c
 
 #include "defs.h"
 
+#include <stdint.h>
+#include <linux/ioctl.h>
+#include <linux/types.h>
+#include <linux/videodev2.h>
+
 #include DEF_MPERS_TYPE(struct_v4l2_buffer)
 #include DEF_MPERS_TYPE(struct_v4l2_clip)
-#include DEF_MPERS_TYPE(struct_v4l2_create_buffers)
+#ifdef VIDIOC_CREATE_BUFS
+# include DEF_MPERS_TYPE(struct_v4l2_create_buffers)
+#endif
 #include DEF_MPERS_TYPE(struct_v4l2_ext_control)
 #include DEF_MPERS_TYPE(struct_v4l2_ext_controls)
 #include DEF_MPERS_TYPE(struct_v4l2_format)
 #include DEF_MPERS_TYPE(struct_v4l2_input)
 #include DEF_MPERS_TYPE(struct_v4l2_standard)
 
-#include <stdint.h>
-#include <linux/ioctl.h>
-#include <linux/types.h>
-#include <linux/videodev2.h>
-
 typedef struct v4l2_buffer struct_v4l2_buffer;
 typedef struct v4l2_clip struct_v4l2_clip;
+#ifdef VIDIOC_CREATE_BUFS
 typedef struct v4l2_create_buffers struct_v4l2_create_buffers;
+#endif
 typedef struct v4l2_ext_control struct_v4l2_ext_control;
 typedef struct v4l2_ext_controls struct_v4l2_ext_controls;
 typedef struct v4l2_format struct_v4l2_format;