Main Page | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members | Related Pages

platform.h

00001 /* source/headers/geos/platform.h.  Generated from platform.h.in by configure.  */
00002 #ifndef GEOS_PLATFORM_H
00003 #define GEOS_PLATFORM_H
00004 
00005 /* Set to 1 if you have `int64_t' type */
00006 #define HAVE_INT64_T_64 
00007 
00008 /* Set to 1 if `long int' is 64 bits */
00009 /* #undef HAVE_LONG_INT_64 */
00010 
00011 /* Set to 1 if `long long int' is 64 bits */
00012 /* #undef HAVE_LONG_LONG_INT_64 */
00013 
00014 /* Set to 1 if you have ieeefp.h */
00015 /* #undef HAVE_IEEEFP_H */
00016 
00017 /* Has finite */
00018 /* #undef HAVE_FINITE */
00019 
00020 /* Has isfinite */
00021 /* #undef HAVE_ISFINITE */
00022 
00023 #ifdef HAVE_IEEEFP_H
00024 extern "C"
00025 {
00026 #include <ieeefp.h>
00027 }
00028 #endif
00029 
00030 #ifdef HAVE_INT64_T_64
00031 extern "C"
00032 {
00033 #include <inttypes.h>
00034 }
00035 #endif
00036 
00037 #if defined(__GNUC__) && defined(_WIN32)
00038 /* For MingW the appropriate definitions are included in
00039  math.h and float.h but the definitions in 
00040  math.h are only included if __STRICT_ANSI__
00041  is not defined.  Since GEOS is compiled with -ansi that
00042  means those definitions are not available. */
00043 #include <float.h>
00044 #endif
00045 
00046 #include <cmath> // for finite()/isfinite() and isnan()
00047 #include <limits> // for std::numeric_limits
00048 
00049 
00050 
00051 //Defines NaN for intel platforms
00052 #define DoubleNotANumber std::numeric_limits<double>::quiet_NaN()
00053 
00054 //Don't forget to define infinities
00055 #define DoubleInfinity std::numeric_limits<double>::infinity()
00056 #define DoubleNegInfinity -std::numeric_limits<double>::infinity()
00057 
00058 #define DoubleMax std::numeric_limits<double>::max()
00059 
00060 inline bool
00061 isFinite(double d)
00062 {
00063 #if defined(HAVE_FINITE) && !defined(HAVE_ISFINITE)
00064     return (finite(d));
00065 #else
00066     // Put using namespace std; here if you have to
00067     // put it anywhere.
00068     using namespace std;
00069     return (isfinite(d));
00070 #endif
00071 }
00072 #define FINITE(x) ( isFinite(x) ) 
00073 
00074 #define ISNAN(x) ( isnan(x) )
00075 
00076 #ifdef HAVE_INT64_T_64
00077   typedef int64_t int64;
00078 #else
00079 # ifdef HAVE_LONG_LONG_INT_64
00080    typedef long long int int64;
00081 # else
00082    typedef long int int64;
00083 #  ifndef HAVE_LONG_INT_64
00084 #   define INT64_IS_REALLY32 1
00085 #   warning "Could not find 64bit integer definition!"
00086 #  endif
00087 # endif
00088 #endif
00089 
00090 inline int getMachineByteOrder() {
00091         static int endian_check = 1; // don't modify !!
00092         return *((char *)&endian_check); // 0 == big_endian | xdr,
00093                                          // 1 == little_endian | ndr
00094 }
00095 
00096 #endif

Generated on Thu Jun 11 06:17:01 2009 for GEOS by  doxygen 1.4.4