no readdir_r on windows; refs #7

master
Marc Wäckerlin 11 years ago
parent 3f2a31fb12
commit b57731d286
  1. 4
      src/mrw/file.hxx

@ -360,7 +360,11 @@ namespace mrw {
operator bool() throw() { operator bool() throw() {
static const std::string D("."), DD(".."); static const std::string D("."), DD("..");
static dirent* fake; static dirent* fake;
# if defined(WIN32) || defined(_WIN32) || defined(__MINGW32__)
if (!(_entry.entry()=readdir(_dir))) return false;
# else
if (readdir_r(_dir, &_entry.entry(), &fake) || !fake) return false; if (readdir_r(_dir, &_entry.entry(), &fake) || !fake) return false;
# endif
if (_ignoreDots if (_ignoreDots
&& (_entry.type()==Entry::UNKNOWN || _entry.type()==Entry::DIR) && (_entry.type()==Entry::UNKNOWN || _entry.type()==Entry::DIR)
&& (D==_entry() || DD==_entry())) && (D==_entry() || DD==_entry()))

Loading…
Cancel
Save