Actually, I'm not really fond of macros spread over the code. What I would do is create two files, one for the OpenJDK implementation and one for Classpath. They would contain the implementation specific methods. Ideally:<div>
<br></div><div>lib/J3/ClassLib/Classpath/Jni.cpp</div><div>lib/J3/ClassLib/OpenJDK/Jni.cpp</div><div><br></div><div>Or else:</div><div>lib/J3/VMCore/JniOpenJDK.inc</div><div>lib/J3/VMCore/JniClasspath.inc</div><div><br></div>
<div>And at the end of Jni.cpp do:</div><div>#ifdef USE_OPENJDK</div><div>#include "JniOpenJDK.inc"</div><div>#else</div><div>#include "JniClasspath.inc"<br>#endif</div><div><br></div><div>Would that make sense? You can take the approach that suits you best.</div>
<div><br></div><div>Nicolas</div><div> </div><div><div class="gmail_quote">On Tue, Oct 25, 2011 at 12:39 AM, Will Dietz <span dir="ltr"><<a href="mailto:wdietz2@illinois.edu">wdietz2@illinois.edu</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Inlined below.<br>
<br>
~Will<br>
<br>
diff --git a/lib/J3/VMCore/Jni.cpp b/lib/J3/VMCore/Jni.cpp<br>
index 82d2719..48569d8 100644<br>
--- a/lib/J3/VMCore/Jni.cpp<br>
+++ b/lib/J3/VMCore/Jni.cpp<br>
@@ -4036,6 +4036,11 @@ jboolean ExceptionCheck(JNIEnv *env) {<br>
<br>
 jobject NewDirectByteBuffer(JNIEnv *env, void *address, jlong capacity) {<br>
<br>
+#ifdef USE_OPENJDK<br>
+  NYI();<br>
+  abort();<br>
+  return NULL;<br>
+#else<br>
   BEGIN_JNI_EXCEPTION<br>
<br>
   JavaObject* res = 0;<br>
@@ -4065,15 +4070,20 @@ jobject NewDirectByteBuffer(JNIEnv *env, void<br>
*address, jlong capacity) {<br>
<br>
   jobject ret = (jobject)th->pushJNIRef(res);<br>
   RETURN_FROM_JNI(ret);<br>
-<br>
   END_JNI_EXCEPTION<br>
<br>
   RETURN_FROM_JNI(0);<br>
+#endif<br>
 }<br>
<br>
<br>
 void *GetDirectBufferAddress(JNIEnv *env, jobject _buf) {<br>
<br>
+#ifdef USE_OPENJDK<br>
+  NYI();<br>
+  abort();<br>
+  return NULL;<br>
+#else<br>
   BEGIN_JNI_EXCEPTION<br>
<br>
   // Local object references.<br>
@@ -4097,6 +4107,7 @@ void *GetDirectBufferAddress(JNIEnv *env, jobject _buf) {<br>
<br>
   END_JNI_EXCEPTION<br>
   RETURN_FROM_JNI(0);<br>
+#endif<br>
 }<br>
<font color="#888888"><br>
<br>
--<br>
1.7.5.1<br>
_______________________________________________<br>
vmkit-commits mailing list<br>
<a href="mailto:vmkit-commits@cs.uiuc.edu">vmkit-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/vmkit-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/vmkit-commits</a><br>
</font></blockquote></div><br></div>