This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Patch: FYI: gcjh and JNIEXPORT


Ranjit Mathew pointed out that gcjh doesn't put JNIEXPORT or JNICALL
in the generate JNI header files.  This is important for
compatibility.  Fixed as appended.

Tom

Index: ChangeLog
from  Tom Tromey  <tromey@redhat.com>

	* gjavah.c (print_stub_or_jni): Include JNIEXPORT and JNICALL in
	a JNI header.

Index: gjavah.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/java/gjavah.c,v
retrieving revision 1.93
diff -u -r1.93 gjavah.c
--- gjavah.c 23 Oct 2002 22:47:31 -0000 1.93
+++ gjavah.c 6 Nov 2002 22:08:05 -0000
@@ -1565,7 +1565,7 @@
 	return;
 
       if (flag_jni && ! stubs)
-	fputs ("extern ", stream);
+	fputs ("extern JNIEXPORT ", stream);
 
       /* If printing a method, skip to the return signature and print
 	 that first.  However, there is no return value if this is a
@@ -1597,6 +1597,9 @@
       /* When printing a JNI header we need to respect the space.  In
 	 other cases we're just going to insert a newline anyway.  */
       fputs (need_space && ! stubs ? " " : "\n", stream);
+
+      if (flag_jni && ! stubs)
+	fputs ("JNICALL ", stream);
       
       /* Now print the name of the thing.  */
       print_name_for_stub_or_jni (stream, jcf, name_index,


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]