outmethod.println("#include \"methodheaders.h\"");
outmethod.println("#include \"virtualtable.h\"");
outmethod.println("#include \"runtime.h\"");
+ outmethod.println("#include \"jni-private.h\"");
// always include: compiler directives will leave out
// instrumentation when option is not set
}
}
if (GENERATEPRECISEGC) {
- outmethod.println("stopforgc((struct garbagelist *)___params___)");
+ outmethod.println("stopforgc((struct garbagelist *)___params___);");
}
- if (md.getReturnType()!=null) {
+ if (!md.getReturnType().isVoid()) {
if (md.getReturnType().isPtr())
outmethod.print("jobject retval=");
else
}
outmethod.println(");");
if (GENERATEPRECISEGC) {
- outmethod.println("restartaftergc()");
+ outmethod.println("restartaftergc();");
}
- if (md.getReturnType()!=null) {
+ if (!md.getReturnType().isVoid()) {
if (md.getReturnType().isPtr()) {
outmethod.println("struct ___Object___ * retobj=JNIUNWRAP(retval);");
outmethod.println("JNIPOPFRAME();");
outmethod.println("JNIPOPFRAME();");
outmethod.println("return retval;");
}
- }
+ } else
+ outmethod.println("JNIPOPFRAME();");
+
outmethod.println("}");
+ outmethod.println("");
}
protected void generateFlatMethod(FlatMethod fm, PrintWriter output) {
char *fieldname;
};
-struct _jobject {
+struct __jobject {
void * ref;
};
struct jnireferences {
struct jnireferences * next;
int index;
- struct _jobject array[MAXJNIREFS];
+ struct __jobject array[MAXJNIREFS];
};
#ifndef MAC
-struct _jobject * getwrapped(void * objptr);
+struct __jobject * getwrapper(void * objptr);
void jnipushframe();
void jnipopframe();
extern __thread struct jnireferences * jnirefs;
#ifndef MAC
__thread struct jnireferences * jnirefs;
-struct _jobject * getwrapped(void * objptr) {
+struct __jobject * getwrapper(void * objptr) {
if ((jnirefs->index)>=MAXJNIREFS)
printf("OVERFLOW IN JOBJECT\n");
- struct _jobject *ptr=&jnirefs->array[jnirefs->index++];
+ struct __jobject *ptr=&jnirefs->array[jnirefs->index++];
ptr->ref=objptr;
return ptr;
}