From ab45bdf214021f85f5015a766a714956cdde563a Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Thu, 7 Feb 2002 01:17:54 +0000 Subject: [PATCH] Fix for Win32 build. --- src/osgDB/FileUtils.cpp | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/osgDB/FileUtils.cpp b/src/osgDB/FileUtils.cpp index 5635cb9d2..256fe8d94 100644 --- a/src/osgDB/FileUtils.cpp +++ b/src/osgDB/FileUtils.cpp @@ -356,19 +356,18 @@ osgDB::DirectoryContents osgDB::getDirectoryContents(const std::string& dirName) { osgDB::DirectoryContents contents; - struct _finddata_t data; - long handle = FindFirstFile((dirName + "\\*").c_str(), &data); - if (handle != -1) + WIN32_FIND_DATA data; + HANDLE handle = FindFirstFile((dirName + "\\*").c_str(), &data); + if (handle != INVALID_HANDLE_VALUE) { do { - contents.push_back(data.name); + contents.push_back(data.cFileName); } - while (FindNextFile(handle, &data) != -1); + while (FindNextFile(handle, &data) != 0); - _findclose(handle); + FindClose(handle); } - return contents; }