# 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 #define HAVE_IEEEFP_H 1
    00016
    00017 #ifdef HAVE_IEEEFP_H
    00018 extern "C"
    00019 {
    00020 #include <ieeefp.h>
    00021 }
    00022 #endif
    00023
    00024 #ifdef HAVE_INT64_T_64
    00025 extern "C"
    00026 {
    00027 #include <inttypes.h>
    00028 }
    00029 #endif
    00030
    00031 #if defined(__GNUC__) && defined(_WIN32)
    00032 /* For MingW the appropriate definitions are included in
    00033  math.h and float.h but the definitions in
    00034  math.h are only included if __STRICT_ANSI__
    00035  is not defined.  Since GEOS is compiled with -ansi that
    00036  means those definitions are not available. */
    00037 #include <float.h>
    00038 #endif
    00039
    00040
    00041 //Defines NaN for intel platforms
    00042 //Don't forget to define infinities
    00043 #define DoubleNotANumber 1.7e-308
    00044 #define DoubleInfinity 1.7e+308
    00045 #define DoubleNegInfinity -1.7e+308
    00046
    00047 #define FINITE(x) ( (x) != DoubleNotANumber && (x) != DoubleInfinity && (x) != DoubleNegInfinity )
    00048 #define ISNAN(x) ( (x) == DoubleNotANumber )
    00049
    00050 #ifdef HAVE_INT64_T_64
    00051   typedef int64_t int64;
    00052 #else
    00053 # ifdef HAVE_LONG_LONG_INT_64
    00054    typedef long long int int64;
    00055 # else
    00056    typedef long int int64;
    00057 #  ifndef HAVE_LONG_INT_64
    00058 #   define INT64_IS_REALLY32 1
    00059 #   warning "Could not find 64bit integer definition!"
    00060 #  endif
    00061 # endif
    00062 #endif
    00063
    00064 inline int getMachineByteOrder() {
    00065         static int endian_check = 1; // don't modify !!
    00066         return *((char *)&endian_check); // 0 == big_endian | xdr,
    00067                                          // 1 == little_endian | ndr
    00068 }
    00069
    00070 #endif