diff options
| author | Abdelkader Boudih <freebsd@seuros.com> | 2026-08-12 16:44:04 +0000 |
|---|---|---|
| committer | Adrian Chadd <adrian@FreeBSD.org> | 2026-08-12 16:51:50 +0000 |
| commit | fb3564b44fa7b469b1ef29d3d2866364b89431eb (patch) | |
| tree | 09edb1ead4d039ecab2c1bc8db199f3edef943cc | |
| parent | 527a82474cb3dfbaa241e45fc0c16e57732cae94 (diff) | |
video: fix v4l2_buffer size assert on non-i386 32-bit ports
Split the #else branch into an explicit __i386__ case (68) and a
generic ILP32-with-64-bit-time_t case (80) covering arm and powerpc.
Fixes: 0343ab8a6afa
Reviewed by: adrian
Differential Revision: https://reviews.freebsd.org/D58790
| -rw-r--r-- | sys/sys/videoio.h | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/sys/sys/videoio.h b/sys/sys/videoio.h index 4a49a188fa47..bcf7ccaf8cb2 100644 --- a/sys/sys/videoio.h +++ b/sys/sys/videoio.h @@ -495,11 +495,6 @@ struct v4l2_frmivalenum { #define VIDIOC_ENUM_FRAMESIZES _IOWR('V', 74, struct v4l2_frmsizeenum) #define VIDIOC_ENUM_FRAMEINTERVALS _IOWR('V', 75, struct v4l2_frmivalenum) -/* - * These are commented out as there are currently some issues building - * some compatibility interfaces. - */ -#if 0 _Static_assert(sizeof(struct v4l2_pix_format) == 48, "v4l2_pix_format layout"); _Static_assert(sizeof(struct v4l2_capability) == 104, "v4l2_capability layout"); _Static_assert(sizeof(struct v4l2_requestbuffers) == 20, @@ -508,11 +503,16 @@ _Static_assert(sizeof(struct v4l2_requestbuffers) == 20, _Static_assert(__offsetof(struct v4l2_format, fmt) == 8, "v4l2_format layout"); _Static_assert(sizeof(struct v4l2_format) == 208, "v4l2_format layout"); _Static_assert(sizeof(struct v4l2_buffer) == 88, "v4l2_buffer layout"); -#else +#elif defined(__i386__) +/* i386 is the only 32-bit port with a 32-bit time_t. */ _Static_assert(__offsetof(struct v4l2_format, fmt) == 4, "v4l2_format layout"); _Static_assert(sizeof(struct v4l2_format) == 204, "v4l2_format layout"); _Static_assert(sizeof(struct v4l2_buffer) == 68, "v4l2_buffer layout"); -#endif +#else +/* ILP32 with a 64-bit time_t: arm, powerpc, mips, riscv32. */ +_Static_assert(__offsetof(struct v4l2_format, fmt) == 4, "v4l2_format layout"); +_Static_assert(sizeof(struct v4l2_format) == 204, "v4l2_format layout"); +_Static_assert(sizeof(struct v4l2_buffer) == 80, "v4l2_buffer layout"); #endif #endif /* _SYS_VIDEOIO_H_ */ |
