This is the mail archive of the
java-patches@sourceware.cygnus.com
mailing list for the Java project.
Patch: fix compilation with interpreter
- To: Java Patch List <java-patches at sourceware dot cygnus dot com>
- Subject: Patch: fix compilation with interpreter
- From: Tom Tromey <tromey at cygnus dot com>
- Date: 07 Feb 2000 14:15:24 -0700
- Reply-To: tromey at cygnus dot com
Anthony pointed out to me that one of my recent JNI checkins broke
compilation when the interpreter was not enabled. I'm checking in
this patch to fix the problem.
2000-02-07 Tom Tromey <tromey@cygnus.com>
* jni.cc (add_char): Conditional on INTERPRETER.
(mangled_name): Likewise.
(call): Likewise.
* include/java-interp.h (class _Jv_MethodBase): Conditional on
INTERPRETER.
(class _Jv_JNIMethod): Likewise.
Tom
Index: jni.cc
===================================================================
RCS file: /cvs/java/libgcj/libjava/jni.cc,v
retrieving revision 1.10
diff -u -r1.10 jni.cc
--- jni.cc 2000/02/04 20:49:26 1.10
+++ jni.cc 2000/02/07 18:49:50
@@ -8,12 +8,6 @@
Libgcj License. Please consult the file "LIBGCJ_LICENSE" for
details. */
-// Note: currently we take the approach of not checking most
-// arguments. Instead we could do more checking conditionally (e.g.,
-// if DEBUG is defined). That might be beneficial in some cases,
-// though to me it seems that one could just as easily use the
-// debugger.
-
#include <config.h>
#include <stddef.h>
@@ -1205,6 +1199,8 @@
+#ifdef INTERPRETER
+
// Add a character to the buffer, encoding properly.
static void
add_char (char *buf, jchar c, int *here)
@@ -1347,6 +1343,7 @@
}
// The actual call to the JNI function.
+ // FIXME: if this is a static function we must include the class!
ffi_raw_call (cif, (void (*) (...)) _this->function, ret, args);
do
@@ -1358,6 +1355,8 @@
if (env.ex)
JvThrow (env.ex);
}
+
+#endif /* INTERPRETER */
Index: include/java-interp.h
===================================================================
RCS file: /cvs/java/libgcj/libjava/include/java-interp.h,v
retrieving revision 1.6
diff -u -r1.6 java-interp.h
--- java-interp.h 2000/02/04 20:49:27 1.6
+++ java-interp.h 2000/02/07 18:49:50
@@ -14,18 +14,6 @@
#include <jvm.h>
#include <java-cpool.h>
-// Base class for method representations. Subclasses are interpreted
-// and JNI methods.
-class _Jv_MethodBase
-{
-protected:
- // The class which defined this method.
- _Jv_InterpClass *defining_class;
-
- // The method description.
- _Jv_Method *self;
-};
-
#ifdef INTERPRETER
#pragma interface
@@ -78,6 +66,18 @@
friend class _Jv_InterpMethod;
};
+// Base class for method representations. Subclasses are interpreted
+// and JNI methods.
+class _Jv_MethodBase
+{
+protected:
+ // The class which defined this method.
+ _Jv_InterpClass *defining_class;
+
+ // The method description.
+ _Jv_Method *self;
+};
+
class _Jv_InterpMethod : public _Jv_MethodBase
{
_Jv_ushort max_stack;
@@ -169,8 +169,6 @@
ffi_type * arg_types[0];
};
-#endif /* INTERPRETER */
-
class _Jv_JNIMethod : public _Jv_MethodBase
{
// The underlying function. If NULL we have to look for the
@@ -185,5 +183,7 @@
friend class _Jv_ClassReader;
friend void _Jv_PrepareClass(jclass);
};
+
+#endif /* INTERPRETER */
#endif /* __JAVA_INTERP_H__ */