Open dewrfe53535 opened 3 months ago
when using them like this:
import ctypeslib
py_module = ctypeslib.translate("""
#include <netinet/in.h>
struct network_setup
{
sa_family_t version;
union
{
struct in_addr ipv4;
struct in6_addr ipv6;
} ip;
union
{
struct in_addr ipv4;
struct in6_addr ipv6;
} mask;
union
{
struct in_addr ipv4;
struct in6_addr ipv6;
} gateway;
};
""")
it fails with the following traceback:
$ python example.py
Bad source code, bitsize == -16 <0 on __cmsg_data
Traceback (most recent call last):
File "/tmp/ctypeslib/example.py", line 3, in <module>
py_module = ctypeslib.translate("""
^^^^^^^^^^^^^^^^^^^^^^^
File "/tmp/ctypeslib/ctypeslib/codegen/codegenerator.py", line 1151, in translate
exec(output, namespace)
File "<string>", line 1215
'enum (unnamed at /usr/include/netinet/in.h:105:1)', 'enum
^
output (case from test)
clang version: