coreclr-git: Prefer BSD uuid
authorKamil Rytarowski <n54@gmx.com>
Sat, 13 Feb 2016 20:50:16 +0000 (21:50 +0100)
committerKamil Rytarowski <n54@gmx.com>
Sat, 13 Feb 2016 20:50:44 +0000 (21:50 +0100)
coreclr-git/distinfo
coreclr-git/patches/patch-src_pal_src_misc_miscpalapi.cpp [new file with mode: 0644]

index 08f10b4e59f0230d87d3931c2e386005b6d443a0..30b008833be5c53812f44a8053d53733ed778007 100644 (file)
@@ -1,6 +1,7 @@
 $NetBSD$
 
 SHA1 (patch-src_gc_gc.cpp) = c468a34bbafe35dcd242065762ff042a94152e47
+SHA1 (patch-src_pal_src_misc_miscpalapi.cpp) = b7a902309081c9a1a4d7a8a4dcfbb11342c7e311
 SHA1 (patch-src_vm_amd64_externalmethodfixupthunk.S) = 5e84b369f30ea62e391e1f949d0d01e1995e5192
 SHA1 (patch-src_vm_amd64_jithelpers__fast.S) = b4002abaed826b673c0af58a818c25d6b17e488e
 SHA1 (patch-src_vm_amd64_pinvokestubs.S) = 344e94f87fc08edde9a61f74a495e3bd2ed11248
diff --git a/coreclr-git/patches/patch-src_pal_src_misc_miscpalapi.cpp b/coreclr-git/patches/patch-src_pal_src_misc_miscpalapi.cpp
new file mode 100644 (file)
index 0000000..8690e79
--- /dev/null
@@ -0,0 +1,50 @@
+$NetBSD$
+
+--- src/pal/src/misc/miscpalapi.cpp.orig       2016-01-28 19:04:13.000000000 +0000
++++ src/pal/src/misc/miscpalapi.cpp
+@@ -33,10 +33,10 @@ Revision History:
+ #include <pthread.h>
+ #include <dlfcn.h>
+-#if HAVE_LIBUUID_H
+-#include <uuid/uuid.h>
+-#elif HAVE_BSD_UUID_H
++#if HAVE_BSD_UUID_H
+ #include <uuid.h>
++#elif HAVE_LIBUUID_H
++#include <uuid/uuid.h>
+ #endif
+ #include <pal_endian.h>
+@@ -352,15 +352,7 @@ HRESULT
+ PALAPI
+ CoCreateGuid(OUT GUID * pguid)
+ {
+-#if HAVE_LIBUUID_H
+-    uuid_generate_random(*(uuid_t*)pguid);
+-
+-    // Change the byte order of the Data1, 2 and 3, since the uuid_generate_random
+-    // generates them with big endian while GUIDS need to have them in little endian.
+-    pguid->Data1 = SWAP32(pguid->Data1);
+-    pguid->Data2 = SWAP16(pguid->Data2);
+-    pguid->Data3 = SWAP16(pguid->Data3);
+-#elif HAVE_BSD_UUID_H
++#if HAVE_BSD_UUID_H
+     uuid_t uuid;
+     uint32_t status;
+     uuid_create(&uuid, &status);
+@@ -372,6 +364,14 @@ CoCreateGuid(OUT GUID * pguid)
+     // Encode the uuid with little endian.
+     uuid_enc_le(pguid, &uuid);
++#elif HAVE_LIBUUID_H
++    uuid_generate_random(*(uuid_t*)pguid);
++
++    // Change the byte order of the Data1, 2 and 3, since the uuid_generate_random
++    // generates them with big endian while GUIDS need to have them in little endian.
++    pguid->Data1 = SWAP32(pguid->Data1);
++    pguid->Data2 = SWAP16(pguid->Data2);
++    pguid->Data3 = SWAP16(pguid->Data3);
+ #else
+     #error Don't know how to generate UUID on this platform
+ #endif