GEOS  3.7.2dev
platform.h
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) 2018 Vicky Vergara
9  * Copyright (C) 2009 Mateusz Loskot
10  * Copyright (C) 2005-2009 Refractions Research Inc.
11  * Copyright (C) 2001-2009 Vivid Solutions Inc.
12  *
13  * This is free software; you can redistribute and/or modify it under
14  * the terms of the GNU Lesser General Public Licence as published
15  * by the Free Software Foundation.
16  * See the COPYING file for more information.
17  *
18  *********************************************************************/
19 
20 #ifndef GEOS_PLATFORM_H_INCLUDED
21 #define GEOS_PLATFORM_H_INCLUDED
22 
23 #ifdef _MSC_VER
24 #ifndef NOMINMAX
25 #define NOMINMAX 1
26 #endif
27 #endif
28 
29 /* Disable inclusion of platform.h not generated by CMake */
30 #define GEOS_PLATFORM_H 1
31 
32 /* Set to 1 if you have ieeefp.h */
33 /* #undef HAVE_IEEEFP_H */
34 
35 #ifdef _MSC_VER
36 # define _USE_MATH_DEFINES
37 #endif
38 #include <cmath>
39 #include <limits>
40 #include <cinttypes>
41 
42 
43 
44 #ifndef M_PI
45 #define M_PI 3.14159265358979323846
46 #endif
47 
48 typedef int64_t int64;
49 
50 
51 #if defined(_MSC_VER) && _MSC_VER >= 1200 // VC++ 6.0 and above
52 # include <float.h>
53 # ifndef FINITE
54 # define FINITE(x) _finite(x)
55 # endif
56 # ifndef ISNAN
57 # define ISNAN(x) _isnan(x)
58 # endif
59 #elif !defined(HAVE_IEEEFP_H)
60 # include <cmath>
61 # ifndef FINITE
62 # define FINITE(x) std::isfinite(x)
63 # endif
64 # ifndef ISNAN
65 # define ISNAN(x) std::isnan(x)
66 # endif
67 #else
68 # include <ieeefp.h>
69 # ifndef FINITE
70 # define FINITE(x) finite(x)
71 # endif
72 # ifndef ISNAN
73 # define ISNAN(x) isnan(x)
74 # endif
75 #endif
76 
77 
78 // Some handy constants
79 constexpr double DoubleNotANumber = std::numeric_limits<double>::quiet_NaN();
80 constexpr double DoubleMax = (std::numeric_limits<double>::max)();
81 constexpr double DoubleInfinity = (std::numeric_limits<double>::infinity)();
82 constexpr double DoubleNegInfinity = (-(std::numeric_limits<double>::infinity)());
83 
84 
85 
86 #endif // GEOS_PLATFORM_H_INCLUDED