I am working on a project in Crystal lang which embeds Python3.5 linking Python .so library (no Python.h
header).
It seems that PyType_Check()
and other check functions actually are macros, so they're not visible while linking the library.
Is there any other alternative or workarount to this?
Exactly, C macros won't be available in Crystal. However, you'll only need to call them from Crystal. In the compiled C library they're already expanded.
So you can just implement these macros in Crystal. Of course, you'll have to do some unwrapping of nested macros. To my knowledge there is no simple solution to this. Bindgen for example ignores function-like macros as well because they can't be easily converted to Crystal.