diff options
author | Janne Anttila <janne.anttila@digia.com> | 2012-06-19 09:14:31 +0300 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-06-20 01:24:38 +0200 |
commit | df679c7d7c8f61f653bd4dfdd22231a3811ceeb3 (patch) | |
tree | d89b457e64c7d2a757c123442f0712873ea534b2 /src/location | |
parent | aac07e7c3d5de028a823d40817f51ae8b4462d34 (diff) | |
download | qtlocation-df679c7d7c8f61f653bd4dfdd22231a3811ceeb3.tar.gz |
Fix qtlocation build for WEC7.
Apparently math.h in WEC7 does not define M_PI used by qtlocation.
Added the requiresd define the necessary files.
qSqrt returns qreal and it is defined to 'float' on some configurations
and to 'double' in other configurations. In those configirations where
it is defined to float, no suitable overload for division is found.
Added explicit cast for qSqrt return value to double to fix the build.
Change-Id: I734fab66abfd4ce95e02ec83e373f0eacd87bdef
Reviewed-by: Andreas Holzammer <andreas.holzammer@kdab.com>
Reviewed-by: Björn Breitmeyer <bjoern.breitmeyer@kdab.com>
Reviewed-by: Aaron McCarthy <aaron.mccarthy@nokia.com>
Diffstat (limited to 'src/location')
-rw-r--r-- | src/location/maps/qdoublevector2d.cpp | 2 | ||||
-rw-r--r-- | src/location/maps/qdoublevector3d.cpp | 2 | ||||
-rw-r--r-- | src/location/maps/qgeoprojection_p.h | 4 |
3 files changed, 6 insertions, 2 deletions
diff --git a/src/location/maps/qdoublevector2d.cpp b/src/location/maps/qdoublevector2d.cpp index 0b5f3450..2a73ba0e 100644 --- a/src/location/maps/qdoublevector2d.cpp +++ b/src/location/maps/qdoublevector2d.cpp @@ -70,7 +70,7 @@ QDoubleVector2D QDoubleVector2D::normalized() const if (qFuzzyIsNull(len - 1.0)) return *this; else if (!qFuzzyIsNull(len)) - return *this / qSqrt(len); + return *this / (double)qSqrt(len); else return QDoubleVector2D(); } diff --git a/src/location/maps/qdoublevector3d.cpp b/src/location/maps/qdoublevector3d.cpp index 3f9a99f9..49de5ace 100644 --- a/src/location/maps/qdoublevector3d.cpp +++ b/src/location/maps/qdoublevector3d.cpp @@ -69,7 +69,7 @@ QDoubleVector3D QDoubleVector3D::normalized() const if (qFuzzyIsNull(len - 1.0)) return *this; else if (!qFuzzyIsNull(len)) - return *this / qSqrt(len); + return *this / (double)qSqrt(len); else return QDoubleVector3D(); } diff --git a/src/location/maps/qgeoprojection_p.h b/src/location/maps/qgeoprojection_p.h index fbdfd825..76f61f30 100644 --- a/src/location/maps/qgeoprojection_p.h +++ b/src/location/maps/qgeoprojection_p.h @@ -52,6 +52,10 @@ // We mean it. // +#ifndef M_PI +#define M_PI (3.14159265358979323846) +#endif + #include "qglobal.h" #include "QtLocation/qlocationglobal.h" |