2 #ifndef GEOS_PLATFORM_H
3 #define GEOS_PLATFORM_H
9 #define HAVE_LONG_INT_64 1
21 #define HAVE_ISFINITE 1
33 #ifdef HAVE_INT64_T_64
40 #if defined(__GNUC__) && defined(_WIN32)
54 #define DoubleNotANumber std::numeric_limits<double>::quiet_NaN()
57 #define DoubleInfinity std::numeric_limits<double>::infinity()
58 #define DoubleNegInfinity -std::numeric_limits<double>::infinity()
60 #define DoubleMax std::numeric_limits<double>::max()
62 #ifdef HAVE_INT64_T_64
63 typedef int64_t int64;
65 # ifdef HAVE_LONG_LONG_INT_64
66 typedef long long int int64;
68 typedef long int int64;
69 # ifndef HAVE_LONG_INT_64
70 # define INT64_IS_REALLY32 1
71 # warning "Could not find 64bit integer definition!"
77 #if defined(HAVE_FINITE) && !defined(HAVE_ISFINITE)
78 # define FINITE(x) (finite(x))
80 # if defined(_MSC_VER)
81 # define FINITE(x) _finite(static_cast<double>(x))
83 # define FINITE(x) (isfinite(x))
87 #if defined(HAVE_ISNAN)
88 # define ISNAN(x) (isnan(x))
90 # if defined(_MSC_VER)
91 # define ISNAN(x) _isnan(x)
92 # elif defined(__MINGW32__) || defined(__CYGWIN__)
94 # define ISNAN(x) (std::isnan(x))
95 # elif defined(__OSX__) || defined(__APPLE__) || \
96 defined(__NetBSD__) || defined(__DragonFly__) || \
97 (defined(__sun) && defined(__GNUC__))
100 # define ISNAN(x) (std::isnan(x))
101 # elif (defined(__sun) || defined(__sun__)) && defined(__SUNPRO_CC)
103 # define ISNAN(x) (::isnan(x))
108 #error "Can not compile without finite or isfinite function or macro"
112 #error "Can not compile without isnan function or macro"