#include "dirent.h"

typedef DIR* DIRptr;
typedef struct dirent* direntptr;

#define chpl_rt_direntptr_getname(x) ((x)->d_name)

//
// Note: This is not portable; more generally, need to use lstat() or similar;
// see the readdir() man page for notes
//
#define chpl_rt_direntptr_isDir(x)   ((x)->d_type == DT_DIR)

#include "dirent.h"

typedef DIR* DIRptr;

#ifndef __USE_FILE_OFFSET64
typedef struct dirent* direntptr;
#else
#ifdef __REDIRECT
typedef struct dirent* direntptr;
#else
typedef struct dirent64* direntptr;
#endif
#endif

#define chpl_rt_direntptr_getname(x) ((x)->d_name)

//
// Note: This is not portable; more generally, need to use lstat() or similar;
// see the readdir() man page for notes
//
#define chpl_rt_direntptr_isDir(x)   ((x)->d_type == DT_DIR)

Make the filerator test more portable
Make the filerator test more portable

For some reason that I haven't been able to determine, the return type of
readdir() is sometimes dirent64* rather than dirent* as all the man pages and
documentation that I can find suggest.  This happens with prgenv-pgi and
prgenv-cray compilers for example.  Here, I'm guarding our typedef of
'direntptr' for Chapel's use with a similar #ifndef structure as the
/usr/lib/dirent.h file to make this test work on our current systems.  This is
likely be something that we need to understand and resolve better before
putting a filerator into our standard libraries, though... :(



git-svn-id: 88467cb1fb04b8a755be7e1ee1026be4190196ef@23824 3a8e244f-b0f2-452b-bcba-4c88e055c3ca
