[pypy-commit] pypy default: cpyext: add pymath.h and a definition of Py_HUGE_VAL.
amauryfa
noreply at buildbot.pypy.org
Thu Feb 23 21:19:46 CET 2012
Author: Amaury Forgeot d'Arc <amauryfa at gmail.com>
Branch:
Changeset: r52814:13ea80daa6d4
Date: 2012-02-23 00:07 +0100
http://bitbucket.org/pypy/pypy/changeset/13ea80daa6d4/
Log: cpyext: add pymath.h and a definition of Py_HUGE_VAL.
diff --git a/pypy/module/cpyext/include/Python.h b/pypy/module/cpyext/include/Python.h
--- a/pypy/module/cpyext/include/Python.h
+++ b/pypy/module/cpyext/include/Python.h
@@ -113,6 +113,7 @@
#include "compile.h"
#include "frameobject.h"
#include "eval.h"
+#include "pymath.h"
#include "pymem.h"
#include "pycobject.h"
#include "pycapsule.h"
diff --git a/pypy/module/cpyext/include/pymath.h b/pypy/module/cpyext/include/pymath.h
new file mode 100644
--- /dev/null
+++ b/pypy/module/cpyext/include/pymath.h
@@ -0,0 +1,20 @@
+#ifndef Py_PYMATH_H
+#define Py_PYMATH_H
+
+/**************************************************************************
+Symbols and macros to supply platform-independent interfaces to mathematical
+functions and constants
+**************************************************************************/
+
+/* HUGE_VAL is supposed to expand to a positive double infinity. Python
+ * uses Py_HUGE_VAL instead because some platforms are broken in this
+ * respect. We used to embed code in pyport.h to try to worm around that,
+ * but different platforms are broken in conflicting ways. If you're on
+ * a platform where HUGE_VAL is defined incorrectly, fiddle your Python
+ * config to #define Py_HUGE_VAL to something that works on your platform.
+ */
+#ifndef Py_HUGE_VAL
+#define Py_HUGE_VAL HUGE_VAL
+#endif
+
+#endif /* Py_PYMATH_H */
More information about the pypy-commit
mailing list