Hello all,

I was wondering if any of you have great ideas for how to handle these
opaque structures defined in a typical jni.h.

typedef struct _jfieldID *jfieldID;
typedef struct _jmethodID *jmethodID;

I am currently thinking something like this in jni.h

#include "jni_vm.h"

typedef JFIELD_ID jfieldID;
typedef JMETHOD_ID jmethodID;

-- cut

And in jni_vm.h, place VM specific things like...

#if JVM == GCJ
#define JFIELD_ID void *
#define JMETHOD_ID void *
#endif

#if JVM == ORP
#define JFIELD_ID void *
#define JMETHOD_ID void *
#endif

#if JVM == JAPHAR
#define JFIELD_ID struct FieldStruct *
#define JMETHOD_ID struct MethodStruct *
#endif


Is there a way to avoid this nasty situation or a more elegant
solution?  Like in the Japhar case, now what happens while compiling
and it can't find FieldStruct?  Ugh.  

Brian
-- 
Brian Jones <[EMAIL PROTECTED]>

_______________________________________________
Classpath mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/classpath

Reply via email to