Skip to content

Commit 00b64fc

Browse files
committed
configure: improve check for POSIX ioctl
Instead of relying on system #ifdefs which may or may not be correct, detect the POSIX ioctl signature at configure time.
1 parent 6aafe61 commit 00b64fc

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

configure

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2524,6 +2524,7 @@ HAVE_LIST="
25242524
opencl_videotoolbox
25252525
perl
25262526
pod2man
2527+
posix_ioctl
25272528
texi2html
25282529
xmllint
25292530
zlib_gzip
@@ -7166,6 +7167,7 @@ xmllint --version > /dev/null 2>&1 && enable xmllint || disable xmllint
71667167
check_headers linux/fb.h
71677168
check_headers linux/videodev2.h
71687169
test_code cc linux/videodev2.h "struct v4l2_frmsizeenum vfse; vfse.discrete.width = 0;" && enable_sanitized struct_v4l2_frmivalenum_discrete
7170+
test_code cc sys/ioctl.h "int ioctl(int, int, ...)" && enable posix_ioctl
71697171

71707172
# check V4L2 codecs available in the API
71717173
if enabled v4l2_m2m; then

libavdevice/v4l2.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ struct video_data {
111111
int (*open_f)(const char *file, int oflag, ...);
112112
int (*close_f)(int fd);
113113
int (*dup_f)(int fd);
114-
#if defined(__sun) || defined(__BIONIC__) || defined(__musl__) /* POSIX-like */
114+
#if HAVE_POSIX_IOCTL
115115
int (*ioctl_f)(int fd, int request, ...);
116116
#else
117117
int (*ioctl_f)(int fd, unsigned long int request, ...);

0 commit comments

Comments
 (0)