Skip to content

use std::fabs instead of std::abs for floating variables

Johnny Jazeix requested to merge fix_bsd_compile_abs_float into master

I don't have a freebsd to test but this should fix: https://build.kde.org/job/Extragear/job/ktorrent/job/kf5-qt5%20FreeBSDQt5.15/49/

/usr/home/jenkins/workspace/Extragear/ktorrent/kf5-qt5 FreeBSDQt5.15/plugins/bwscheduler/schedulegraphicsitem.cpp:359:13: error: call to 'abs' is ambiguous
           if (std::abs(p.y() - y) < 4)
               ^~~~~~~~
   /usr/include/stdlib.h:87:6: note: candidate function
   int      abs(int) __pure2;
            ^
   /usr/include/c++/v1/stdlib.h:111:44: note: candidate function
   inline _LIBCPP_INLINE_VISIBILITY long      abs(     long __x) _NOEXCEPT {return  labs(__x);}
                                              ^
   /usr/include/c++/v1/stdlib.h:113:44: note: candidate function
   inline _LIBCPP_INLINE_VISIBILITY long long abs(long long __x) _NOEXCEPT {return llabs(__x);}
                                              ^

Merge request reports

Loading