scrapinghub / python-crfsuite

A python binding for crfsuite
MIT License
769 stars 223 forks source link

Define _POSIX_C_SOURCE for crfsuite source files #159

Open karcherm opened 1 month ago

karcherm commented 1 month ago

gcc-14 has "-Werror=implicit-function-declaration" enabled by default. crfsuite uses posix_memalign which only gets defined when _POSIX_C_SOURCE is defined, so make sure the flag is set when compiling crfsuite.

On the other hand, openSUSE Tumbleweed has _POSIX_C_SOURCE defined in pyconfig.h, so you must not add "-D_POSIX_C_SOURCE" when compiling the python binding source code. So add it only for the subdir crfsuite.

Fixes #158