c-for-go
c-for-go copied to clipboard
unexpected identifier strtof32
When trying to build bindings for Python 3.9 I get the following error:
processing python.yml ⠹[ERR] /usr/include/stdlib.h:140:17: unexpected identifier strtof32, expected one of ['(', ')', ',', ':', ';', '=', '[', '{', _Bool, _Complex, _Noreturn, _Static_assert, asm, auto, char, const, double, enum, extern, float, inline, int, long, register, restrict, short, signed, static, struct, typedef, typedefname, typeof, union, unsigned, void, volatile]
This is the stdlib code causing the issue:
#if __HAVE_FLOAT32 && __GLIBC_USE (IEC_60559_TYPES_EXT)
extern _Float32 strtof32 (const char *__restrict __nptr,
char **__restrict __endptr)
__THROW __nonnull ((1));
#endif
It seems both _Float32 and _Float64 don't exist in moderc.org/cc
This is my c-for-go config so far:
GENERATOR:
PackageName: python
PackageDescription: Package python provides Go bindings for Python.
PackageLicense: THE AUTOGENERATED LICENSE. ALL THE RIGHTS ARE RESERVED BY ROBOTS.
PkgConfigOpts: [python3]
PARSER:
SourcesPaths:
- Python.h
I guess it will be broken in many other places too, but at least try to avoid this error by:
- overriding
__HAVE_FLOAT32as 0 - implementing
strtof32as a noop stub
Stubs worked, however there's loads more issues. Since all these issues are in the standard library, do you know a version of it that works with c-for-go?