mirror of
https://github.com/Stichting-MINIX-Research-Foundation/pkgsrc-ng.git
synced 2025-09-11 13:30:02 -04:00
88 lines
2.1 KiB
Plaintext
88 lines
2.1 KiB
Plaintext
$NetBSD: patch-af,v 1.5 2013/06/24 15:57:21 jperkin Exp $
|
|
|
|
* XXXX
|
|
* `mode_t' is promoted to `int' when passed through `...'.
|
|
* Fix SunOS 64-bit.
|
|
|
|
--- libv4l2/v4l2convert.c.orig 2008-08-26 12:32:39.000000000 +0000
|
|
+++ libv4l2/v4l2convert.c
|
|
@@ -24,11 +24,16 @@
|
|
|
|
#include <stdarg.h>
|
|
#include <stdlib.h>
|
|
+#ifdef __linux__
|
|
#include <syscall.h>
|
|
+#else
|
|
+#include <sys/syscall.h>
|
|
+#endif
|
|
#include <fcntl.h>
|
|
#include <string.h>
|
|
#include <sys/ioctl.h>
|
|
#include <sys/mman.h>
|
|
+#ifdef __linux__
|
|
/* These headers are not needed by us, but by linux/videodev2.h,
|
|
which is broken on some systems and doesn't include them itself :( */
|
|
#include <sys/time.h>
|
|
@@ -36,8 +41,22 @@
|
|
#include <linux/ioctl.h>
|
|
/* end broken header workaround includes */
|
|
#include <linux/videodev2.h>
|
|
+#else
|
|
+#include <sys/types.h>
|
|
+#include <sys/time.h>
|
|
+#include <sys/ioctl.h>
|
|
+#ifdef __sun
|
|
+#include <sys/videodev2.h>
|
|
+#else
|
|
+#include <sys/videoio.h>
|
|
+#endif
|
|
+#endif
|
|
#include <libv4l2.h>
|
|
|
|
+#ifndef O_LARGEFILE
|
|
+#define O_LARGEFILE 0
|
|
+#endif
|
|
+
|
|
/* Check that open/read/mmap is not a define */
|
|
#if defined open || defined read || defined mmap
|
|
#error open/read/mmap is a prepocessor macro !!
|
|
@@ -61,7 +80,7 @@ LIBV4L_PUBLIC int open (const char *file
|
|
mode_t mode;
|
|
|
|
va_start (ap, oflag);
|
|
- mode = va_arg (ap, mode_t);
|
|
+ mode = (sizeof (mode_t) < sizeof (int) ? (mode_t)va_arg (ap, int) : va_arg (ap, mode_t));
|
|
|
|
fd = syscall(SYS_open, file, oflag, mode);
|
|
|
|
@@ -92,6 +111,7 @@ LIBV4L_PUBLIC int open (const char *file
|
|
return fd;
|
|
}
|
|
|
|
+#if !(defined(__sun) && defined(_LP64))
|
|
LIBV4L_PUBLIC int open64(const char *file, int oflag, ...)
|
|
{
|
|
int fd;
|
|
@@ -114,6 +134,7 @@ LIBV4L_PUBLIC int open64(const char *fil
|
|
|
|
return fd;
|
|
}
|
|
+#endif
|
|
|
|
LIBV4L_PUBLIC int close(int fd)
|
|
{
|
|
@@ -148,11 +169,13 @@ LIBV4L_PUBLIC void *mmap(void *start, si
|
|
return v4l2_mmap(start, length, prot, flags, fd, offset);
|
|
}
|
|
|
|
+#if !(defined(__sun) && defined(_LP64))
|
|
LIBV4L_PUBLIC void *mmap64(void *start, size_t length, int prot, int flags, int fd,
|
|
__off64_t offset)
|
|
{
|
|
return v4l2_mmap(start, length, prot, flags, fd, offset);
|
|
}
|
|
+#endif
|
|
|
|
LIBV4L_PUBLIC int munmap(void *start, size_t length)
|
|
{
|