Version: koffice-1.6.1 (using KDE KDE 3.5.5) Installed from: Compiled From Sources Compiler: gcc 3.4.6 OS: Solaris I get this compile error on Solaris: KDChartAxesPainter.cpp: In static member function `static QString KDChartAxesPainter::applyLabelsFormat(double, int, int, double, int&, KDChartEnums::NumberNotation, const QString&, const QString&, const QString&, const QString&, int, const QChar&, bool)': KDChartAxesPainter.cpp:3728: error: `trunc' was not declared in this scope KDChartAxesPainter.cpp:3728: warning: unused variable 'trunc' trunc is a C99 function, but the C library on Solaris is not C99 :-(
I'm also seeing this - same version, Solaris 8, gcc 4.0.3.
Only on version 1.6: trunk doesn't use trunc(). Who'da thunk? :-)
SVN commit 615038 by ingwa: Fix bug 138148: Compile error on Solaris 8 - kchart/kdchart/KDChartAxesPainter.cpp uses trunc, which is not available * kdchart/KDChartAxesPainter.cpp: trunc(): Define it. We could make a complicated workaround using #if's and stuff, but this is the simplest solution, i.e. to simply define our own trunc(). BUG: 138148 M +10 -0 ChangeLog M +16 -0 kdchart/KDChartAxesPainter.cpp --- branches/koffice/1.6/koffice/kchart/ChangeLog #615037:615038 @@ -1,3 +1,13 @@ +2006-12-19 Inge Wallin <inge@lysator.liu.se> + + Fix bug 138148: Compile error on Solaris 8 - + kchart/kdchart/KDChartAxesPainter.cpp uses trunc, which is not + available + + * kdchart/KDChartAxesPainter.cpp: trunc(): Define it, since some + OSes, like Solaris, doesn't have it. We could make a complicated + workaround, but this is the simplest solution. + 2006-11-07 Inge Wallin <inge@lysator.liu.se> Start on bug 134194: Impossible to change the data range. --- branches/koffice/1.6/koffice/kchart/kdchart/KDChartAxesPainter.cpp #615037:615038 @@ -3701,10 +3701,26 @@ return sVal; } +#if 0 + #if defined ( Q_WS_WIN) #define trunc(x) ((int)(x)) #endif +#else + +// Ugly hack because Solaris (among others?) doesn't have trunc(), +// since the libs are not C99. I could do a complex #if expression, +// but instead I will just define trunc() here. + +double trunc(double x) +{ + return x >= 0.0 ? floor(x) : -floor(-x); +} + +#endif + + QString KDChartAxesPainter::applyLabelsFormat( const double nVal_, int divPow10, int behindComma,
You need to log in before you can comment on or make changes to this bug.