Changeset 2054


Ignore:
Timestamp:
22/01/2008 01:00:12 (4 years ago)
Author:
chris
Message:

Detect whether struct DIR has d_fd or dd_fd member and define the
dirfd() macro accordingly.

Location:
box/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • box/trunk/configure.ac

    r2048 r2054  
    160160  #include <netinet/in.h> 
    161161  ]]) 
     162AC_CHECK_MEMBERS([DIR.d_fd],,,  [[#include <dirent.h>]]) 
     163AC_CHECK_MEMBERS([DIR.dd_fd],,, [[#include <dirent.h>]]) 
    162164 
    163165AC_CHECK_DECLS([INFTIM],,, [[#include <poll.h>]]) 
  • box/trunk/lib/common/BoxPlatform.h

    r2049 r2054  
    171171 
    172172#if ! HAVE_DECL_DIRFD 
    173         #define dirfd(x) (x)->d_fd 
     173        #ifdef HAVE_DIR_D_FD 
     174                #define dirfd(x) (x)->d_fd 
     175        #elif defined HAVE_DIR_DD_FD 
     176                #define dirfd(x) (x)->dd_fd 
     177        #else 
     178                #error No way to get file descriptor from DIR structure 
     179        #endif 
    174180#endif 
    175181 
Note: See TracChangeset for help on using the changeset viewer.