1
0
mirror of https://github.com/profanity-im/profanity.git synced 2024-09-22 19:45:54 -04:00

plugins/python: fix double _XOPEN_SOURCE definition

ncursesw defines _XOPEN_SOURCE macro via command-line. In particular, it
is defined in ncursesw.pc and extracted via pkg-config. From other side,
Python defines the same macro unconditionally in pyconfig.h. Python-3.x
defines the macro with value different than ncursesw does. In turn, this
causes a warning that the macro is redefined. And warnings are treated
as errors.

Since both entities define the mecro unconditionally, we can't simply
reorder headers as Python developers suggest. So, undefine the macro
just before the <Python.h> to fix this silly issue.
This commit is contained in:
Dmitry Podgorny 2019-10-15 12:22:48 +00:00 committed by Dmytro Podgornyi
parent d0c3d3fd6b
commit 69bba3ea4e
2 changed files with 2 additions and 0 deletions

View File

@ -32,6 +32,7 @@
*
*/
#undef _XOPEN_SOURCE
#include <Python.h>
#include "config.h"

View File

@ -32,6 +32,7 @@
*
*/
#undef _XOPEN_SOURCE
#include <Python.h>
#include "log.h"