On some systems (E.G. uClibc and older Glibc versions), O_CLOEXEC is only
defined when _GNU_SOURCE is specified, so do so.
_GNU_SOURCE needs to be defined before any system headers are included,
so move the fcntl.h section up.
https://bugzilla.gnome.org/show_bug.cgi?id=709423
# include <config.h>
#endif
-#include <sys/mman.h>
-#include <string.h>
-#include <unistd.h>
#if HAVE_DECL_V4L2_MEMORY_DMABUF
+#ifndef _GNU_SOURCE
+# define _GNU_SOURCE /* O_CLOEXEC */
+#endif
#include <fcntl.h>
#endif
+#include <sys/mman.h>
+#include <string.h>
+#include <unistd.h>
+
#include "gst/video/video.h"
#include "gst/video/gstvideometa.h"
#include "gst/video/gstvideopool.h"