Make use of stdbool.h when generating Python interface #244
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
It seems building pocketsphinx does not work with Python's 3.11
series. Trying to compile fails with this error:
In file included from /usr/include/python3.11/cpython/pystate.h:5,
from /usr/include/python3.11/pystate.h:135,
from /usr/include/python3.11/Python.h:76,
from pocketsphinx_wrap.c:11:
pocketsphinx_wrap.c:16:13: error: two or more data types in declaration specifiers
16 | typedef int bool;
| ^~~~
pocketsphinx_wrap.c:16:1: warning: useless type name in empty declaration
16 | typedef int bool;
| ^~~~~~~
My guess is that one of the Python header files started including
stdbool.h, and thus the type bool conflicts with the name bool in:
typedef int bool;
The offending code is generated using swig.
This commit removes the definition of bool and instead includes
stdbool.h to make use of the system definition.
Signed-off-by: W. Michael Petullo [email protected]