Py_GCC_ATTRIBUTE missing

Issue #2817 resolved
Hrvoje Nikšić created an issue

The Py_GCC_ATTRIBUTE macro is missing from the C API emulation headers. While it is not strictly a part of the Python/C API as it's not documented, it also does not begin with an underscore, so there is code out there that relies on it in their own extensions. (I discovered that by attempting to compile in-house Python/C extensions under PyPy.)

It can be easily added by copying the definition from CPython:

#if (!defined(__GNUC__) || __GNUC__ < 2 || \
     (__GNUC__ == 2 && __GNUC_MINOR__ < 7) ) && \
    !defined(RISCOS)
#define Py_GCC_ATTRIBUTE(x)
#else
#define Py_GCC_ATTRIBUTE(x) __attribute__(x)
#endif

Comments (1)

  1. Log in to comment