X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=lib%2Fdirent.in.h;h=ebbc425511f3dd53878d37d89ca39b5cfeaee69f;hb=65fb20d6b5eb7308276da1a421bfcd253faff703;hp=3989a2546e923046af5d73853aaa454cc23836d1;hpb=e046ffb123d352dec87f91fc638490572ef4d31d;p=gnulib.git diff --git a/lib/dirent.in.h b/lib/dirent.in.h index 3989a2546..ebbc42551 100644 --- a/lib/dirent.in.h +++ b/lib/dirent.in.h @@ -1,5 +1,5 @@ /* A GNU-like . - Copyright (C) 2006-2010 Free Software Foundation, Inc. + Copyright (C) 2006-2011 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -14,17 +14,18 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#ifndef _GL_DIRENT_H +#ifndef _@GUARD_PREFIX@_DIRENT_H #if __GNUC__ >= 3 @PRAGMA_SYSTEM_HEADER@ #endif +@PRAGMA_COLUMNS@ /* The include_next requires a split double-inclusion guard. */ #@INCLUDE_NEXT@ @NEXT_DIRENT_H@ -#ifndef _GL_DIRENT_H -#define _GL_DIRENT_H +#ifndef _@GUARD_PREFIX@_DIRENT_H +#define _@GUARD_PREFIX@_DIRENT_H /* Get ino_t. Needed on some systems, including glibc 2.8. */ #include @@ -50,11 +51,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 @@ -77,7 +95,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)); @@ -150,5 +168,5 @@ _GL_WARN_ON_USE (alphasort, "alphasort is unportable - " #endif -#endif /* _GL_DIRENT_H */ -#endif /* _GL_DIRENT_H */ +#endif /* _@GUARD_PREFIX@_DIRENT_H */ +#endif /* _@GUARD_PREFIX@_DIRENT_H */