File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -14,6 +14,8 @@ Running the previous command wild also yield warnings along with the translation
14
14
15
15
` ./scala-native-bindgen /usr/include/uv.h -name uv -- > uv.scala `
16
16
17
+ Run ` ./scala-native-bindgen -help ` to see all available options.
18
+
17
19
## Building
18
20
19
21
Building this tool requires [ CMake] , [ LLVM] and [ Clang] . See the [ Scala
@@ -54,6 +56,25 @@ cd tests
54
56
sbt test
55
57
```
56
58
59
+ ## Current limitations
60
+ There are multiple unsupported cases that should be considered when generating bindings:
61
+ 1 . Currently bindgen does not support passing structs by value.
62
+ For example, it will not be possible to call these two functions from Scala Native code:
63
+ ``` c
64
+ struct MyStruct {
65
+ int a;
66
+ };
67
+
68
+ struct MyStruct returnStruct();
69
+
70
+ void handleStruct(struct MyStruct mystr);
71
+ ```
72
+ To support such cases one should generate bindings for C wrapper functions that use pointers to structs instead of actual structs.
73
+ 2 . Bindgen does not generate bindings for defines.
74
+ In order to use defines one should write wrapper functions that return defined values.
75
+ 3 . There is no way to reuse already generated bindings.
76
+ Bindgen outputs bindings also for headers that were included in a given header.
77
+
57
78
## License
58
79
59
80
This project is distributed under the Scala license.
You can’t perform that action at this time.
0 commit comments