aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatti Picus <matti.picus@gmail.com>2021-02-24 16:49:40 +0200
committerMatti Picus <matti.picus@gmail.com>2021-02-24 16:49:40 +0200
commit7471e76b830c693180e93ead79ef047f99e8004b (patch)
treee5827b8b72b000d41148672195611e2d23546ca1
parentupdate the files for vmprof-python (diff)
downloadpypy-7471e76b830c693180e93ead79ef047f99e8004b.tar.gz
pypy-7471e76b830c693180e93ead79ef047f99e8004b.tar.bz2
pypy-7471e76b830c693180e93ead79ef047f99e8004b.zip
more upstream syncing - move inttypes.h into pyport.h (issue 3407)
-rw-r--r--pypy/module/cpyext/include/Python.h2
-rw-r--r--pypy/module/cpyext/include/pyport.h38
2 files changed, 35 insertions, 5 deletions
diff --git a/pypy/module/cpyext/include/Python.h b/pypy/module/cpyext/include/Python.h
index 829c6aa0c4..93cb501f1d 100644
--- a/pypy/module/cpyext/include/Python.h
+++ b/pypy/module/cpyext/include/Python.h
@@ -6,8 +6,6 @@
#define _GNU_SOURCE 1
#endif
#ifndef _WIN32
-# include <inttypes.h>
-# include <stdint.h>
# include <stddef.h>
# include <limits.h>
# include <math.h>
diff --git a/pypy/module/cpyext/include/pyport.h b/pypy/module/cpyext/include/pyport.h
index 511cdbc31d..deee49ab62 100644
--- a/pypy/module/cpyext/include/pyport.h
+++ b/pypy/module/cpyext/include/pyport.h
@@ -1,9 +1,41 @@
#ifndef Py_PYPORT_H
#define Py_PYPORT_H
-#ifdef HAVE_STDINT_H
-#include <stdint.h>
-#endif
+#include "pyconfig.h" /* include for defines */
+
+#include <inttypes.h>
+
+/**************************************************************************
+Symbols and macros to supply platform-independent interfaces to basic
+C language & library operations whose spellings vary across platforms.
+
+Please try to make documentation here as clear as possible: by definition,
+the stuff here is trying to illuminate C's darkest corners.
+
+Config #defines referenced here:
+
+SIGNED_RIGHT_SHIFT_ZERO_FILLS
+Meaning: To be defined iff i>>j does not extend the sign bit when i is a
+ signed integral type and i < 0.
+Used in: Py_ARITHMETIC_RIGHT_SHIFT
+
+Py_DEBUG
+Meaning: Extra checks compiled in for debug mode.
+Used in: Py_SAFE_DOWNCAST
+
+**************************************************************************/
+
+/* typedefs for some C9X-defined synonyms for integral types.
+ *
+ * The names in Python are exactly the same as the C9X names, except with a
+ * Py_ prefix. Until C9X is universally implemented, this is the only way
+ * to ensure that Python gets reliable names that don't conflict with names
+ * in non-Python code that are playing their own tricks to define the C9X
+ * names.
+ *
+ * NOTE: don't go nuts here! Python has no use for *most* of the C9X
+ * integral synonyms. Only define the ones we actually need.
+ */
/* typedefs for some C9X-defined synonyms for integral types. */
#ifdef HAVE_LONG_LONG