Skip to content

Commit

Permalink
remove temporary workaround on windows that undefined getmessage to a…
Browse files Browse the repository at this point in the history
…void naming conflict (#2589)
  • Loading branch information
jmklix authored Aug 29, 2023
1 parent c26bae4 commit fc871fa
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 31 deletions.
17 changes: 10 additions & 7 deletions src/aws-cpp-sdk-core/include/aws/core/client/AWSError.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,6 @@
#include <aws/core/utils/json/JsonSerializer.h>
#include <aws/core/utils/StringUtils.h>

// TODO: temporary fix for naming conflicts on Windows.
#ifdef _WIN32
#ifdef GetMessage
#undef GetMessage
#endif
#endif

namespace Aws
{
namespace Client
Expand Down Expand Up @@ -114,7 +107,17 @@ namespace Aws
/**
* Gets the error message.
*/
#ifdef _WIN32
#pragma push_macro("GetMessage")
#undef GetMessage
inline const Aws::String& GetMessage() const { return m_message; }
inline const Aws::String& GetMessageW() const { return GetMessage(); }
inline const Aws::String& GetMessageA() const { return GetMessage(); }

#pragma pop_macro("GetMessage")
#else
inline const Aws::String& GetMessage() const { return m_message; }
#endif //#ifdef _WIN32
/**
* Sets the error message
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@

// TODO: temporary fix for naming conflicts on Windows.
#ifdef _WIN32
#ifdef GetMessage
#undef GetMessage
#endif
#ifdef GetObject
#undef GetObject
#endif
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,6 @@ using namespace Aws::KMS::Model;
using namespace Aws::Client;
using namespace Aws::S3Encryption;

// TODO: temporary fix for naming conflicts on Windows.
#ifdef _WIN32
#ifdef GetMessage
#undef GetMessage
#endif
#endif

namespace Aws
{
namespace S3Encryption
Expand Down
7 changes: 0 additions & 7 deletions tests/aws-cpp-sdk-core-tests/aws/client/AWSClientTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,6 @@
#include <thread>
#include <aws/core/utils/logging/LogMacros.h>

// TODO: temporary fix for naming conflicts for Windows.
#ifdef _WIN32
#ifdef GetMessage
#undef GetMessage
#endif
#endif

using namespace Aws;
using namespace Aws::Client;
using namespace Aws::Http;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,6 @@ using namespace Aws::MediaStoreData::Model;

// TODO: temporary fix for naming conflicts on Windows.
#ifdef _WIN32
#ifdef GetMessage
#undef GetMessage
#endif
#ifdef GetObject
#undef GetObject
#endif
Expand Down
4 changes: 0 additions & 4 deletions tests/testing-resources/include/aws/testing/AwsTestHelpers.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,6 @@
#include <aws/core/VersionConfig.h>
#include <aws/core/utils/DateTime.h>

#if defined(GetMessage)
#undef GetMessage
#endif

#define AWS_ASSERT_SUCCESS(awsCppSdkOutcome) \
ASSERT_TRUE(awsCppSdkOutcome.IsSuccess()) << "Error details: " << awsCppSdkOutcome.GetError() \
<< "\nNow timestamp: " << Aws::Utils::DateTime::Now().ToGmtString(Aws::Utils::DateFormat::ISO_8601_BASIC)
Expand Down

0 comments on commit fc871fa

Please sign in to comment.