This commit does the following things to fix compilation on FreeBSD: 1. Add required typedefs to linux/types-compat.h. 2. Remove unnecessary include linux/ioctl.h and replace linux/types.h with linux/types-compat.h. Both files do not exist on FreeBSD. 3. Check the header including makedev macro. FreeBSD does not have sys/sysmacros.h, and including it unconditionally causes error. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1259>