mirror of
https://github.com/Kitware/CMake.git
synced 2026-03-03 05:08:47 -06:00
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:
committed by
Brad King
parent
ce598cc838
commit
0b9906c2fb
@@ -23,6 +23,7 @@
|
||||
|
||||
#include <cmsys/SystemTools.hxx>
|
||||
#include <cmsys/Directory.hxx>
|
||||
#include <cmsys/Encoding.hxx>
|
||||
|
||||
#include <rpc.h> // for GUID generation
|
||||
|
||||
@@ -954,11 +955,12 @@ std::string cmCPackWIXGenerator::GenerateGUID()
|
||||
UUID guid;
|
||||
UuidCreate(&guid);
|
||||
|
||||
unsigned char *tmp = 0;
|
||||
UuidToString(&guid, &tmp);
|
||||
unsigned short *tmp = 0;
|
||||
UuidToStringW(&guid, &tmp);
|
||||
|
||||
std::string result(reinterpret_cast<char*>(tmp));
|
||||
RpcStringFree(&tmp);
|
||||
std::string result =
|
||||
cmsys::Encoding::ToNarrow(reinterpret_cast<wchar_t*>(tmp));
|
||||
RpcStringFreeW(&tmp);
|
||||
|
||||
return cmSystemTools::UpperCase(result);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user