[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

jni.h VM dependencies

From: Brian Jones
Subject: jni.h VM dependencies
Date: 27 Oct 2001 12:08:31 -0400
User-agent: Gnus/5.0803 (Gnus v5.8.3) Emacs/20.7

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 *

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

#define JFIELD_ID struct FieldStruct *
#define JMETHOD_ID struct MethodStruct *

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 Jones <address@hidden>

reply via email to

[Prev in Thread] Current Thread [Next in Thread]