[geos-commits] r2856 - trunk/include/geos
svn_geos at osgeo.org
svn_geos at osgeo.org
Sat Jan 16 15:41:55 EST 2010
Author: mloskot
Date: 2010-01-16 15:41:55 -0500 (Sat, 16 Jan 2010)
New Revision: 2856
Added:
trunk/include/geos/platform.h.cmake
Log:
Added platform.h.cmake file used by build configuration for CMake build system (#317)
Added: trunk/include/geos/platform.h.cmake
===================================================================
--- trunk/include/geos/platform.h.cmake (rev 0)
+++ trunk/include/geos/platform.h.cmake 2010-01-16 20:41:55 UTC (rev 2856)
@@ -0,0 +1,143 @@
+/**********************************************************************
+ * $Id$
+ *
+ * platform.h - generated by CMake from platform.h.cmake
+ *
+ * GEOS - Geometry Engine Open Source
+ * http://geos.refractions.net
+ *
+ * Copyright (C) 2009 Mateusz Loskot
+ * Copyright (C) 2005-2009 Refractions Research Inc.
+ * Copyright (C) 2001-2009 Vivid Solutions Inc.
+ *
+ * This is free software; you can redistribute and/or modify it under
+ * the terms of the GNU Lesser General Public Licence as published
+ * by the Free Software Foundation.
+ * See the COPYING file for more information.
+ *
+ *********************************************************************/
+
+/* Set to 1 if you have `int64_t' type */
+#cmakedefine HAVE_INT64_T_64 1
+
+/* Set to 1 if `long int' is 64 bits */
+#cmakedefine HAVE_LONG_INT_64 1
+
+/* Set to 1 if `long long int' is 64 bits */
+#cmakedefine HAVE_LONG_LONG_INT_64 1
+
+/* Set to 1 if you have ieeefp.h */
+#cmakedefine HAVE_IEEEFP_H 1
+
+/* Has finite */
+#cmakedefine HAVE_FINITE 1
+
+/* Has isfinite */
+#cmakedefine HAVE_ISFINITE 1
+
+/* Has isnan */
+#cmakedefine HAVE_ISNAN 1
+
+
+#ifdef HAVE_IEEEFP_H
+extern "C"
+{
+#include <ieeefp.h>
+}
+#endif
+
+#ifdef HAVE_INT64_T_64
+extern "C"
+{
+#include <inttypes.h>
+}
+#endif
+
+/* We need M_PI, but on MSVC you need to define _USE_MATH_DEFINES before
+ * including math.h to get it. If we are too late (math.h already included)
+ * we will define it manually.
+ */
+#ifdef _MSC_VER
+#define _USE_MATH_DEFINES
+#include <math.h>
+#endif
+
+#ifndef M_PI
+#define M_PI 3.14159265358979323846
+#endif
+
+/* For MingW the appropriate definitions are included in math.h
+ * and float.h but the definitions in math.h are only included
+ * if __STRICT_ANSI__ is not defined. Since GEOS is compiled
+ * with -ansi that means those definitions are not available.
+ */
+#if defined(__GNUC__) && defined(_WIN32)
+#include <float.h>
+#endif
+
+/* For Visual C++, required to find _isnan and _finite */
+#ifdef _MSC_VER
+#include <float.h>
+#endif
+
+#include <cmath> // trying C++0x finite, isfinite, isnan
+#include <limits>
+
+#ifdef HAVE_INT64_T_64
+# ifdef _MSC_VER
+ typedef __int64 int64;
+# else
+ typedef int64_t int64;
+# endif
+#else
+# ifdef HAVE_LONG_LONG_INT_64
+ typedef long long int int64;
+# else
+ typedef long int int64;
+# ifndef HAVE_LONG_INT_64
+# define INT64_IS_REALLY32 1
+# warning "Could not find 64bit integer definition!"
+# endif
+# endif
+#endif
+
+#if defined(HAVE_FINITE) && !defined(HAVE_ISFINITE)
+# define FINITE(x) (finite(x))
+#else
+# if defined(_MSC_VER)
+# define FINITE(x) _finite(static_cast<double>(x))
+# else
+# define FINITE(x) (isfinite(x))
+# endif
+#endif
+
+#if defined(HAVE_ISNAN)
+# define ISNAN(x) (isnan(x))
+#else
+# if defined(_MSC_VER)
+# define ISNAN(x) _isnan(x)
+# elif defined(__OSX__)
+ // Hack for OS/X <cmath> incorrectly re-defining isnan() into oblivion.
+ // It does leave a version in std.
+# define ISNAN(x) (std::isnan(x))
+# endif
+#endif
+
+#ifndef FINITE
+#error "Could not find finite or isfinite function or macro!"
+#endif
+
+#ifndef ISNAN
+#error "Could not find isnan function or macro!"
+#endif
+
+
+#define DoubleNegInfinity -std::numeric_limits<double>::infinity()
+#define DoubleMax std::numeric_limits<double>::max()
+// Defines NaN for Intel platforms
+#define DoubleNotANumber std::numeric_limits<double>::quiet_NaN()
+// Don't forget to define infinities
+#define DoubleInfinity std::numeric_limits<double>::infinity()
+
+
+#endif
More information about the geos-commits
mailing list