about summary refs log tree commit diff stats
path: root/src/plugins/python_api.c
diff options
context:
space:
mode:
authorDmitry Podgorny <pasis.ua@gmail.com>2019-10-15 12:22:48 +0000
committerDmytro Podgornyi <dmytrop@mellanox.com>2019-10-15 12:30:38 +0000
commit69bba3ea4e38283495dcc1c5a541964bb5175163 (patch)
tree7d73ca8edc167a5d8db7d0b1ee3abc3ee7925e1a /src/plugins/python_api.c
parentd0c3d3fd6b7d01535c2dd1d744b159b14afb5f8b (diff)
downloadprofani-tty-69bba3ea4e38283495dcc1c5a541964bb5175163.tar.gz
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.
Diffstat (limited to 'src/plugins/python_api.c')
-rw-r--r--src/plugins/python_api.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/plugins/python_api.c b/src/plugins/python_api.c
index ade24d05..b157cc62 100644
--- a/src/plugins/python_api.c
+++ b/src/plugins/python_api.c
@@ -32,6 +32,7 @@
  *
  */
 
+#undef _XOPEN_SOURCE
 #include <Python.h>
 
 #include "config.h"