This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java 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: jni.h tweak


I'm checking this in on the trunk.

Steven Augart pointed out on the Classpath list that we can't use
-Wstrict-prototypes with C code that uses jni.h, due to how we define
_Jv_func.  This is only used as a placeholder.  Sun uses `void *'
here; while pedantically incorrect, it is simpler and probably "just
as good" to be compatible here.  Hence the appended.

Tom

Index: ChangeLog
from  Steven Augart  <augart@watson.ibm.com>

	* include/jni.h.in (_Jv_func): Removed.
	(struct JNINativeInterface): Use `void *' for reserved slots.
	(struct JNIInvokeInterface): Likewise.

Index: include/jni.h
===================================================================
RCS file: /cvs/gcc/gcc/libjava/include/jni.h,v
retrieving revision 1.26
diff -u -r1.26 jni.h
--- include/jni.h 12 Nov 2003 05:56:44 -0000 1.26
+++ include/jni.h 14 May 2004 16:25:16 -0000
@@ -1,4 +1,4 @@
-/* Copyright (C) 1998, 1999, 2000, 2001, 2002  Free Software Foundation
+/* Copyright (C) 1998, 1999, 2000, 2001, 2002, 2004  Free Software Foundation
 
    This file is part of libgcj.
 
@@ -240,12 +240,6 @@
   jobject  l;
 } jvalue;
 
-#ifdef __cplusplus
-typedef void * (*_Jv_func) (...);
-#else
-typedef void * (*_Jv_func) ();
-#endif
-
 /* This structure is used when registering native methods.  */
 typedef struct
 {
@@ -256,10 +250,10 @@
 
 struct JNINativeInterface
 {
-  _Jv_func reserved0;
-  _Jv_func reserved1;
-  _Jv_func reserved2;
-  _Jv_func reserved3;
+  void *reserved0;
+  void *reserved1;
+  void *reserved2;
+  void *reserved3;
 
   jint     (JNICALL *GetVersion)                   (JNIEnv *);
   jclass   (JNICALL *DefineClass)                  (JNIEnv *, const char *,
@@ -1574,9 +1568,9 @@
 
 struct JNIInvokeInterface
 {
-  _Jv_func reserved0;
-  _Jv_func reserved1;
-  _Jv_func reserved2;
+  void *reserved0;
+  void *reserved1;
+  void *reserved2;
 
   jint (JNICALL *DestroyJavaVM)         (JavaVM *);
   jint (JNICALL *AttachCurrentThread)   (JavaVM *, void **, void *);


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