2013-09-26 17:14:40 +02:00

40 lines
936 B
Plaintext

$NetBSD: patch-al,v 1.2 2012/04/18 17:47:22 hans Exp $
--- libv4l1/log.c.orig 2008-08-06 04:46:13.000000000 -0400
+++ libv4l1/log.c 2009-01-10 15:56:48.000000000 -0500
@@ -18,6 +18,7 @@
#include <stdio.h>
#include <stdlib.h>
+#ifdef __linux__
#include <linux/ioctl.h>
/* 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,8 +26,26 @@
#include <asm/types.h>
/* end broken header workaround includes */
#include <linux/videodev.h>
+#else
+#ifdef __sun
+#include <sys/ioccom.h>
+#endif
+#include <sys/ioctl.h>
+#include "videodev.h"
+#endif
#include "libv4l1-priv.h"
+#if defined(__sun)
+#define IOCGROUP(x) (((x) >> 8) & 0xff)
+#endif
+
+#ifndef _IOC_NR
+#define _IOC_NR(x) ((x) & 0xff)
+#endif
+#ifndef _IOC_TYPE
+#define _IOC_TYPE IOCGROUP
+#endif
+
#define ARRAY_SIZE(x) (sizeof(x)/sizeof((x)[0]))
FILE *v4l1_log_file = NULL;