aboutsummaryrefslogtreecommitdiff
path: root/libjava
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2002-12-03 03:54:05 +0000
committerTom Tromey <tromey@gcc.gnu.org>2002-12-03 03:54:05 +0000
commit35e058a2b83dee2fa1cbeebc226cc9a05b9ad6ef (patch)
treee88c434e261f873cba99d19463d6a8f2f3fdb600 /libjava
parente8a68017b07181dfe3451ec65cf4c4f979f4fc3c (diff)
downloadgcc-35e058a2b83dee2fa1cbeebc226cc9a05b9ad6ef.zip
gcc-35e058a2b83dee2fa1cbeebc226cc9a05b9ad6ef.tar.gz
gcc-35e058a2b83dee2fa1cbeebc226cc9a05b9ad6ef.tar.bz2
jni.cc: Added `name' argument.
* jni.cc: Added `name' argument. * include/jni.h (struct JNINativeInterface) [DefineClass]: Added `const char *' argument. (class _Jv_JNIEnv) [DefineClass]: Likewise. From-SVN: r59756
Diffstat (limited to 'libjava')
-rw-r--r--libjava/ChangeLog7
-rw-r--r--libjava/include/jni.h14
-rw-r--r--libjava/jni.cc5
3 files changed, 18 insertions, 8 deletions
diff --git a/libjava/ChangeLog b/libjava/ChangeLog
index 894f006..cdf7851 100644
--- a/libjava/ChangeLog
+++ b/libjava/ChangeLog
@@ -1,3 +1,10 @@
+2002-12-02 Tom Tromey <tromey@redhat.com>
+
+ * jni.cc: Added `name' argument.
+ * include/jni.h (struct JNINativeInterface) [DefineClass]: Added
+ `const char *' argument.
+ (class _Jv_JNIEnv) [DefineClass]: Likewise.
+
2002-12-01 Tom Tromey <tromey@redhat.com>
Bug compatibility, for PR libgcj/8738:
diff --git a/libjava/include/jni.h b/libjava/include/jni.h
index 0b98ab2..31f5798 100644
--- a/libjava/include/jni.h
+++ b/libjava/include/jni.h
@@ -249,14 +249,15 @@ struct JNINativeInterface
_Jv_func reserved3;
jint (JNICALL *GetVersion) (JNIEnv *);
- jclass (JNICALL *DefineClass) (JNIEnv *, jobject,
- const jbyte *, jsize);
+ jclass (JNICALL *DefineClass) (JNIEnv *, const char *,
+ jobject, const jbyte *,
+ jsize);
jclass (JNICALL *FindClass) (JNIEnv *, const char *);
jmethodID (JNICALL *FromReflectedMethod) (JNIEnv *, jobject);
jfieldID (JNICALL *FromReflectedField) (JNIEnv *, jobject);
- jobject (JNICALL *ToReflectedMethod) (JNIEnv *, jclass, jmethodID,
- jboolean);
+ jobject (JNICALL *ToReflectedMethod) (JNIEnv *, jclass,
+ jmethodID, jboolean);
jclass (JNICALL *GetSuperclass) (JNIEnv *, jclass);
jboolean (JNICALL *IsAssignableFrom) (JNIEnv *, jclass, jclass);
@@ -687,8 +688,9 @@ public:
jint GetVersion ()
{ return p->GetVersion (this); }
- jclass DefineClass (jobject obj0, const jbyte * val1, jsize val2)
- { return p->DefineClass (this, obj0, val1, val2); }
+ jclass DefineClass (const char *name, jobject obj0, const jbyte * val1,
+ jsize val2)
+ { return p->DefineClass (this, name, obj0, val1, val2); }
jclass FindClass (const char * val0)
{ return p->FindClass (this, val0); }
diff --git a/libjava/jni.cc b/libjava/jni.cc
index 44ea411..b841b4f 100644
--- a/libjava/jni.cc
+++ b/libjava/jni.cc
@@ -428,13 +428,14 @@ static jint
}
static jclass
-(JNICALL _Jv_JNI_DefineClass) (JNIEnv *env, jobject loader,
+(JNICALL _Jv_JNI_DefineClass) (JNIEnv *env, const char *name, jobject loader,
const jbyte *buf, jsize bufLen)
{
try
{
loader = unwrap (loader);
+ jstring sname = JvNewStringUTF (name);
jbyteArray bytes = JvNewByteArray (bufLen);
jbyte *elts = elements (bytes);
@@ -443,7 +444,7 @@ static jclass
java::lang::ClassLoader *l
= reinterpret_cast<java::lang::ClassLoader *> (loader);
- jclass result = l->defineClass (bytes, 0, bufLen);
+ jclass result = l->defineClass (sname, bytes, 0, bufLen);
return (jclass) wrap_value (env, result);
}
catch (jthrowable t)