Windows: Use wide-character system APIs

Make CMake compile with -DUNICODE.  Make it possible for the 8 bit
encoding to eventually be UTF-8 instead ANSI.
This commit is contained in:
Clinton Stimpson
2013-12-04 22:17:24 -07:00
committed by Brad King
parent ce598cc838
commit 0b9906c2fb
9 changed files with 107 additions and 78 deletions
+4 -1
View File
@@ -16,6 +16,8 @@
# include <cmsys/hash_map.hxx>
#endif
#include <cmsys/Encoding.hxx>
// Use a platform-specific API to get file times efficiently.
#if !defined(_WIN32) || defined(__CYGWIN__)
# define cmFileTimeComparison_Type struct stat
@@ -86,7 +88,8 @@ bool cmFileTimeComparisonInternal::Stat(const char* fname,
// Windows version. Get the modification time from extended file
// attributes.
WIN32_FILE_ATTRIBUTE_DATA fdata;
if(!GetFileAttributesEx(fname, GetFileExInfoStandard, &fdata))
if(!GetFileAttributesExW(cmsys::Encoding::ToWide(fname).c_str(),
GetFileExInfoStandard, &fdata))
{
return false;
}