[vlc-commits] Remove dirfd() hacks

Rémi Denis-Courmont git at videolan.org
Tue Jan 3 17:35:25 CET 2012


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Tue Jan  3 18:35:02 2012 +0200| [38227c2441ad80bbf000f3a5fda40f5ca1dd6e3d] | committer: Rémi Denis-Courmont

Remove dirfd() hacks

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=38227c2441ad80bbf000f3a5fda40f5ca1dd6e3d
---

 compat/dirfd.c       |    8 +++-----
 include/vlc_fixups.h |    5 +----
 2 files changed, 4 insertions(+), 9 deletions(-)

diff --git a/compat/dirfd.c b/compat/dirfd.c
index 5c9ddb6..d700b55 100644
--- a/compat/dirfd.c
+++ b/compat/dirfd.c
@@ -25,12 +25,10 @@
 #include <dirent.h>
 #include <errno.h>
 
-int dirfd (DIR *dir)
+int (dirfd) (DIR *dir)
 {
-#if defined (__sun__) || defined (__FreeBSD__)
-    return dir->dd_fd;
-#elif defined (__APPLE__)
-    return dir->__dd_fd;
+#ifdef dirfd
+    return dirfd (dir);
 #else
     (void) dir;
 # ifdef ENOTSUP
diff --git a/include/vlc_fixups.h b/include/vlc_fixups.h
index 092c830..02f85e3 100644
--- a/include/vlc_fixups.h
+++ b/include/vlc_fixups.h
@@ -183,10 +183,7 @@ int fsync (int fd);
 
 /* dirent.h */
 #ifndef HAVE_DIRFD
-#if defined(__APPLE__) || defined(__OS2__) || defined(__FreeBSD__)
-#undef dirfd
-#endif
-int dirfd (DIR *);
+int (dirfd) (DIR *);
 #endif
 
 #ifndef HAVE_FDOPENDIR



More information about the vlc-commits mailing list