From 61dbb0086952cdc13f3ca89db810ec365a9cf9b7 Mon Sep 17 00:00:00 2001 From: Christian Heimes Date: Sun, 6 Jan 2013 16:41:56 +0100 Subject: Issue #16881: Fix Py_ARRAY_LENGTH macro for GCC < 3.1. --- Include/pymacro.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'Include/pymacro.h') diff --git a/Include/pymacro.h b/Include/pymacro.h index 52e8ee3a28..5bb4b3d55a 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) \ -- cgit v1.2.1