Skip to content

Commit

Permalink
Merge pull request #7148 from maloel/abs
Browse files Browse the repository at this point in the history
added 'using std::abs' in types.h to avoid Linux bug
  • Loading branch information
ev-mp authored Aug 24, 2020
2 parents 9849b5c + af72c64 commit ee2dfa6
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/types.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,11 @@ static const double r2d = 180 / pi;
template<typename T> T deg2rad(T val) { return T(val * d2r); }
template<typename T> T rad2deg(T val) { return T(val * r2d); }

// global abs() is only defined for int for some GCC impl on Linux, meaning we may
// get unwanted behavior without any warning whatsoever. Instead, we want to use the
// C++ version in std!
using std::abs;

#pragma warning(disable: 4250)

#ifdef ANDROID
Expand Down

0 comments on commit ee2dfa6

Please sign in to comment.