GNOME Bugzilla – Bug 722953
v4l2: ENODATA is Linux-only
Last modified: 2014-02-04 16:00:51 UTC
FreeBSD supports v4l, but we use ENODATA in sys/v4l2/v4l2_calls.c (since bug 698827). Probably the best way to fix this is with a simple #ifdef -- ENODATA is #define'd on Linux.
Created attachment 267175 [details] [review] v4l2: guard use of ENODATA with #ifdef Not all systems with v4l have ENODATA defined, so check that we have it before attempting to use it.
Comment on attachment 267175 [details] [review] v4l2: guard use of ENODATA with #ifdef Is it guaranteed that ENODATA is a #define and not an enum value? Makes sense otherwise
POSIX pretty explicitly states that the errno constants that is mandates must be #ifdef-ible: All values listed in this section shall be unique integer constant expressions with type int suitable for use in #if preprocessing directives... http://pubs.opengroup.org/onlinepubs/009695399/functions/xsh_chap02_03.html Of course, ENODATA is not standard -- but given that POSIX mandates error constants being defines, I think it's pretty reasonable to assume that the non-standard error constants that Linux adds will be as well.
Thanks and sorry for being too lazy to look it up myself :) commit a46f667853fecd34ffbbcfd0920295af930a80b7 Author: Ryan Lortie <desrt@desrt.ca> Date: Sat Jan 25 02:06:00 2014 -0500 v4l2: guard use of ENODATA with #ifdef Not all systems with v4l have ENODATA defined, so check that we have it before attempting to use it. https://bugzilla.gnome.org/show_bug.cgi?id=722953