X-Git-Url: https://git.cworth.org/git?p=tar;a=blobdiff_plain;f=gnu%2Fdirent.in.h;fp=gnu%2Fdirent.in.h;h=ccc6a47b0985211b937dc336c3978bdea62f19d6;hp=ddb78d8385898f040f0fe2aa226b520868b98ba4;hb=de7372b23c3da92fbfaea2d1ac592f0b2ba87914;hpb=fbbfb9406a82e647ce27b6462b11a802fa48f31a diff --git a/gnu/dirent.in.h b/gnu/dirent.in.h index ddb78d8..ccc6a47 100644 --- a/gnu/dirent.in.h +++ b/gnu/dirent.in.h @@ -21,6 +21,7 @@ #if __GNUC__ >= 3 @PRAGMA_SYSTEM_HEADER@ #endif +@PRAGMA_COLUMNS@ /* The include_next requires a split double-inclusion guard. */ #@INCLUDE_NEXT@ @NEXT_DIRENT_H@ @@ -52,11 +53,28 @@ _GL_CXXALIAS_SYS (closedir, int, (DIR *)); _GL_CXXALIASWARN (closedir); #if @GNULIB_DIRFD@ -# if !@HAVE_DECL_DIRFD@ && !defined dirfd /* Return the file descriptor associated with the given directory stream, or -1 if none exists. */ -_GL_EXTERN_C int dirfd (DIR *dir) _GL_ARG_NONNULL ((1)); +# if @REPLACE_DIRFD@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef dirfd +# define dirfd rpl_dirfd +# endif +_GL_FUNCDECL_RPL (dirfd, int, (DIR *) _GL_ARG_NONNULL ((1))); +_GL_CXXALIAS_RPL (dirfd, int, (DIR *)); +# else +# if defined __cplusplus && defined GNULIB_NAMESPACE && defined dirfd + /* dirfd is defined as a macro and not as a function. + Turn it into a function and get rid of the macro. */ +static inline int (dirfd) (DIR *dp) { return dirfd (dp); } +# undef dirfd +# endif +# if !(@HAVE_DECL_DIRFD@ || defined dirfd) +_GL_FUNCDECL_SYS (dirfd, int, (DIR *) _GL_ARG_NONNULL ((1))); +# endif +_GL_CXXALIAS_SYS (dirfd, int, (DIR *)); # endif +_GL_CXXALIASWARN (dirfd); #elif defined GNULIB_POSIXCHECK # undef dirfd # if HAVE_RAW_DECL_DIRFD @@ -79,7 +97,7 @@ _GL_WARN_ON_USE (dirfd, "dirfd is unportable - " _GL_FUNCDECL_RPL (fdopendir, DIR *, (int fd)); _GL_CXXALIAS_RPL (fdopendir, DIR *, (int fd)); # else -# if !@HAVE_FDOPENDIR@ +# if !@HAVE_FDOPENDIR@ || !@HAVE_DECL_FDOPENDIR@ _GL_FUNCDECL_SYS (fdopendir, DIR *, (int fd)); # endif _GL_CXXALIAS_SYS (fdopendir, DIR *, (int fd));