diff --git a/configure.ac b/configure.ac index 0ccf9a9..eabceac 100644 --- a/configure.ac +++ b/configure.ac @@ -154,6 +154,10 @@ else fi AC_SUBST(SOUNDOBJ) +# +# dirfd +# +UTILS_FUNC_DIRFD # # debugging diff --git a/disk.c b/disk.c index 4903a3b..a9e31f9 100644 --- a/disk.c +++ b/disk.c @@ -20,16 +20,6 @@ #include "disk.h" -#if (defined(sun) && (defined(__svr4__) || defined(__SVR4))) -#define SOLARIS -#endif - -#if (defined(SOLARIS) || defined(__hpux)) -#define DIRFD(a) ((a)->dd_fd) -#else -#define DIRFD(a) (dirfd(a)) -#endif - #include #include #include @@ -41,6 +31,16 @@ #include #include /* ctime */ +#if defined(HAVE_DIRFD) +#define DIRFD(a) (dirfd(a)) +#else +#define DIRFD(a) ((a)->DIR_FD_MEMBER_NAME) +#endif + +/* TODO: let autoconf figure out everything below... */ +#if (defined(sun) && (defined(__svr4__) || defined(__SVR4))) +#define SOLARIS +#endif #if (defined(SOLARIS) || defined (__hpux) || defined(__BEOS__)) #include /* solaris statvfs */