This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: libgcj/4439: CNI: would be nice to be able to create Java array with 'new'
- To: Ashley Yakeley <ashley at semantic dot org>
- Subject: Re: libgcj/4439: CNI: would be nice to be able to create Java array with 'new'
- From: Bryce McKinlay <bryce at waitaki dot otago dot ac dot nz>
- Date: Wed, 03 Oct 2001 17:13:44 +1200
- CC: bryce at gcc dot gnu dot org, gcc-bugs at gcc dot gnu dot org, gcc-prs at gcc dot gnu dot org, java-prs at gcc dot gnu dot org, nobody at gcc dot gnu dot org, tromey at redhat dot com
- References: <200110030454.VAA13526@mail4.halcyon.com>
Ashley Yakeley wrote:
>>Old Synopsis: extern "Java" support: Can't create array of primitive Java
>>type with 'new'
>>New Synopsis: CNI: would be nice to be able to create Java array with 'new'
>>
>
>This is wrong. I'm not trying to create a Java array, I'm trying to
>create a C array of a Java primitive type, that I can pass to
>GetBooleanArrayRegion as the "jboolean*" parameter:
>
> jboolean* buffer = new jboolean[n]; // compiler fails here
> env->GetBooleanArrayRegion(javaArray,0,n,buffer);
> foo(buffer);
> delete[] buffer;
>
OK. This is a problem with our jni.h: jboolean is declared within an
extern "Java" when building a C++ file.
Tom, can we avoid including gcj/javaprims.h from jni.h?
regards
Bryce.