Commits

Armin Rigo committed 9d652c0

Replace this hard-coded "4" with the #define.

  • Participants
  • Parent commits eb826ac
  • Branches cpy-extension

Comments (0)

Files changed (1)

     DIR *fdopendir(int fd);
     int closedir(DIR *dirp);
 
+    static const int DT_DIR;
+
 """)
 ffi.C = ffi.verify("""
 #ifndef _ATFILE_SOURCE
 #  define _ATFILE_SOURCE
 #endif
+#ifndef _BSD_SOURCE
+#  define _BSD_SOURCE
+#endif
 #include <fcntl.h>
 #include <sys/types.h>
 #include <dirent.h>
             break
         name = str(dirent.d_name)
         print '%3d %s' % (dirent.d_type, name)
-        if dirent.d_type == 4 and name != '.' and name != '..':
+        if dirent.d_type == ffi.C.DT_DIR and name != '.' and name != '..':
             walk(dirfd, name)
     ffi.C.closedir(dir)
     print '}'