Skip to content

Commit eb13261

Browse files
committed
[Java] Note use of %ignore with %native
This is needed if you're wanting to effectively replace the generated JNI wrapper for a C/C++ function. Fixes https://sourceforge.net/p/swig/bugs/368/
1 parent 9d06d4a commit eb13261

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

Doc/Manual/Java.html

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9062,6 +9062,11 @@ <H3><a name="Java_using_own_jni_functions">27.12.3 Using your own JNI functions<
90629062
Here the default typemaps work for <tt>int</tt> and <tt>char *</tt>.
90639063
</p>
90649064

9065+
<p>
9066+
Note that if you're wanting to effectively <b>replace</b> the JNI code generated for a C/C++ function then you'll need to use <tt>%ignore</tt> as well
9067+
to tell SWIG not to automatically generate a JNI wrapper for it.
9068+
</p>
9069+
90659070
<p>
90669071
In summary the <tt>%native</tt> directive is telling SWIG to generate the Java code to access the JNI C code, but not the JNI C function itself.
90679072
This directive is only really useful if you want to mix your own hand crafted JNI code and the SWIG generated code into one Java class or package.

0 commit comments

Comments
 (0)