summaryrefslogtreecommitdiffstats
path: root/Include
diff options
context:
space:
mode:
authorChristian Heimes <christian@cheimes.de>2013-01-06 15:42:20 (GMT)
committerChristian Heimes <christian@cheimes.de>2013-01-06 15:42:20 (GMT)
commitfb4b7b40e4372c14d3da10bd1753822e625c643d (patch)
tree4878ed5bb4cd637d6aafb4fbb8ef8a296ce9b7a6 /Include
parent5dd12a5978389ec3dfa7063bbe9a9763b1294027 (diff)
parent61dbb0086952cdc13f3ca89db810ec365a9cf9b7 (diff)
downloadcpython-fb4b7b40e4372c14d3da10bd1753822e625c643d.zip
cpython-fb4b7b40e4372c14d3da10bd1753822e625c643d.tar.gz
cpython-fb4b7b40e4372c14d3da10bd1753822e625c643d.tar.bz2
Issue #16881: Fix Py_ARRAY_LENGTH macro for GCC < 3.1.
Diffstat (limited to 'Include')
-rw-r--r--Include/pymacro.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/Include/pymacro.h b/Include/pymacro.h
index 52e8ee3..5bb4b3d 100644
--- a/Include/pymacro.h
+++ b/Include/pymacro.h
@@ -29,8 +29,11 @@
parameters. With correct compiler support, such usage will cause a build
error (see Py_BUILD_ASSERT_EXPR).
- Written by Rusty Russell, public domain, http://ccodearchive.net/ */
-#if (defined(__GNUC__) && !defined(__STRICT_ANSI__))
+ Written by Rusty Russell, public domain, http://ccodearchive.net/
+
+ Requires at GCC 3.1+ */
+#if (defined(__GNUC__) && !defined(__STRICT_ANSI__) && \
+ ((__GNUC__ == 3) && (__GNU_MINOR__ >= 1)) || (__GNUC__ >= 4))
/* Two gcc extensions.
&a[0] degrades to a pointer: a different type from an array */
#define Py_ARRAY_LENGTH(array) \