bug 345866 - support OJI for Win64. r/sr=jst

This commit is contained in:
m_kato%ga2.so-net.ne.jp 2006-07-27 16:51:25 +00:00
Родитель 9957032ab8
Коммит 2d193fbd68
4 изменённых файлов: 15 добавлений и 5 удалений

Просмотреть файл

@ -298,7 +298,7 @@ jsj_UnwrapJSObjectWrapper(JNIEnv *jEnv, jobject java_wrapper_obj)
JSObjectHandle *handle;
#ifndef OJI
#if JS_BYTES_PER_LONG == 8
#if JS_BYTES_PER_LONG == 8 || JS_BYTES_PER_WORD == 8
handle = (JSObjectHandle*)((*jEnv)->GetLongField(jEnv, java_wrapper_obj, njJSObject_long_internal));
#else
handle = (JSObjectHandle*)((*jEnv)->GetIntField(jEnv, java_wrapper_obj, njJSObject_internal));
@ -317,7 +317,7 @@ jsj_UnwrapJSObjectWrapper(JNIEnv *jEnv, jobject java_wrapper_obj)
}
else {
jclass cid = (*jEnv)->GetObjectClass(jEnv, java_wrapper_obj);
#if JS_BYTES_PER_LONG == 8
#if JS_BYTES_PER_LONG == 8 || JS_BYTES_PER_WORD == 8
jfieldID fid = (*jEnv)->GetFieldID(jEnv, cid, "nativeJSObject", "J");
handle = (JSObjectHandle*)((*jEnv)->GetLongField(jEnv, java_wrapper_obj, fid));
#else
@ -1331,7 +1331,7 @@ Java_netscape_javascript_JSObject_finalize(JNIEnv *jEnv, jobject java_wrapper_ob
success = JS_FALSE;
#if JS_BYTES_PER_LONG == 8
#if JS_BYTES_PER_LONG == 8 || JS_BYTES_PER_WORD == 8
handle = (JSObjectHandle *)((*jEnv)->GetLongField(jEnv, java_wrapper_obj, njJSObject_long_internal));
#else
handle = (JSObjectHandle *)((*jEnv)->GetIntField(jEnv, java_wrapper_obj, njJSObject_internal));

Просмотреть файл

@ -56,7 +56,7 @@ JS_BEGIN_EXTERN_C
#include "jni.h" /* Java Native Interface */
#include "jsapi.h" /* JavaScript engine API */
#if JS_BYTES_PER_LONG == 8
#if JS_BYTES_PER_LONG == 8 || JS_BYTES_PER_WORD == 8
typedef jlong lcjsobject;
#else
typedef jint lcjsobject;

Просмотреть файл

@ -51,7 +51,17 @@
#include "nsIFactory.h"
#include "jni.h"
/*
* jint is 32 bit, jlong is 64 bit. So we must consider 64-bit platform.
*
* http://java.sun.com/j2se/1.4.2/docs/guide/jni/spec/types.html#wp428
*/
#if JS_BYTES_PER_WORD == 8
typedef jlong jsobject;
#else
typedef jint jsobject;
#endif /* JS_BYTES_PER_WORD == 8 */
class nsISecureLiveconnect : public nsISupports {
public:

Просмотреть файл

@ -114,7 +114,7 @@ public:
SpendTime(PRUint32 timeMillis) = 0;
NS_IMETHOD
#if PR_BYTES_PER_LONG == 8
#if PR_BYTES_PER_LONG == 8 || PR_BYTES_PER_WORD == 8
UnwrapJavaWrapper(JNIEnv* jenv, jobject jobj, jlong* obj) = 0;
#else
UnwrapJavaWrapper(JNIEnv* jenv, jobject jobj, jint* obj) = 0;