Suppress -Wregister gcc warnings in Python.h
Such as: /usr/include/python2.7/unicodeobject.h:534:24: warning: ISO C++17 does not allow ‘register’ storage class specifier [-Wregister] Closes #2227
This commit is contained in:
parent
7f009eddf0
commit
8e3f0fd793
2 changed files with 24 additions and 0 deletions
|
|
@ -32,8 +32,20 @@ As far as I know, this module is C++ safe.
|
|||
#ifndef SWIG_NO_PY_SSIZE_T_CLEAN
|
||||
#define PY_SSIZE_T_CLEAN
|
||||
#endif
|
||||
|
||||
#if __GNUC__ >= 7
|
||||
#pragma GCC diagnostic push
|
||||
#if defined(__cplusplus) && __cplusplus >=201703L
|
||||
#pragma GCC diagnostic ignored "-Wregister" /* For python-2.7 headers that use register */
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#include <Python.h>
|
||||
|
||||
#if __GNUC__ >= 7
|
||||
#pragma GCC diagnostic pop
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue