This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: libgcj/4439: CNI: would be nice to be able to create Java array with 'new'


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.



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]