]> granicus.if.org Git - python/commitdiff
Issue #16881: Fix Py_ARRAY_LENGTH macro for GCC < 3.1.
authorChristian Heimes <christian@cheimes.de>
Sun, 6 Jan 2013 15:41:56 +0000 (16:41 +0100)
committerChristian Heimes <christian@cheimes.de>
Sun, 6 Jan 2013 15:41:56 +0000 (16:41 +0100)
Include/pymacro.h
Misc/NEWS

index 52e8ee3a289d5ed7ce39821a9ed5cb4be3e0a2c7..5bb4b3d55ac8f288eaa58c4422ff9b68ce27b405 100644 (file)
    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) \
index 15a97367969fd9fe9a69000218e15116efe442b5..2d076759ea095088e5ae24920b41426fca4279b2 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -12,6 +12,8 @@ What's New in Python 3.3.1?
 Core and Builtins
 -----------------
 
+- Issue #16881: Fix Py_ARRAY_LENGTH macro for GCC < 3.1.
+
 - Issue #16856: Fix a segmentation fault from calling repr() on a dict with
   a key whose repr raise an exception.