+/* Declare GNU extensions. */
+
+#if @GNULIB_DIRFD@
+# if !@HAVE_DECL_DIRFD@ && !defined dirfd
+/* Return the file descriptor associated with the given directory stream,
+ or -1 if none exists. */
+extern int dirfd (DIR const *dir);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef dirfd
+# define dirfd(d) \
+ (GL_LINK_WARNING ("dirfd is unportable - " \
+ "use gnulib module dirfd for portability"), \
+ dirfd (d))
+#endif
+