From: mjwybrow Date: Sun, 22 Jun 2008 03:49:00 +0000 (+0000) Subject: * src/2geom/isnan.h, src/libcola/cola.cpp, src/style.cpp, src/seltrans.cpp, X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=f5b6a31c52761f10431371b96c6a8db0970edc47;p=inkscape.git * src/2geom/isnan.h, src/libcola/cola.cpp, src/style.cpp, src/seltrans.cpp, src/libcola/gradient_projection.cpp, src/libvpsc/generate-constraints.cpp, src/libnr/nr-types.cpp, src/libnr/nr-point-fns-test.cpp, src/isnan.h, src/libnr/nr-point-fns.cpp, src/libnr/in-svg-plane-test.cpp, src/doxygen-main.cpp, src/display/nr-filter-composite.cpp, src/display/nr-filter-merge.cpp, src/display/nr-filter-gaussian.cpp, src/display/bezier-utils.cpp, src/Makefile_insert, src/eraser-context.cpp, src/dyna-draw-context.cpp, src/tweak-context.cpp, src/sp-namedview.cpp, src/libnr/in-svg-plane-test.h, src/libnr/nr-point-fns-test.h, src/mod360-test.h, src/CMakeLists.txt, src/2geom/linear.h: Properly fix the conflicting isnan.h problem: 1) Update src/2geom/isnan.h to match newest Inkscape src/isnana.h (Also commited this change to lib2geom project repository) 2) Remove Inkscape's src/isnan.h 3) Update all files to include src/2geom/isnan.h instead of src/isnan.h --- diff --git a/src/2geom/isnan.h b/src/2geom/isnan.h index 96a70f6dc..6b94daa6e 100644 --- a/src/2geom/isnan.h +++ b/src/2geom/isnan.h @@ -16,11 +16,11 @@ * * Released under GNU GPL, read the file 'COPYING' for more information * - * 2005 modification hereby placed in public domain. Probably supercedes the 2004 copyright - * for the code itself. + * 2005 modification hereby placed in public domain. Probably supercedes + * the 2004 copyright for the code itself. */ -#include +#include /* You might try changing the above to 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. @@ -32,7 +32,9 @@ # define IS_NAN(_a) (__isnan(_a)) /* MacOSX/Darwin definition < 10.4 */ #elif defined(WIN32) || defined(_isnan) # define IS_NAN(_a) (_isnan(_a)) /* Win32 definition */ -#elif defined(isnan) || defined(__FreeBSD__) +#elif defined(isnan) || defined(__FreeBSD__) || defined(__osf__) +# define IS_NAN(_a) (isnan(_a)) /* GNU definition */ +#elif defined (SOLARIS_2_8) && __GNUC__ == 3 && __GNUC_MINOR__ == 2 # define IS_NAN(_a) (isnan(_a)) /* GNU definition */ #else # define IS_NAN(_a) (std::isnan(_a)) @@ -47,12 +49,20 @@ # define IS_FINITE(_a) (__isfinite(_a)) #elif defined(__APPLE__) && __GNUC__ == 3 # define IS_FINITE(_a) (__isfinite(_a)) /* MacOSX/Darwin definition < 10.4 */ +#elif defined(__sgi) +# define IS_FINITE(_a) (_isfinite(_a)) #elif defined(isfinite) # define IS_FINITE(_a) (isfinite(_a)) +#elif defined(__osf__) +# define IS_FINITE(_a) (finite(_a) && !IS_NAN(_a)) +#elif defined (SOLARIS_2_8) && __GNUC__ == 3 && __GNUC_MINOR__ == 2 +#include +#define IS_FINITE(_a) (finite(_a) && !IS_NAN(_a)) #else # define IS_FINITE(_a) (std::isfinite(_a)) #endif -/* If the above doesn't work, then try (finite(_a) && !isNaN(_a)) or (!isNaN((_a) - (_a))). +/* If the above doesn't work, then try (finite(_a) && !IS_NAN(_a)) or + * (!IS_NAN((_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. */ diff --git a/src/2geom/linear.h b/src/2geom/linear.h index 93cbc1b04..271e87be4 100644 --- a/src/2geom/linear.h +++ b/src/2geom/linear.h @@ -33,8 +33,8 @@ #ifndef SEEN_LINEAR_H #define SEEN_LINEAR_H -#include "isnan.h" #include "interval.h" +#include "isnan.h" namespace Geom{ diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 4d6367995..e1f36cd79 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -349,7 +349,6 @@ inkscape_version.h.mingw interface.cpp interface.h isinf.h -isnan.h isnormal.h jabber_whiteboard knot.cpp diff --git a/src/Makefile_insert b/src/Makefile_insert index 786322574..033d27810 100644 --- a/src/Makefile_insert +++ b/src/Makefile_insert @@ -92,7 +92,7 @@ libinkpre_a_SOURCES = \ inkscape-stock.cpp inkscape-stock.h\ inkscape.cpp inkscape.h inkscape-private.h \ interface.cpp interface.h \ - isnan.h isinf.h \ + isinf.h \ isnormal.h \ knot-enums.h \ knot-holder-entity.h knot-holder-entity.cpp \ diff --git a/src/display/bezier-utils.cpp b/src/display/bezier-utils.cpp index b01e31b14..434e7169e 100644 --- a/src/display/bezier-utils.cpp +++ b/src/display/bezier-utils.cpp @@ -39,7 +39,7 @@ #include "bezier-utils.h" #include -#include "isnan.h" +#include "2geom/isnan.h" typedef NR::Point BezierCurve[]; diff --git a/src/display/nr-filter-composite.cpp b/src/display/nr-filter-composite.cpp index 02a195bb0..a1a488674 100644 --- a/src/display/nr-filter-composite.cpp +++ b/src/display/nr-filter-composite.cpp @@ -11,7 +11,7 @@ #include -#include "isnan.h" +#include "2geom/isnan.h" #include "sp-fecomposite.h" #include "display/nr-filter-composite.h" #include "display/nr-filter-pixops.h" diff --git a/src/display/nr-filter-gaussian.cpp b/src/display/nr-filter-gaussian.cpp index 311333247..76b541ace 100644 --- a/src/display/nr-filter-gaussian.cpp +++ b/src/display/nr-filter-gaussian.cpp @@ -20,7 +20,7 @@ #include #include -#include "isnan.h" +#include "2geom/isnan.h" #include "display/nr-filter-primitive.h" #include "display/nr-filter-gaussian.h" diff --git a/src/display/nr-filter-merge.cpp b/src/display/nr-filter-merge.cpp index 977d4fbf8..1632a7a82 100644 --- a/src/display/nr-filter-merge.cpp +++ b/src/display/nr-filter-merge.cpp @@ -12,7 +12,7 @@ #include #include -#include "isnan.h" +#include "2geom/isnan.h" #include "sp-femerge.h" #include "display/nr-filter-merge.h" #include "display/nr-filter-pixops.h" diff --git a/src/doxygen-main.cpp b/src/doxygen-main.cpp index ae1e1de96..035d83a14 100644 --- a/src/doxygen-main.cpp +++ b/src/doxygen-main.cpp @@ -192,7 +192,7 @@ /** \page Rendering Rendering Related Classes and Files * * SPColor [\ref color.cpp, \ref color.h, \ref color-rgba.h] - * [\ref geom.cpp] [\ref isnan.h] [\ref mod360.cpp] + * [\ref geom.cpp] [\ref mod360.cpp] */ /** \page OtherServices Classes and Files From Other Services * [\ref inkview.cpp, \ref slideshow.cpp] [\ref sp-animation.cpp] diff --git a/src/dyna-draw-context.cpp b/src/dyna-draw-context.cpp index cd3a9158a..18ebf2b06 100644 --- a/src/dyna-draw-context.cpp +++ b/src/dyna-draw-context.cpp @@ -65,7 +65,7 @@ #include "display/canvas-bpath.h" #include "display/canvas-arena.h" #include "livarot/Shape.h" -#include "isnan.h" +#include "2geom/isnan.h" #include "dyna-draw-context.h" diff --git a/src/eraser-context.cpp b/src/eraser-context.cpp index 36cfb0d15..931901808 100644 --- a/src/eraser-context.cpp +++ b/src/eraser-context.cpp @@ -66,7 +66,7 @@ #include "display/canvas-bpath.h" #include "display/canvas-arena.h" #include "livarot/Shape.h" -#include "isnan.h" +#include "2geom/isnan.h" #include "eraser-context.h" diff --git a/src/isnan.h b/src/isnan.h deleted file mode 100644 index 57c221fce..000000000 --- a/src/isnan.h +++ /dev/null @@ -1,70 +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 GPL, read the file 'COPYING' for more information - * - * 2005 modification hereby placed in public domain. Probably supercedes the 2004 copyright - * for the code itself. - */ - -#include -/* You might try changing the above to 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 IS_NAN(_a) (__isnan(_a)) -#elif defined(__APPLE__) && __GNUC__ == 3 -# define IS_NAN(_a) (__isnan(_a)) /* MacOSX/Darwin definition < 10.4 */ -#elif defined(WIN32) || defined(_isnan) -# define IS_NAN(_a) (_isnan(_a)) /* Win32 definition */ -#elif defined(isnan) || defined(__FreeBSD__) || defined(__osf__) -# define IS_NAN(_a) (isnan(_a)) /* GNU definition */ -#elif defined (SOLARIS_2_8) && __GNUC__ == 3 && __GNUC_MINOR__ == 2 -# define IS_NAN(_a) (isnan(_a)) /* GNU definition */ -#else -# define IS_NAN(_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 IS_FINITE(_a) (__isfinite(_a)) -#elif defined(__APPLE__) && __GNUC__ == 3 -# define IS_FINITE(_a) (__isfinite(_a)) /* MacOSX/Darwin definition < 10.4 */ -#elif defined(__sgi) -# define IS_FINITE(_a) (_isfinite(_a)) -#elif defined(isfinite) -# define IS_FINITE(_a) (isfinite(_a)) -#elif defined(__osf__) -# define IS_FINITE(_a) (finite(_a) && !IS_NAN(_a)) -#elif defined (SOLARIS_2_8) && __GNUC__ == 3 && __GNUC_MINOR__ == 2 -#include -#define IS_FINITE(_a) (finite(_a) && !IS_NAN(_a)) -#else -# define IS_FINITE(_a) (std::isfinite(_a)) -#endif -/* If the above doesn't work, then try (finite(_a) && !IS_NAN(_a)) or (!IS_NAN((_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/libcola/cola.cpp b/src/libcola/cola.cpp index 2119ea981..2a3b525a7 100644 --- a/src/libcola/cola.cpp +++ b/src/libcola/cola.cpp @@ -2,7 +2,7 @@ #include "conjugate_gradient.h" #include "straightener.h" #include "shortest_paths.h" -#include "isnan.h" +#include "2geom/isnan.h" namespace cola { diff --git a/src/libcola/gradient_projection.cpp b/src/libcola/gradient_projection.cpp index 237cb94af..fb8702ec7 100644 --- a/src/libcola/gradient_projection.cpp +++ b/src/libcola/gradient_projection.cpp @@ -17,7 +17,7 @@ #include #include "gradient_projection.h" #include -#include "isnan.h" +#include "2geom/isnan.h" #include "isinf.h" #include diff --git a/src/libnr/in-svg-plane-test.cpp b/src/libnr/in-svg-plane-test.cpp index 138812655..061333cbb 100644 --- a/src/libnr/in-svg-plane-test.cpp +++ b/src/libnr/in-svg-plane-test.cpp @@ -3,7 +3,7 @@ #include "libnr/in-svg-plane.h" #include "utest/utest.h" -#include "isnan.h" +#include "2geom/isnan.h" int main(int argc, char *argv[]) { diff --git a/src/libnr/in-svg-plane-test.h b/src/libnr/in-svg-plane-test.h index ced9f978c..304182fed 100644 --- a/src/libnr/in-svg-plane-test.h +++ b/src/libnr/in-svg-plane-test.h @@ -4,7 +4,7 @@ #include #include "libnr/in-svg-plane.h" -#include "isnan.h" +#include "2geom/isnan.h" class InSvgPlaneTest : public CxxTest::TestSuite { diff --git a/src/libnr/nr-point-fns-test.cpp b/src/libnr/nr-point-fns-test.cpp index 00a704b59..312055fee 100644 --- a/src/libnr/nr-point-fns-test.cpp +++ b/src/libnr/nr-point-fns-test.cpp @@ -5,7 +5,7 @@ #include "utest/utest.h" #include "libnr/nr-point-fns.h" -#include "isnan.h" +#include "2geom/isnan.h" using NR::Point; diff --git a/src/libnr/nr-point-fns-test.h b/src/libnr/nr-point-fns-test.h index a94ef1b73..bd6605802 100644 --- a/src/libnr/nr-point-fns-test.h +++ b/src/libnr/nr-point-fns-test.h @@ -7,7 +7,7 @@ #include #include "libnr/nr-point-fns.h" -#include "isnan.h" +#include "2geom/isnan.h" using NR::Point; diff --git a/src/libnr/nr-point-fns.cpp b/src/libnr/nr-point-fns.cpp index f73f71e3b..5082c3a10 100644 --- a/src/libnr/nr-point-fns.cpp +++ b/src/libnr/nr-point-fns.cpp @@ -1,5 +1,5 @@ #include -#include +#include <2geom/isnan.h> using NR::Point; diff --git a/src/libnr/nr-types.cpp b/src/libnr/nr-types.cpp index a4e16d127..4da711cc0 100644 --- a/src/libnr/nr-types.cpp +++ b/src/libnr/nr-types.cpp @@ -4,7 +4,7 @@ #include -#include "isnan.h" //temporary fix for isnan() +#include "2geom/isnan.h" /** Scales this vector to make it a unit vector (within rounding error). * diff --git a/src/libvpsc/generate-constraints.cpp b/src/libvpsc/generate-constraints.cpp index f3bc65eed..c57966e26 100644 --- a/src/libvpsc/generate-constraints.cpp +++ b/src/libvpsc/generate-constraints.cpp @@ -16,7 +16,7 @@ #include "generate-constraints.h" #include "constraint.h" -#include "isnan.h" /* Include last */ +#include "2geom/isnan.h" /* Include last */ using std::set; using std::vector; diff --git a/src/mod360-test.h b/src/mod360-test.h index 79627571f..2d65beb92 100644 --- a/src/mod360-test.h +++ b/src/mod360-test.h @@ -4,7 +4,7 @@ #include -#include +#include "2geom/isnan.h" #include "mod360.h" diff --git a/src/seltrans.cpp b/src/seltrans.cpp index 3d5c19b8c..a3e0c9f0b 100644 --- a/src/seltrans.cpp +++ b/src/seltrans.cpp @@ -52,7 +52,6 @@ #include "2geom/angle.h" #include "display/snap-indicator.h" -#include "isnan.h" //temp fix. make sure included last static void sp_remove_handles(SPKnot *knot[], gint num); diff --git a/src/sp-namedview.cpp b/src/sp-namedview.cpp index 54e84927a..7caa9407c 100644 --- a/src/sp-namedview.cpp +++ b/src/sp-namedview.cpp @@ -34,7 +34,6 @@ #include "desktop.h" #include "conn-avoid-ref.h" // for defaultConnSpacing. -#include "isnan.h" //temp fix for isnan(). include last #define DEFAULTTOLERANCE 0.4 #define DEFAULTGRIDCOLOR 0x3f3fff25 diff --git a/src/style.cpp b/src/style.cpp index a67b86167..766f5a7fb 100644 --- a/src/style.cpp +++ b/src/style.cpp @@ -42,7 +42,7 @@ #include "svg/css-ostringstream.h" #include "xml/repr.h" #include "unit-constants.h" -#include "isnan.h" +#include "2geom/isnan.h" #include "macros.h" #include "sp-filter-reference.h" diff --git a/src/tweak-context.cpp b/src/tweak-context.cpp index 509194612..923a219bc 100644 --- a/src/tweak-context.cpp +++ b/src/tweak-context.cpp @@ -69,7 +69,7 @@ #include "display/canvas-arena.h" #include "display/curve.h" #include "livarot/Shape.h" -#include "isnan.h" +#include "2geom/isnan.h" #include "prefs-utils.h" #include "style.h" #include "box3d.h"