Add test for #580 (successful)
[geos.git] / include / geos / platform.h.cmake
blobf6f5d16afa9dac275470fad6063a5731e3442424
1 /**********************************************************************
2  *
3  * platform.h - generated by CMake from platform.h.cmake
4  *
5  * GEOS - Geometry Engine Open Source
6  * http://geos.osgeo.org
7  *
8  * Copyright (C) 2009 Mateusz Loskot
9  * Copyright (C) 2005-2009 Refractions Research Inc.
10  * Copyright (C) 2001-2009 Vivid Solutions Inc.
11  *
12  * This is free software; you can redistribute and/or modify it under
13  * the terms of the GNU Lesser General Public Licence as published
14  * by the Free Software Foundation. 
15  * See the COPYING file for more information.
16  *
17  *********************************************************************/
19 #ifndef GEOS_PLATFORM_H_INCLUDED
20 #define GEOS_PLATFORM_H_INCLUDED
22 /* Disable inclusion of platform.h not generated by CMake */
23 #define GEOS_PLATFORM_H 1
25 /* Set to 1 if you have stdint.h */
26 #cmakedefine HAVE_STDINT_H 1
28 /* Set to 1 if you have inttypes.h */
29 #cmakedefine HAVE_INTTYPES_H 1
31 /* Set to 1 if you have ieeefp.h */
32 #cmakedefine HAVE_IEEEFP_H 1
34 /* Set to 1 if you have `int64_t' type */
35 #cmakedefine HAVE_INT64_T_64 1
37 /* Set to 1 if `long int' is 64 bits */
38 #cmakedefine HAVE_LONG_INT_64 1
40 /* Set to 1 if `long long int' is 64 bits */
41 #cmakedefine HAVE_LONG_LONG_INT_64 1
43 /* Set to 1 if C++/C99 std::isnan is defined */
44 #cmakedefine HAVE_STD_ISNAN 1
46 /* Set to 1 if C99 isnan is defined */
47 #cmakedefine HAVE_ISNAN 1
49 /* Set to 1 if XCode __isnand is defined */
50 #cmakedefine HAVE_ISNAND_XCODE 1
52 /* Set to 1 if XCode __inline_isnand is defined */
53 #cmakedefine HAVE_INLINE_ISNAND_XCODE 1
55 /* Set to 1 if C++/C99 std::isfinite is defined */
56 #cmakedefine HAVE_STD_ISFINITE 1
58 /* Set to 1 if C99 isfinite is defined */
59 #cmakedefine HAVE_ISFINITE 1
61 /* Set to 1 if Visual C++ finite is defined */
62 #cmakedefine HAVE_FINITE 1
65 #ifdef HAVE_IEEEFP_H
66 extern "C"
68 #include <ieeefp.h>
70 #endif
72 #ifdef HAVE_INTTYPES_H
73 extern "C"
75 #include <inttypes.h>
77 # ifndef HAVE_INT64_T_64
78 #  error Warning: inttypes.h included but HAVE_INT64_T_64 not defined
79 # endif
80 #endif
82 /* We need M_PI, but on MSVC you need to define _USE_MATH_DEFINES before
83  * including math.h to get it.  If we are too late (math.h already included)
84  * we will define it manually.
85  */
86 #ifdef _MSC_VER
87 #define _USE_MATH_DEFINES
88 #include <cmath>
89 #include <float.h>
90 #else
91 #include <cmath>
92 #endif
93 #include <limits>
95 #ifndef M_PI
96 #define M_PI 3.14159265358979323846
97 #endif
99 /* For MingW the appropriate definitions are included in math.h
100  * and float.h but the definitions in math.h are only included
101  * if __STRICT_ANSI__ is not defined. Since GEOS is compiled
102  * with -ansi that means those definitions are not available.
103  */
104 #if defined(__GNUC__) && defined(_WIN32)
105 #include <float.h>
106 #endif
108 #ifdef HAVE_INT64_T_64
109 # ifdef _MSC_VER
110    typedef __int64 int64;
111 # else
112    typedef int64_t int64;
113 # endif
114 #else
115 # ifdef HAVE_LONG_LONG_INT_64
116    typedef long long int int64;
117 # else
118    typedef long int int64;
119 #  ifndef HAVE_LONG_INT_64
120 #   define INT64_IS_REALLY32 1
121 #   warning "Could not find 64bit integer definition!"
122 #  endif
123 # endif
124 #endif
126 #if defined(HAVE_STD_ISNAN)
127 # define ISNAN(x) (std::isnan)(x)
128 #elif defined(HAVE_INLINE_ISNAND_XCODE)
129 # define ISNAN(x) __inline_isnand(static_cast<double>(x))
130 #elif defined(HAVE_ISNAND_XCODE)
131 # define ISNAN(x) __isnand(static_cast<double>(x))
132 #elif defined(HAVE_ISNAN)
133 # if defined(_MSC_VER)
134 #  define ISNAN(x) _isnan(static_cast<double>(x))
135 # else
136 #  define ISNAN(x) isnan(x)
137 # endif
138 #else
139 # error "Could not find isnan function or macro!"
140 #endif
142 #if defined(HAVE_STD_ISFINITE)
143 # define FINITE(x) (std::isfinite)(x)
144 #elif defined(HAVE_ISFINITE)
145 # define FINITE(x) isfinite(x)
146 #elif defined(HAVE_FINITE)
147 # define FINITE(x) _finite(static_cast<double>(x))
148 #else
149 # error "Could not find finite or isfinite function or macro!"
150 #endif
152 #define DoubleNegInfinity (-(std::numeric_limits<double>::infinity)())
153 #define DoubleMax (std::numeric_limits<double>::max)()
154 // Defines NaN for Intel platforms
155 #define DoubleNotANumber std::numeric_limits<double>::quiet_NaN()
156 // Don't forget to define infinities
157 #define DoubleInfinity (std::numeric_limits<double>::infinity)()
159 #endif // GEOS_PLATFORM_H_INCLUDED