Skip to content
Snippets Groups Projects
Commit 7065821e authored by Rye Mutt's avatar Rye Mutt :bread:
Browse files

Mildy faster gDirUtilp fileExists on win platform

parent f63423a2
No related branches found
No related tags found
No related merge requests found
...@@ -75,6 +75,10 @@ target_link_libraries(llvfs ...@@ -75,6 +75,10 @@ target_link_libraries(llvfs
${vfs_BOOST_LIBRARIES} ${vfs_BOOST_LIBRARIES}
) )
if (WINDOWS)
target_link_libraries(llvfs Shlwapi)
endif (WINDOWS)
if (DARWIN) if (DARWIN)
include(CMakeFindFrameworks) include(CMakeFindFrameworks)
find_library(COCOA_LIBRARY Cocoa) find_library(COCOA_LIBRARY Cocoa)
......
...@@ -40,6 +40,7 @@ ...@@ -40,6 +40,7 @@
#include <errno.h> #include <errno.h>
#include <sys/types.h> #include <sys/types.h>
#include <sys/stat.h> #include <sys/stat.h>
#include <shlwapi.h>
// Utility stuff to get versions of the sh // Utility stuff to get versions of the sh
#define PACKVERSION(major,minor) MAKELONG(minor,major) #define PACKVERSION(major,minor) MAKELONG(minor,major)
...@@ -371,20 +372,9 @@ std::string LLDir_Win32::getCurPath() ...@@ -371,20 +372,9 @@ std::string LLDir_Win32::getCurPath()
} }
bool LLDir_Win32::fileExists(const std::string &filename) const bool LLDir_Win32::fileExists(const std::string& filename) const
{ {
llstat stat_data; return PathFileExists(ll_convert_string_to_wide(filename).c_str());
// Check the age of the file
// Now, we see if the files we've gathered are recent...
int res = LLFile::stat(filename, &stat_data);
if (!res)
{
return TRUE;
}
else
{
return FALSE;
}
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment