~ubuntu-branches/ubuntu/lucid/inkscape/lucid

« back to all changes in this revision

Viewing changes to src/2geom/isnan.h

  • Committer: Bazaar Package Importer
  • Author(s): Kees Cook, Ted Gould, Kees Cook
  • Date: 2009-06-24 14:00:43 UTC
  • mfrom: (1.1.8 upstream)
  • Revision ID: james.westby@ubuntu.com-20090624140043-07stp20mry48hqup
Tags: 0.47~pre0-0ubuntu1
* New upstream release

[ Ted Gould ]
* debian/control: Adding libgsl0 and removing version specifics on boost

[ Kees Cook ]
* debian/watch: updated to run uupdate and mangle pre-release versions.
* Dropped patches that have been taken upstream:
  - 01_mips
  - 02-poppler-0.8.3
  - 03-chinese-inkscape
  - 05_fix_latex_patch
  - 06_gcc-4.4
  - 07_cdr2svg
  - 08_skip-bad-utf-on-pdf-import
  - 09_gtk-clist
  - 10_belarussian
  - 11_libpng
  - 12_desktop
  - 13_slider
  - 100_svg_import_improvements
  - 102_sp_pattern_painter_free
  - 103_bitmap_type_print

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#ifndef __ISNAN_H__
2
 
#define __ISNAN_H__
 
1
/**
 
2
 * \file
 
3
 * \brief  \todo brief description
 
4
 *
 
5
 * Authors:
 
6
 *      ? <?@?.?>
 
7
 * 
 
8
 * Copyright ?-?  authors
 
9
 *
 
10
 * This library is free software; you can redistribute it and/or
 
11
 * modify it either under the terms of the GNU Lesser General Public
 
12
 * License version 2.1 as published by the Free Software Foundation
 
13
 * (the "LGPL") or, at your option, under the terms of the Mozilla
 
14
 * Public License Version 1.1 (the "MPL"). If you do not alter this
 
15
 * notice, a recipient may use your version of this file under either
 
16
 * the MPL or the LGPL.
 
17
 *
 
18
 * You should have received a copy of the LGPL along with this library
 
19
 * in the file COPYING-LGPL-2.1; if not, write to the Free Software
 
20
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 
21
 * You should have received a copy of the MPL along with this library
 
22
 * in the file COPYING-MPL-1.1
 
23
 *
 
24
 * The contents of this file are subject to the Mozilla Public License
 
25
 * Version 1.1 (the "License"); you may not use this file except in
 
26
 * compliance with the License. You may obtain a copy of the License at
 
27
 * http://www.mozilla.org/MPL/
 
28
 *
 
29
 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY
 
30
 * OF ANY KIND, either express or implied. See the LGPL or the MPL for
 
31
 * the specific language governing rights and limitations.
 
32
 *
 
33
 */
 
34
 
 
35
#ifndef _2GEOM_ISNAN_H__
 
36
#define _2GEOM_ISNAN_H__
3
37
 
4
38
/*
5
39
 * Temporary fix for various misdefinitions of isnan().
16
50
 *
17
51
 * Released under GNU GPL, read the file 'COPYING' for more information
18
52
 *
19
 
 * 2005 modification hereby placed in public domain.  Probably supercedes the 2004 copyright
20
 
 * for the code itself.
 
53
 * 2005 modification hereby placed in public domain.  Probably supercedes 
 
54
 * the 2004 copyright for the code itself.
21
55
 */
22
56
 
23
 
#include <cmath>
 
57
#include <math.h>
24
58
/* You might try changing the above to <cmath> if you have problems.
25
59
 * Whether you use math.h or cmath, you may need to edit the .cpp file
26
60
 * and/or other .h files to use the same header file.
27
61
 */
28
62
 
29
63
#if defined(__isnan)
30
 
# define is_nan(_a) (__isnan(_a))
 
64
# define IS_NAN(_a) (__isnan(_a))
31
65
#elif defined(__APPLE__) && __GNUC__ == 3
32
 
# define is_nan(_a) (__isnan(_a))       /* MacOSX/Darwin definition < 10.4 */
 
66
# define IS_NAN(_a) (__isnan(_a))       /* MacOSX/Darwin definition < 10.4 */
33
67
#elif defined(WIN32) || defined(_isnan)
34
 
# define is_nan(_a) (_isnan(_a))        /* Win32 definition */
35
 
#elif defined(isnan) || defined(__FreeBSD__)
36
 
# define is_nan(_a) (isnan(_a))         /* GNU definition */
 
68
# define IS_NAN(_a) (_isnan(_a))        /* Win32 definition */
 
69
#elif defined(isnan) || defined(__FreeBSD__) || defined(__osf__)
 
70
# define IS_NAN(_a) (isnan(_a))         /* GNU definition */
 
71
#elif defined (SOLARIS_2_8) && __GNUC__ == 3 && __GNUC_MINOR__ == 2
 
72
# define IS_NAN(_a) (isnan(_a))         /* GNU definition */
37
73
#else
38
 
# define is_nan(_a) (std::isnan(_a))
 
74
# define IS_NAN(_a) (std::isnan(_a))
39
75
#endif
40
76
/* If the above doesn't work, then try (a != a).
41
77
 * Also, please report a bug as per http://www.inkscape.org/report_bugs.php,
44
80
 
45
81
 
46
82
#if defined(__isfinite)
47
 
# define is_finite(_a) (__isfinite(_a))
 
83
# define IS_FINITE(_a) (__isfinite(_a))
48
84
#elif defined(__APPLE__) && __GNUC__ == 3
49
 
# define is_finite(_a) (__isfinite(_a)) /* MacOSX/Darwin definition < 10.4 */
 
85
# define IS_FINITE(_a) (__isfinite(_a)) /* MacOSX/Darwin definition < 10.4 */
 
86
#elif defined(__sgi)
 
87
# define IS_FINITE(_a) (_isfinite(_a))
50
88
#elif defined(isfinite)
51
 
# define is_finite(_a) (isfinite(_a))
 
89
# define IS_FINITE(_a) (isfinite(_a))
 
90
#elif defined(__osf__)
 
91
# define IS_FINITE(_a) (finite(_a) && !IS_NAN(_a))
 
92
#elif defined (SOLARIS_2_8) && __GNUC__ == 3 && __GNUC_MINOR__ == 2
 
93
#include  <ieeefp.h>
 
94
#define IS_FINITE(_a) (finite(_a) && !IS_NAN(_a))
52
95
#else
53
 
# define is_finite(_a) (std::isfinite(_a))
 
96
# define IS_FINITE(_a) (std::isfinite(_a))
54
97
#endif
55
 
/* If the above doesn't work, then try (finite(_a) && !isNaN(_a)) or (!isNaN((_a) - (_a))).
 
98
/* If the above doesn't work, then try (finite(_a) && !IS_NAN(_a)) or 
 
99
 * (!IS_NAN((_a) - (_a))).
56
100
 * Also, please report a bug as per http://www.inkscape.org/report_bugs.php,
57
101
 * giving information about what platform and compiler version you're using.
58
102
 */
59
103
 
60
104
 
61
 
#endif /* __ISNAN_H__ */
 
105
#endif /* _2GEOM_ISNAN_H__ */
 
106
 
 
107
/*
 
108
  Local Variables:
 
109
  mode:c++
 
110
  c-file-style:"stroustrup"
 
111
  c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
 
112
  indent-tabs-mode:nil
 
113
  fill-column:99
 
114
  End:
 
115
*/
 
116
// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 :