Commit efabbc7
authored
Fix: extern djinni flags not being marshalled properly for JNI (#90)
In djinni, `flags` are declared as EnumSet in java.
Djinni generates files named `jni/NativeXXX.hpp` which are responsible
of resolving the library symbols by looking for function signatures and
map them to Java functions.
When a djinni type `flags` is declared in one module, and used in
another one (via `@extern` and yaml files), a function `foo` taking an
extern flags `my_flags` type as parameter would try to be resolved with:
const jmethodID method_statusesChanged{
::djinni::jniGetMethodID(clazz.get(), "foo", "(Lnz/co/abc/MyFlags;)V")};
This will thus fail to be resolved as the Java type for flags is
`EnumSet`, not the actual underlying enum type.
This commit fixes this by using an `EnumSet` properly for extern flags
resulting in the following:
const jmethodID method_statusesChanged{
::djinni::jniGetMethodID(clazz.get(), "foo", "(Ljava/util/EnumSet;)V")};1 parent ac9b1e4 commit efabbc7
1 file changed
+4
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
75 | 75 | | |
76 | 76 | | |
77 | 77 | | |
78 | | - | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
79 | 82 | | |
80 | 83 | | |
81 | 84 | | |
| |||
0 commit comments