Skip to content
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions urdf/src/model.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,15 @@
#include <utility>
#include <vector>

// Windows has preprocessor defines for "min" and "max", which conflict with
// several things (one of them being std::numeric_limits<T>::max()). Since
// we know we aren't going to use those macros, we save them off at the top of
// the file (with "pragma push_macro"), use whatever variants of "min" and "max"
// we need, and the restore the macros at the end of the file (with "pragma pop_macro")
#ifdef _WIN32
#pragma push_macro("max")
Comment thread
clalancette marked this conversation as resolved.
Outdated
#undef max
#endif

namespace urdf
{
Expand Down Expand Up @@ -160,3 +169,7 @@ bool Model::initString(const std::string & data)
return true;
}
} // namespace urdf

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