summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMarkus Schwarzenberg <schwarzenberg@users.sourceforge.net>2007-03-01 09:43:25 +0000
committerschwarzenberg <schwarzenberg@users.sourceforge.net>2007-03-01 09:43:25 +0000
commitad8869da712554d4ba090e1998f22d6c7afca4b2 (patch)
tree9796bfbc1f2c072acf41f41bdc3238022d2db7ab /src
parentr14651@tres: ted | 2007-02-28 23:23:41 -0800 (diff)
downloadinkscape-ad8869da712554d4ba090e1998f22d6c7afca4b2.tar.gz
inkscape-ad8869da712554d4ba090e1998f22d6c7afca4b2.zip
commited Solaris 2.8 / gcc-3.2.3 fixes
(bzr r2485)
Diffstat (limited to 'src')
-rw-r--r--src/display/nr-filter-gaussian.cpp4
-rw-r--r--src/display/nr-filter.cpp2
-rw-r--r--src/display/pixblock-transform.cpp2
-rw-r--r--src/extension/internal/ps.cpp4
-rw-r--r--src/isinf.h15
-rw-r--r--src/isnan.h5
-rw-r--r--src/libcola/gradient_projection.cpp7
-rw-r--r--src/libvpsc/isnan.h57
-rw-r--r--src/print.cpp4
-rw-r--r--src/widgets/desktop-widget.cpp2
10 files changed, 41 insertions, 61 deletions
diff --git a/src/display/nr-filter-gaussian.cpp b/src/display/nr-filter-gaussian.cpp
index 7ebeebd88..42ab92808 100644
--- a/src/display/nr-filter-gaussian.cpp
+++ b/src/display/nr-filter-gaussian.cpp
@@ -19,7 +19,7 @@
#include <glib.h>
#include <limits>
-using std::isnormal;
+#include "isnormal.h"
#include "display/nr-filter-primitive.h"
#include "display/nr-filter-gaussian.h"
@@ -276,7 +276,7 @@ void filter2D_IIR(PT *dest, int dstr1, int dstr2, PT const *src, int sstr1, int
}
// Backward pass
IIRValue v[N+1][PC];
- calcTriggsSdikaInitialization(M, u, iplus, iplus, b[0], v);
+ calcTriggsSdikaInitialization<PC>(M, u, iplus, iplus, b[0], v);
dstimg -= dstr1;
for(unsigned int c=0; c<PC; c++) dstimg[c] = clip_round_cast<PT>(v[0][c]);
int c1=n1-1;
diff --git a/src/display/nr-filter.cpp b/src/display/nr-filter.cpp
index a720050c9..d2f459149 100644
--- a/src/display/nr-filter.cpp
+++ b/src/display/nr-filter.cpp
@@ -29,6 +29,8 @@
#include "libnr/nr-scale.h"
#include "svg/svg-length.h"
#include "sp-filter-units.h"
+#include "round.h"
+using Inkscape::round;
//#include "display/nr-arena-shape.h"
diff --git a/src/display/pixblock-transform.cpp b/src/display/pixblock-transform.cpp
index 7aa616eb3..2d5abc62c 100644
--- a/src/display/pixblock-transform.cpp
+++ b/src/display/pixblock-transform.cpp
@@ -13,6 +13,8 @@
#include <glib.h>
#include <cmath>
+#include "round.h"
+using Inkscape::round;
using std::floor;
#include "libnr/nr-pixblock.h"
diff --git a/src/extension/internal/ps.cpp b/src/extension/internal/ps.cpp
index a4eac8b67..8cf284536 100644
--- a/src/extension/internal/ps.cpp
+++ b/src/extension/internal/ps.cpp
@@ -70,6 +70,10 @@
#include <iostream>
#include <fstream>
+#ifdef SOLARIS_2_8
+#include <unistd.h>
+#endif
+
using namespace std;
namespace Inkscape {
diff --git a/src/isinf.h b/src/isinf.h
new file mode 100644
index 000000000..5893393f0
--- /dev/null
+++ b/src/isinf.h
@@ -0,0 +1,15 @@
+#ifndef __ISINF_H__
+#define __ISINF_H__
+
+/*
+ * Fix for missing std::isnormal with SOLARIS8/GCC3.2
+ */
+
+#if defined (SOLARIS_2_8) && __GNUC__ == 3 && __GNUC_MINOR__ == 2
+
+ #include <ieeefp.h>
+ #define isinf(x) ((fpclass(x) == FP_NINF) || (fpclass(x) == FP_PINF))
+
+#endif
+
+#endif /* __ISINF_H__ */
diff --git a/src/isnan.h b/src/isnan.h
index 1b4d10aab..a1755bdb9 100644
--- a/src/isnan.h
+++ b/src/isnan.h
@@ -32,6 +32,8 @@
# define isNaN(_a) (_isnan(_a)) /* Win32 definition */
#elif defined(isnan) || defined(__FreeBSD__) || defined(__osf__)
# define isNaN(_a) (isnan(_a)) /* GNU definition */
+#elif defined (SOLARIS_2_8) && __GNUC__ == 3 && __GNUC_MINOR__ == 2
+# define isNaN(_a) (isnan(_a)) /* GNU definition */
#else
# define isNaN(_a) (std::isnan(_a))
#endif
@@ -49,6 +51,9 @@
# define isFinite(_a) (isfinite(_a))
#elif defined(__osf__)
# define isFinite(_a) (finite(_a) && !isNaN(_a))
+#elif defined (SOLARIS_2_8) && __GNUC__ == 3 && __GNUC_MINOR__ == 2
+#include <ieeefp.h>
+#define isFinite(_a) (finite(_a) && !isNaN(_a))
#else
# define isFinite(_a) (std::isfinite(_a))
#endif
diff --git a/src/libcola/gradient_projection.cpp b/src/libcola/gradient_projection.cpp
index cec59c57a..78b141b3e 100644
--- a/src/libcola/gradient_projection.cpp
+++ b/src/libcola/gradient_projection.cpp
@@ -17,6 +17,9 @@
#include <libvpsc/constraint.h>
#include "gradient_projection.h"
#include <iostream>
+#include "isnan.h"
+#include "isinf.h"
+
using namespace std;
using namespace vpsc;
@@ -47,7 +50,7 @@ unsigned GradientProjection::solve(double * b) {
solver = setupVPSC();
//cerr << "in gradient projection: n=" << n << endl;
for (i=0;i<n;i++) {
- assert(!isnan(place[i]));
+ assert(!isNaN(place[i]));
assert(!isinf(place[i]));
vars[i]->desiredPosition=place[i];
}
@@ -95,7 +98,7 @@ unsigned GradientProjection::solve(double * b) {
// move to new unconstrained position
for (i=0; i<n; i++) {
place[i]-=alpha*g[i];
- assert(!isnan(place[i]));
+ assert(!isNaN(place[i]));
assert(!isinf(place[i]));
vars[i]->desiredPosition=place[i];
}
diff --git a/src/libvpsc/isnan.h b/src/libvpsc/isnan.h
deleted file mode 100644
index 388f9144b..000000000
--- a/src/libvpsc/isnan.h
+++ /dev/null
@@ -1,57 +0,0 @@
-#ifndef __ISNAN_H__
-#define __ISNAN_H__
-
-/*
- * Temporary fix for various misdefinitions of isnan().
- * isnan() is becoming undef'd in some .h files.
- * #include this last in your .cpp file to get it right.
- *
- * The problem is that isnan and isfinite are part of C99 but aren't part of
- * the C++ standard (which predates C99).
- *
- * Authors:
- * Inkscape groupies and obsessive-compulsives
- *
- * Copyright (C) 2004 authors
- *
- * Released under GNU LGPL, read the file 'COPYING' for more information
- *
- * 2005 modification hereby placed in public domain. Probably supercedes the 2004 copyright
- * for the code itself.
- */
-
-#include <math.h>
-/* You might try changing the above to <cmath> if you have problems.
- * Whether you use math.h or cmath, you may need to edit the .cpp file
- * and/or other .h files to use the same header file.
- */
-
-#if defined(__isnan)
-# define isNaN(_a) (__isnan(_a)) /* MacOSX/Darwin definition < 10.4 */
-#elif defined(WIN32) || defined(_isnan)
-# define isNaN(_a) (_isnan(_a)) /* Win32 definition */
-#elif defined(isnan) || defined(__FreeBSD__)
-# define isNaN(_a) (isnan(_a)) /* GNU definition */
-#else
-# define isNaN(_a) (std::isnan(_a))
-#endif
-/* If the above doesn't work, then try (a != a).
- * Also, please report a bug as per http://www.inkscape.org/report_bugs.php,
- * giving information about what platform and compiler version you're using.
- */
-
-
-#if defined(__isfinite)
-# define isFinite(_a) (__isfinite(_a)) /* MacOSX/Darwin definition < 10.4 */
-#elif defined(isfinite)
-# define isFinite(_a) (isfinite(_a))
-#else
-# define isFinite(_a) (std::isfinite(_a))
-#endif
-/* If the above doesn't work, then try (finite(_a) && !isNaN(_a)) or (!isNaN((_a) - (_a))).
- * Also, please report a bug as per http://www.inkscape.org/report_bugs.php,
- * giving information about what platform and compiler version you're using.
- */
-
-
-#endif /* __ISNAN_H__ */
diff --git a/src/print.cpp b/src/print.cpp
index 52a8d3c82..dad80d1c9 100644
--- a/src/print.cpp
+++ b/src/print.cpp
@@ -27,6 +27,10 @@
#include <gtk/gtkprintunixdialog.h>
#endif
+#ifdef SOLARIS_2_8
+#include <unistd.h>
+#endif
+
#if 0
# include <extension/internal/ps.h>
diff --git a/src/widgets/desktop-widget.cpp b/src/widgets/desktop-widget.cpp
index d7e5891c6..93b579adf 100644
--- a/src/widgets/desktop-widget.cpp
+++ b/src/widgets/desktop-widget.cpp
@@ -52,6 +52,8 @@
#include "sp-item.h"
#include "dialogs/swatches.h"
#include "conn-avoid-ref.h"
+#include "round.h"
+using Inkscape::round;
#ifdef WITH_INKBOARD
#endif