Skip to content

Commit

Permalink
Workaround with pragma push and pop for NO_ERROR collison (#456) (#458)
Browse files Browse the repository at this point in the history
Co-authored-by: Lior Lustgarten <[email protected]>
Signed-off-by: Abrar Rahman Protyasha <[email protected]>
  • Loading branch information
aprotyas and lilustga authored Sep 21, 2021
1 parent ea93cda commit 4de3401
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions tf2/include/tf2/exceptions.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,13 @@
namespace tf2
{

enum class TF2Error : std::uint8_t
{
// This workaround prevents a collision with Windows.h
#if defined(_WIN32)
#pragma push_macro("NO_ERROR")
#undef NO_ERROR
#endif

enum class TF2Error : std::uint8_t {
NO_ERROR = 0,
LOOKUP_ERROR = 1,
CONNECTIVITY_ERROR = 2,
Expand All @@ -51,6 +56,10 @@ enum class TF2Error : std::uint8_t
TRANSFORM_ERROR = 6
};

#if defined(_WIN32)
#pragma pop_macro("NO_ERROR")
#endif

/** \brief A base class for all tf2 exceptions
* This inherits from ros::exception
* which inherits from std::runtime_exception
Expand Down

0 comments on commit 4de3401

Please sign in to comment.