--- ./include/libv4l1.h.orig 2013-01-14 18:43:39.597743683 +0100 +++ ./include/libv4l1.h 2013-01-14 18:47:08.951744358 +0100 @@ -22,6 +22,11 @@ #include #include +#ifdef __cplusplus +#undef extern +#define extern extern "C" +#endif + /* Point this to a FILE opened for writing when you want to log error and status messages to a file, when NULL errors will get send to stderr */ extern FILE *v4l1_log_file; @@ -47,12 +52,13 @@ capture formats, like hw specific bayer compression methods). */ -int v4l1_open (const char *file, int oflag, ...); -int v4l1_close(int fd); -int v4l1_ioctl (int fd, unsigned long int request, ...); -ssize_t v4l1_read (int fd, void* buffer, size_t n); -void *v4l1_mmap(void *start, size_t length, int prot, int flags, int fd, +extern int v4l1_open (const char *file, int oflag, ...); +extern int v4l1_close(int fd); +extern int v4l1_ioctl (int fd, unsigned long int request, ...); +extern ssize_t v4l1_read (int fd, void* buffer, size_t n); +extern void *v4l1_mmap(void *start, size_t length, int prot, int flags, int fd, off_t offset); -int v4l1_munmap(void *_start, size_t length); +extern int v4l1_munmap(void *_start, size_t length); +#undef extern #endif --- ./include/libv4l2.h.orig 2013-01-14 18:43:59.668744017 +0100 +++ ./include/libv4l2.h 2013-01-14 18:47:35.436743339 +0100 @@ -22,6 +22,11 @@ #include #include +#ifdef __cplusplus +#undef extern +#define extern extern "C" +#endif + /* Point this to a FILE opened for writing when you want to log error and status messages to a file, when NULL errors will get send to stderr */ extern FILE *v4l2_log_file; @@ -45,13 +50,13 @@ fail. */ -int v4l2_open (const char *file, int oflag, ...); -int v4l2_close(int fd); -int v4l2_ioctl (int fd, unsigned long int request, ...); -ssize_t v4l2_read (int fd, void* buffer, size_t n); -void *v4l2_mmap(void *start, size_t length, int prot, int flags, int fd, +extern int v4l2_open (const char *file, int oflag, ...); +extern int v4l2_close(int fd); +extern int v4l2_ioctl (int fd, unsigned long int request, ...); +extern ssize_t v4l2_read (int fd, void* buffer, size_t n); +extern void *v4l2_mmap(void *start, size_t length, int prot, int flags, int fd, off_t offset); -int v4l2_munmap(void *_start, size_t length); +extern int v4l2_munmap(void *_start, size_t length); /* Misc utility functions */ @@ -62,12 +67,12 @@ Normally returns 0, even if the cid did not exist or was locked, returns non 0 when an other error occured. */ -int v4l2_set_control(int fd, int cid, int value); +extern int v4l2_set_control(int fd, int cid, int value); /* This function returns a value of 0 - 65535, scaled to from the actual range of the given v4l control id. when the cid does not exist, could not be accessed for some reason, or some error occured 0 is returned. */ -int v4l2_get_control(int fd, int cid); +extern int v4l2_get_control(int fd, int cid); /* "low level" access functions, these functions allow somewhat lower level @@ -85,6 +90,7 @@ Returns fd on success, -1 if the fd is not suitable for use through libv4l2 (note the fd is left open in this case). */ -int v4l2_fd_open(int fd, int v4l2_flags); +extern int v4l2_fd_open(int fd, int v4l2_flags); +#undef extern #endif