From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1449 invoked by alias); 2 Aug 2003 09:36:42 -0000 Mailing-List: contact eclipse-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: eclipse-owner@sources.redhat.com Received: (qmail 1439 invoked from network); 2 Aug 2003 09:36:38 -0000 Subject: Natively compiled eclipse c++ dependency patch From: Mark Wielaard To: eclipse@sources.redhat.com Content-Type: multipart/mixed; boundary="=-nVeABWhmm75lTsJOKcT8" Organization: Message-Id: <1059816996.11511.31.camel@elsschot.wildebeest.org> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 (1.2.2-5) Date: Sat, 02 Aug 2003 09:36:00 -0000 X-SW-Source: 2003-q3/txt/msg00002.txt.bz2 --=-nVeABWhmm75lTsJOKcT8 Content-Type: text/plain Content-Transfer-Encoding: 7bit Content-length: 511 Hi, This is really awesome! Really fast and snappy. Great work guys! While trying to build from source I noticed that although there is no build dependencies on g++ there is one c++ file in the build. Since it is a simple JNI implementation it can be easily rewritten to use just plain C. Attached is a patch for the build.xml file and the update.cpp file (you will have to also rename the patched update.cpp file to update.c). Apply inside the plugins/org.eclipse.update.core.linux/src/ dir. Cheers, Mark --=-nVeABWhmm75lTsJOKcT8 Content-Disposition: inline; filename=patch Content-Type: text/plain; name=patch; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-length: 3529 --- build.xml.orig 2003-08-02 09:55:08.000000000 +0200 +++ build.xml 2003-08-02 09:55:39.000000000 +0200 @@ -58,8 +58,8 @@ - - + + --- update.cpp 2003-08-02 09:54:56.000000000 +0200 +++ update.c 2003-08-02 10:05:23.000000000 +0200 @@ -32,10 +32,10 @@ jlong result = org_eclipse_update_configuration_LocalSystemInfo_SIZE_UNKNOWN; // first, obtain the Path from the java.io.File parameter - cls = jnienv -> GetObjectClass(file); - id = jnienv -> GetMethodID(cls, "getAbsolutePath", "()Ljava/lang/String;"); - obj = jnienv -> CallObjectMethod(file, id); - lpDirectoryName = jnienv -> GetStringUTFChars((jstring) obj, 0); + cls = (*jnienv) -> GetObjectClass(jnienv, file); + id = (*jnienv) -> GetMethodID(jnienv, cls, "getAbsolutePath", "()Ljava/lang/String;"); + obj = (*jnienv) -> CallObjectMethod(jnienv, file, id); + lpDirectoryName = (*jnienv) -> GetStringUTFChars(jnienv, (jstring) obj, 0); // cast one argument as jlong to have a jlong result int err = statfs(lpDirectoryName,&buffer); @@ -67,10 +67,10 @@ const char * lpDirectoryName; // obtain the String from the parameter - cls = jnienv -> GetObjectClass(file); - id = jnienv -> GetMethodID(cls, "getAbsolutePath", "()Ljava/lang/String;"); - obj = jnienv -> CallObjectMethod(file, id); - lpDirectoryName = jnienv -> GetStringUTFChars((jstring) obj, 0); + cls = (*jnienv) -> GetObjectClass(jnienv, file); + id = (*jnienv) -> GetMethodID(jnienv, cls, "getAbsolutePath", "()Ljava/lang/String;"); + obj = (*jnienv) -> CallObjectMethod(jnienv, file, id); + lpDirectoryName = (*jnienv) -> GetStringUTFChars(jnienv, (jstring) obj, 0); jstring result = NULL; @@ -98,10 +98,10 @@ const char * lpDirectoryName; // obtain the String from the parameter - cls = jnienv -> GetObjectClass(file); - id = jnienv -> GetMethodID(cls, "getAbsolutePath", "()Ljava/lang/String;"); - obj = jnienv -> CallObjectMethod(file, id); - lpDirectoryName = jnienv -> GetStringUTFChars((jstring) obj, 0); + cls = (*jnienv) -> GetObjectClass(jnienv, file); + id = (*jnienv) -> GetMethodID(jnienv, cls, "getAbsolutePath", "()Ljava/lang/String;"); + obj = (*jnienv) -> CallObjectMethod(jnienv, file, id); + lpDirectoryName = (*jnienv) -> GetStringUTFChars(jnienv, (jstring) obj, 0); int result; @@ -136,17 +136,18 @@ // find mount points drive = 0; - stringClass = jnienv -> FindClass("java/lang/String"); - empty = jnienv -> NewStringUTF(""); - //returnArray = jnienv -> NewObjectArray(nDrive, stringClass, empty); + stringClass = (*jnienv) -> FindClass(jnienv, "java/lang/String"); + empty = (*jnienv) -> NewStringUTF(jnienv, ""); + //returnArray = (*jnienv) -> NewObjectArray(jnienv, nDrive, stringClass, empty); // for now return null as method is not implemented returnArray = NULL; - for (int i = 0; i < drive; i++) { + int i; + for (i = 0; i < drive; i++) { // Linux implementation, create String for each mount point - str = jnienv -> NewStringUTF(driveName); - jnienv -> SetObjectArrayElement(returnArray, index, str); + str = (*jnienv) -> NewStringUTF(jnienv, driveName); + (*jnienv) -> SetObjectArrayElement(jnienv, returnArray, index, str); index++; } --=-nVeABWhmm75lTsJOKcT8--