File tree Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Original file line number Diff line number Diff line change 33if (CMAKE_SYSTEM_NAME STREQUAL "Darwin" )
44 set (UUID_INCLUDE "" )
55 set (UUID_LIBRARIES "" )
6+ elseif (CMAKE_SYSTEM_NAME STREQUAL "Windows" )
7+ set (UUID_INCLUDE "" )
8+ set (UUID_LIBRARIES "ole32.lib" )
69else ()
710 find_package (UUID REQUIRED)
811 set (UUID_INCLUDE "-I${UUID_INCLUDE_DIRS} " )
Original file line number Diff line number Diff line change 2020// WIN32 doesn't natively support <uuid/uuid.h>. Instead, we use Win32 APIs.
2121#if defined(_WIN32)
2222#define WIN32_LEAN_AND_MEAN
23- #include < rpc.h>
23+ #define NOMINMAX
24+ #include < objbase.h>
2425#include < string>
2526#else
2627#include < uuid/uuid.h>
@@ -31,7 +32,7 @@ using namespace swift;
3132swift::UUID::UUID (FromRandom_t) {
3233#if defined(_WIN32)
3334 ::UUID uuid;
34- UuidCreate (&uuid);
35+ ::CoCreateGuid (&uuid);
3536
3637 memcpy (Value, &uuid, Size);
3738#else
@@ -42,7 +43,7 @@ swift::UUID::UUID(FromRandom_t) {
4243swift::UUID::UUID (FromTime_t) {
4344#if defined(_WIN32)
4445 ::UUID uuid;
45- UuidCreate (&uuid);
46+ ::CoCreateGuid (&uuid);
4647
4748 memcpy (Value, &uuid, Size);
4849#else
You can’t perform that action at this time.
0 commit comments