]> sigrok.org Git - pulseview.git/commitdiff
Fix a build issue with std::roundf() on Android.
authorUwe Hermann <redacted>
Wed, 10 May 2017 14:50:46 +0000 (16:50 +0200)
committerUwe Hermann <redacted>
Thu, 11 May 2017 20:59:18 +0000 (22:59 +0200)
Apparently std::roundf() doesn't exist there, but plain roundf()
from <cmath> does.

This closes bug #945.

pv/view/timemarker.cpp

index eaa03b942294e62c4500f7b59bdbccb1a4b3ef8d..853f7c02675e0b594606e96eff8574734fcb2fff 100644 (file)
@@ -74,7 +74,8 @@ void TimeMarker::set_time(const pv::util::Timestamp& time)
 
 float TimeMarker::get_x() const
 {
-       return std::roundf(((time_ - view_.offset()) / view_.scale()).convert_to<float>()) + 0.5f;
+       // Use roundf() from cmath, std::roundf() causes Android issues (see #945).
+       return roundf(((time_ - view_.offset()) / view_.scale()).convert_to<float>()) + 0.5f;
 }
 
 QPoint TimeMarker::point(const QRect &rect) const