You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Unexposed enums in struct fields lead to generation of bindings with Void as field's type.
As struct's fields cannot have the Void type, the generated binding is broken.
To reproduce:
$ cat <<'EOF' > /tmp/bug.h
struct st {
int a;
enum { x, y } b;
};
struct st *test();
EOF
$ crystal src/main.cr <<'EOF'
@[Include("/tmp/bug.h", prefix: %w(test))]
lib LibTest
end
EOF
lib LibTest
fun = test : St*
struct St
a : LibC::Int
b : Void
end
end
When trying to use the binding, the following error is thrown at compile time: can't use Void as a struct field type.
The text was updated successfully, but these errors were encountered:
olbat
added a commit
to olbat/crystal_lib
that referenced
this issue
Mar 1, 2020
olbat
changed the title
Unexposed enums lead to generation of broken bindings
Usage of unexposed enums leads to generation of broken bindings
Mar 1, 2020
Unexposed enums in struct fields lead to generation of bindings with Void as field's type.
As struct's fields cannot have the Void type, the generated binding is broken.
To reproduce:
When trying to use the binding, the following error is thrown at compile time:
can't use Void as a struct field type
.The text was updated successfully, but these errors were encountered: