nsf / termbox

Library for writing text-based user interfaces
http://code.google.com/p/termbox
MIT License
1.96k stars 185 forks source link

_XOPEN_SOURCE is not defined for python extensions #89

Closed rindeal closed 7 years ago

rindeal commented 7 years ago

compiler error:

x86_64-pc-linux-gnu-gcc -fPIC -I/usr/include/python3.4m -c src/termbox.c -o /tmp/portage/sys-libs/termbox-1.1.0/work/termbox-1.1.0-python3_4/temp.linux-x86_64-3.4/src/termbox.o -Wno-error=declaration-after-statement
src/termbox.c: In function 'tb_present':
src/termbox.c:187:8: warning: implicit declaration of function 'wcwidth' [-Wimplicit-function-declaration]
    w = wcwidth(back->ch);
        ^

my workaround:

setup.py:

- ext_modules = [Extension('termbox', sourcefiles, extra_compile_args=["-Wno-error=declaration-after-statement"])],
+ ext_modules = [Extension('termbox', sourcefiles, extra_compile_args=["-D_XOPEN_SOURCE", "-Wno-error=declaration-after-statement"])],