Skip to content

Commit 326d423

Browse files
committed
Basic: convert UUIDs to uppercase
Darwin does not follow the ITEF specification (RFC 4122) and emits the UUID in uppercase and expects the emission to be uppercase. Convert to upper case when translating the UUID from the binary representation to the string representation. This repairs the SIL parsing tests on Windows.
1 parent a9c1ea0 commit 326d423

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

lib/Basic/UUID.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
#define NOMINMAX
2424
#include <objbase.h>
2525
#include <string>
26+
#include <algorithm>
2627
#else
2728
#include <uuid/uuid.h>
2829
#endif
@@ -94,6 +95,7 @@ void swift::UUID::toString(llvm::SmallVectorImpl<char> &out) const {
9495

9596
char* signedStr = reinterpret_cast<char*>(str);
9697
memcpy(out.data(), signedStr, StringBufferSize);
98+
std::transform(std::begin(out), std::end(out), std::begin(out), toupper);
9799
#else
98100
uuid_unparse_upper(Value, out.data());
99101
#endif

0 commit comments

Comments
 (0)