This is the mail archive of the java@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: jc1 and different vm langauges


Andrew Haley schrieb:
> Jakob Praher writes:

> Java classes are declared in Java, not in C++.  
Thanks. Yes I am aware of that fact. It is just a matter of
understanding the implications of having a different name mangling for
C++ and Java. This also means that another c++ compiler won't be able to
 use a gcjh generated header to link against a Java so.
Is there a plan to add return types to the C++ name mangling in general?
(anybody aware of such a change for C++0x?)

> 
> The correct way to do this is to generate a C++ header using gcjh,
> which does the right thing:

Yes. I was just wondering, why java::lang::Object is not declared as
extern "Java" in libjava/java/lang/Object.h. Aha but aparently there may
be a forward declaration like in the Foo case below.

Thanks.
-- Jakob
> 
> // DO NOT EDIT THIS FILE - it is machine generated -*- c++ -*-
> 
> #ifndef __Foo__
> #define __Foo__
> 
> #pragma interface
> 
> #include <java/lang/Object.h>
> #include <gcj/array.h>
> 
> extern "Java"
> {
>   class Foo;
> }
> 
> class Foo : public ::java::lang::Object
> {
> public:
>   Foo ();
>   static void main (JArray< ::java::lang::String *> *);
> 
>   static ::java::lang::Class class$;
> };
> 
> #endif /* __Foo__ */
> 
>  > Cause java::lang::Object is too declared outside of extern "Java".
> 
> Andrew.
> 


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