From:
[email protected]
Package: 3dwm
Severity: normal
Tags: patch
When building '3dwm' with gcc-3.4 I get the following error:
c++ -DHAVE_CONFIG_H -I. -I. -I../../include -I../../include/Celsius -Wall -Wp,-MD,.deps/Matrix3D.pp -c Matrix3D.cc -fPIC -DPIC -o .libs/Matrix3D.lo
In file included from ../../include/Celsius/Matrix3D.hh:41,
from Matrix3D.cc:36:
../../include/Celsius/Math.hh:50: error: `Math::tolerance' cannot appear in a constant-expression
../../include/Celsius/Math.hh:56: error: `Math::pi' cannot appear in a constant-expression
../../include/Celsius/Math.hh:57: error: `Math::pi' cannot appear in a constant-expression
make[4]: *** [Matrix3D.lo] Error 1
make[4]: Leaving directory `/3dwm-0.3.1/src/Celsius'
With the attached patch '3dwm' can be compiled using gcc-3.4.
Regards
Andreas Jochens
diff -urN ../tmp-orig/3dwm-0.3.1/include/Celsius/Math.hh ./include/Celsius/Math.hh
--- ../tmp-orig/3dwm-0.3.1/include/Celsius/Math.hh 2001-08-16 13:32:20.000000000 +0200
+++ ./include/Celsius/Math.hh 2004-08-13 09:22:59.803827561 +0200
@@ -47,14 +47,14 @@
/// Machine precision (@@@�Put some research into this!)
const static double tolerance = 1e-5;
- const static double epsilon = tolerance;
+ const static double epsilon = 1e-5;
// Value of pi
const static double pi = M_PI;
// Degree <-> radian conversion
- const static double radians_per_degree = pi / 180.;
- const static double degrees_per_radian = 180. / pi;
+ const static double radians_per_degree = M_PI / 180.;
+ const static double degrees_per_radian = 180. / M_PI;
static double degToRad(double deg) { return deg * radians_per_degree; }
static double radToDeg(double rad) { return rad * degrees_per_radian; } diff -urN ../tmp-orig/3dwm-0.3.1/include/Polhem/SolidCache.hh ./include/Polhem/SolidCache.hh
--- ../tmp-orig/3dwm-0.3.1/include/Polhem/SolidCache.hh 2004-0