By Date: <-- -->
By Thread: <-- -->

inclusion of type-defining headers in linux/videodev2.h



On Tue, 2006-05-16 at 18:32 +0200, Fredrik de Vibe wrote:
> -#include <linux/compiler.h>
> -#ifdef __KERNEL__
> -#include <linux/time.h> /* need struct timeval */
> -#endif
>  #include <linux/compiler.h> /* need __user */
> +#include <linux/types.h> /* __s32, __u32 etc. */
> +#include <linux/time.h> /* need struct timeval */

Please don't include linux/time.h, that's a kernel header. Applications
include sys/time.h. When I do that, directly or indirectly, I get a
compile error because linux/time.h redefines various structs.

IMHO application writers should use a modified copy of videodev2.h (I
use a copy because I want the latest version, not the version installed
on the box compiling the application) or
  #include <sys/time.h>
  #include <asm/types.h>
before including videodev2.h.

Also linux/compiler.h of 2.4 kernels does not define __user. I could
#define __user in a copy of videodev2.h, or in the file including it,
but then I may get a macro redefinition warning. Perhaps we could add a
#if LINUX_VERSION_CODE ... #define __user?

Michael

--
video4linux-list mailing list
Unsubscribe mailto:video4linux-list-request (at) redhat.com?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/video4linux-list