endif(WITH_XINE)
# --- V4L ---
-ocv_clear_vars(HAVE_LIBV4L HAVE_CAMV4L HAVE_CAMV4L2)
+ocv_clear_vars(HAVE_LIBV4L HAVE_CAMV4L HAVE_CAMV4L2 HAVE_IOCTL_ULONG)
if(WITH_V4L)
CHECK_MODULE(libv4l1 HAVE_LIBV4L)
CHECK_INCLUDE_FILE(linux/videodev.h HAVE_CAMV4L)
CHECK_INCLUDE_FILE(linux/videodev2.h HAVE_CAMV4L2)
CHECK_INCLUDE_FILE(sys/videoio.h HAVE_VIDEOIO)
+ INCLUDE(CheckPrototypeDefinition)
+ CHECK_PROTOTYPE_DEFINITION(ioctl
+ "int ioctl(int d, unsigned long request, ...)"
+ "-1"
+ "sys/ioctl.h"
+ HAVE_IOCTL_ULONG)
endif(WITH_V4L)
# --- OpenNI ---
/* V4L/V4L2 capturing support via libv4l */
#cmakedefine HAVE_LIBV4L
+/* ioctl takes unsigned long request rather than int */
+#cmakedefine HAVE_IOCTL_ULONG
+
/* Carbon windowing environment */
#cmakedefine HAVE_CARBON
static int indexList = 0;
// IOCTL handling for V4L2
+#ifdef HAVE_IOCTL_ULONG
+static int xioctl( int fd, unsigned long request, void *arg)
+#else
static int xioctl( int fd, int request, void *arg)
+#endif
{
int r;
static int numCameras = 0;
static int indexList = 0;
+#ifdef HAVE_IOCTL_ULONG
+static int xioctl( int fd, unsigned long request, void *arg)
+#else
static int xioctl( int fd, int request, void *arg)
+#endif
{
-
int r;
-
do r = ioctl (fd, request, arg);
while (-1 == r && EINTR == errno);
return r;
-
}
/* Simple test program: Find number of Video Sources available.