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
commit418e9641d2bb32aa6205b2bf9efad65953ef5a95 (patch)
tree8f6b5100cf40b4fa34881490548558b0847b94ba
parentfix use of pip install --user (bcc3432e03bb should have been "fix site.py for... (diff)
downloadpypy-418e9641d2bb32aa6205b2bf9efad65953ef5a95.tar.gz
pypy-418e9641d2bb32aa6205b2bf9efad65953ef5a95.tar.bz2
pypy-418e9641d2bb32aa6205b2bf9efad65953ef5a95.zip
more upstream syncing - move inttypes.h into pyport.h (issue 3407)
-rw-r--r--pypy/module/cpyext/include/Python.h3
-rw-r--r--pypy/module/cpyext/include/pyport.h38
2 files changed, 35 insertions, 6 deletions
diff --git a/pypy/module/cpyext/include/Python.h b/pypy/module/cpyext/include/Python.h
index 766c3f48d3..48d85ee72b 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>
@@ -18,7 +16,6 @@
# define PyAPI_DATA(RTYPE) extern PyAPI_FUNC(RTYPE)
# define Py_LOCAL_INLINE(type) static inline type
#else
-# include <stdint.h>
# define MS_WIN32 1
# define MS_WINDOWS 1
# ifdef _MSC_VER
diff --git a/pypy/module/cpyext/include/pyport.h b/pypy/module/cpyext/include/pyport.h
index ac4b1ffd77..6e632e62d6 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.
+ */
/* long long is required. Ensure HAVE_LONG_LONG is defined for compatibility. */
#ifndef HAVE_LONG_LONG