public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* Patch: FYI: gcjh and JNIEXPORT
@ 2002-11-06 14:09 Tom Tromey
  2002-11-07 21:01 ` Ranjit Mathew
  0 siblings, 1 reply; 3+ messages in thread
From: Tom Tromey @ 2002-11-06 14:09 UTC (permalink / raw)
  To: Java Patch List; +Cc: Gcc Patch List

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,

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Patch: FYI: gcjh and JNIEXPORT
  2002-11-06 14:09 Patch: FYI: gcjh and JNIEXPORT Tom Tromey
@ 2002-11-07 21:01 ` Ranjit Mathew
  2002-11-07 21:03   ` Tom Tromey
  0 siblings, 1 reply; 3+ messages in thread
From: Ranjit Mathew @ 2002-11-07 21:01 UTC (permalink / raw)
  To: gcc-patches; +Cc: java-patches

Tom Tromey wrote:
>        /* 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);

Shouldn't you also check "is_method && !is_init"?

stdcall is a calling convention and is valid only for methods
not fields.

stdcall does not seem to be valid for constructors as well.

Sincerely Yours,
Ranjit.

-- 
Ranjit Mathew          Email: rmathew AT hotmail DOT com

Bangalore, INDIA.      Web: http://ranjitmathew.tripod.com/



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Patch: FYI: gcjh and JNIEXPORT
  2002-11-07 21:01 ` Ranjit Mathew
@ 2002-11-07 21:03   ` Tom Tromey
  0 siblings, 0 replies; 3+ messages in thread
From: Tom Tromey @ 2002-11-07 21:03 UTC (permalink / raw)
  To: Ranjit Mathew; +Cc: java-patches, gcc-patches

>>>>> "Ranjit" == Ranjit Mathew <rmathew@hotmail.com> writes:

>> +      if (flag_jni && ! stubs)
>> +	fputs ("JNICALL ", stream);

Ranjit> Shouldn't you also check "is_method && !is_init"?

Not that I planned it or anything :-(, but we do this up above:

      if (! is_method && flag_jni)
	return;

Ranjit> stdcall does not seem to be valid for constructors as well.

You can't have a native constructor.

Tom

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2002-11-08  5:03 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-11-06 14:09 Patch: FYI: gcjh and JNIEXPORT Tom Tromey
2002-11-07 21:01 ` Ranjit Mathew
2002-11-07 21:03   ` Tom Tromey

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).