-
Notifications
You must be signed in to change notification settings - Fork 81
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
Fixes for compiling in Windows #7
Changes from 6 commits
8fdf48f
58c8617
68bca4e
c451a4b
bd0035f
bb40954
cdf8ac9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -48,6 +48,17 @@ | |
|
||
namespace urdf{ | ||
|
||
//round is not defined in C++98 | ||
//So in Visual Studio <= 2012 is necessary to define it | ||
#ifdef _MSC_VER | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think that we should add a check of version on this. I guess that There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It seems There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I remember that I was developing this PR to compile a project depending on urdfdom in VS2012, so I think this is make sense. |
||
#if (_MSC_VER <= 1700) | ||
double round(double value) | ||
{ | ||
return (value >= 0.0f)?(floor(value + 0.5f)):(ceil(value - 0.5f)); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. instead of defining this, why not just add 0.5 to the arg of round and call floor() instead? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. they give different results:
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. good point, thanks! i guess we care about negative values :) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. :) |
||
} | ||
#endif | ||
#endif | ||
|
||
class Time | ||
{ | ||
public: | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<cmath>
is already included on line 53There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed the second one.