$NetBSD: patch-ae,v 1.4 2012/04/18 17:47:22 hans Exp $ --- libv4l2/log.c.orig 2008-09-08 14:45:43.000000000 -0400 +++ libv4l2/log.c 2008-09-08 14:47:53.000000000 -0400 @@ -18,6 +18,7 @@ #include #include +#ifdef __linux__ #include /* These headers are not needed by us, but by linux/videodev2.h, which is broken on some systems and doesn't include them itself :( */ @@ -25,9 +26,28 @@ #include /* end broken header workaround includes */ #include +#else +#include +#include +#include +#ifdef __sun +#include +#else +#include +#endif +#endif #include "libv4l2.h" #include "libv4l2-priv.h" +#if defined(__sun) +#define IOCGROUP(x) (((x) >> 8) & 0xff) +#endif + +#if defined(__NetBSD__) || defined(__DragonFly__) || defined(__sun) +#define _IOC_NR(x) ((x) & 0xff) +#define _IOC_TYPE IOCGROUP +#endif + #define ARRAY_SIZE(x) (sizeof(x)/sizeof((x)[0])) FILE *v4l2_log_file = NULL; @@ -84,11 +104,13 @@ static const char *v4l2_ioctls[] = { [_IOC_NR(VIDIOC_ENUMAUDOUT)] = "VIDIOC_ENUMAUDOUT", [_IOC_NR(VIDIOC_G_PRIORITY)] = "VIDIOC_G_PRIORITY", [_IOC_NR(VIDIOC_S_PRIORITY)] = "VIDIOC_S_PRIORITY", +#ifdef VIDIOC_G_SLICED_VBI_CAP [_IOC_NR(VIDIOC_G_SLICED_VBI_CAP)] = "VIDIOC_G_SLICED_VBI_CAP", [_IOC_NR(VIDIOC_LOG_STATUS)] = "VIDIOC_LOG_STATUS", [_IOC_NR(VIDIOC_G_EXT_CTRLS)] = "VIDIOC_G_EXT_CTRLS", [_IOC_NR(VIDIOC_S_EXT_CTRLS)] = "VIDIOC_S_EXT_CTRLS", [_IOC_NR(VIDIOC_TRY_EXT_CTRLS)] = "VIDIOC_TRY_EXT_CTRLS", +#endif }; void v4l2_log_ioctl(unsigned long int request, void *arg, int result)