Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Work around Windows min/max bug. #21

Merged
merged 3 commits into from
Nov 19, 2020
Merged

Conversation

clalancette
Copy link

@clalancette clalancette commented Nov 17, 2020

The comments in the code explain why we need this.

Signed-off-by: Chris Lalancette clalancette@openrobotics.org

Some upcoming changes to pluginlib are going to cause us to #include <windows.h>, which is why this is now needed to build on Windows.

One other note: I believe that there is an alternative way to solve this, which is to use MSVC push_macro/pop_macro. That is, we'd do something like:

#ifdef _WIN32
#pragma push_macro("max")
#undef max
#endif

// Use std::numeric_limits<size_t>::max();

#ifdef _WIN32
#pragma pop_macro("max")
#endif

Both are kind of ugly, so I don't have a strong opinion one way or another.

The comments in the code explain why we need this.

Signed-off-by: Chris Lalancette <clalancette@openrobotics.org>
Copy link

@sloretz sloretz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

subjectively I like #undef max more than an empty macro, but I don't have any non-subjective reasons for choosing one over the other.

@clalancette
Copy link
Author

subjectively I like #undef max more than an empty macro, but I don't have any non-subjective reasons for choosing one over the other.

On balance, after looking at it more, I agree with you. I'm going to change to the other style and then run CI with that.

Signed-off-by: Chris Lalancette <clalancette@openrobotics.org>
@clalancette
Copy link
Author

clalancette commented Nov 18, 2020

CI:

  • Linux Build Status
  • Linux-aarch64 Build Status
  • macOS Build Status
  • Windows Build Status

urdf/src/model.cpp Outdated Show resolved Hide resolved
Signed-off-by: Chris Lalancette <clalancette@openrobotics.org>
@clalancette
Copy link
Author

New CI:

  • Linux Build Status
  • Linux-aarch64 Build Status
  • macOS Build Status
  • Windows Build Status

@sloretz
Copy link

sloretz commented Nov 18, 2020

FYI @clalancette windows CI looks like a java traceback, twice. 3rd attempt in progress: Build Status

@clalancette
Copy link
Author

Windows finally finished in this job: Build Status

With green CI, and approval, I'm going to go ahead and merge this. Thanks for the review!

@clalancette clalancette merged commit 4c90a78 into ros2 Nov 19, 2020
@delete-merged-branch delete-merged-branch bot deleted the use-rcpputils-filesystem branch November 19, 2020 13:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants