Skip to content

Commit

Permalink
Fix for issue 2656 (#2658)
Browse files Browse the repository at this point in the history
* Use fully qualified name Aws::Utils::UUID to resolve ambiguous symbol issue

Co-authored-by: Talby <[email protected]>
  • Loading branch information
yasminetalby and Talby authored Sep 12, 2023
1 parent 53ea0c4 commit 02b1605
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions src/aws-cpp-sdk-core/include/aws/core/utils/UUID.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,12 @@ namespace Aws
* Generates a UUID. It will always try to prefer a random implementation from the entropy source on the machine. If none, is available, it will
* fallback to the mac address and timestamp implementation.
*/
static UUID RandomUUID();
static Aws::Utils::UUID RandomUUID();

/**
* Generates a pseudo-random UUID.
*/
static UUID PseudoRandomUUID();
static Aws::Utils::UUID PseudoRandomUUID();

private:
unsigned char m_uuid[UUID_BINARY_SIZE];
Expand Down
14 changes: 7 additions & 7 deletions src/aws-cpp-sdk-core/source/utils/UUID.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ namespace Aws
}
}

UUID::UUID(const Aws::String& uuidToConvert)
Aws::Utils::UUID::UUID(const Aws::String& uuidToConvert)
{
//GUID has 2 characters per byte + 4 dashes = 36 bytes
assert(uuidToConvert.length() == UUID_STR_SIZE);
Expand All @@ -47,12 +47,12 @@ namespace Aws
memcpy(m_uuid, rawUuid.GetUnderlyingData(), rawUuid.GetLength());
}

UUID::UUID(const unsigned char toCopy[UUID_BINARY_SIZE])
Aws::Utils::UUID::UUID(const unsigned char toCopy[UUID_BINARY_SIZE])
{
memcpy(m_uuid, toCopy, sizeof(m_uuid));
}

UUID::operator Aws::String() const
Aws::Utils::UUID::operator Aws::String() const
{
Aws::String ss;
ss.reserve(UUID_STR_SIZE);
Expand All @@ -73,7 +73,7 @@ namespace Aws
return ss;
}

UUID UUID::RandomUUID()
Aws::Utils::UUID UUID::RandomUUID()
{
auto secureRandom = Crypto::CreateSecureRandomBytesImplementation();
assert(secureRandom);
Expand All @@ -88,7 +88,7 @@ namespace Aws
//https://tools.ietf.org/html/rfc4122#section-4.1.1
randomBytes[VARIANT_LOCATION] = (randomBytes[VARIANT_LOCATION] & VARIANT_MASK) | VARIANT;

return UUID(randomBytes);
return Aws::Utils::UUID(randomBytes);
}

#ifdef UINT64_MAX
Expand All @@ -109,7 +109,7 @@ namespace Aws
return static_cast<size_t>(std::hash<std::thread::id>{}(std::this_thread::get_id()) ^ threadRandomSeedGen());
}

UUID UUID::PseudoRandomUUID()
Aws::Utils::UUID UUID::PseudoRandomUUID()
{
static const thread_local size_t threadSeed = GetCurrentThreadRandomSeed();
static thread_local MTEngine gen(threadSeed);
Expand All @@ -127,7 +127,7 @@ namespace Aws
//https://tools.ietf.org/html/rfc4122#section-4.1.1
randomBytes[VARIANT_LOCATION] = (randomBytes[VARIANT_LOCATION] & VARIANT_MASK) | VARIANT;

return UUID(randomBytes);
return Aws::Utils::UUID(randomBytes);
}
}
}

0 comments on commit 02b1605

Please sign in to comment.