Board index » kylix » Re: OpenCLX release

Re: OpenCLX release


2004-04-09 10:25:48 PM
kylix1
theo wrote:
Quote
Marc Collin

I really wonder why you waste your time in the Kylix Forums.
to laugh at the clodo in your kind
--
Borland rulez pages.infinit.net/borland
 
 

Re:Re: OpenCLX release

Quote

GTK is C framework, GTK+ is C++.

Is there something special about GTK, or is there a clear ABI used by
Gnu C++ 3.x (compiler and linker) that can be used. What might be the
cause that Lazarus/Free pascal don't use it ?
Quote
And Kylix can link against GTK the same as FreePascal can. The difference
for the C++ ABI is that FreePascal has 3 dwords in front of the first
virtual method in the VMT and all TObject virtual methods have positive
VMT indices.
Why do they do this and can / will they change it to gain Gnu C++
compatibility ?
Quote
That could be worked around by using the "object" keyword.
But there FreePascal has the 3 dwords too.
Why do they do this and can / will they change it to gain Gnu C++
compatibility ?
Quote
Kylix does not have these 3
dwords and gcc 3.x doesn't have them, too. So it is easier to map a Kylix
object to a gcc class than a FreePascal object/class to a gcc class.

Want means "map", who would do that ? Do you think of some software
"compiling" the binary object format into Gnu format ?
-Michael
 

Re:Re: OpenCLX release

Michael Schnell wrote:
Quote
Is there something special about GTK, or is there a clear ABI used by
Gnu C++ 3.x (compiler and linker) that can be used. What might be the
cause that Lazarus/Free pascal don't use it ?
How far I know is the GTK+ nothing else than a collection of C++ classes
that call the GTK functions.
Quote
>And Kylix can link against GTK the same as FreePascal can. The
>difference for the C++ ABI is that FreePascal has 3 dwords in front of
>the first virtual method in the VMT and all TObject virtual methods
>have positive VMT indices.

Why do they do this and can / will they change it to gain Gnu C++
compatibility ?
This question should go tho the free pascal developers.
Quote
>That could be worked around by using the "object" keyword.
>But there FreePascal has the 3 dwords too.

Why do they do this and can / will they change it to gain Gnu C++
compatibility ?
This question should go tho the free pascal developers.
Quote
Do you think of some software "compiling" the binary
object format into Gnu format ?
No.
Quote
>Kylix does not have these 3
>dwords and gcc 3.x doesn't have them, too. So it is easier to map a
>Kylix object to a gcc class than a FreePascal object/class to a gcc
>class.

Want means "map", who would do that ?
I mean something like this:
----------------------------
class CTest {
int field1;
char* field2;
protected:
virtual void test();
}
----------------------------
CTest = object
private
field1: Integer;
field2: Integer;
protected
procedure DefDestructor1(Mode: Integer); virtual; cdecl;
procedure DefDestructor2(Mode: Integer); virtual; cdecl;
procedure DefDestructor3(Mode: Integer); virtual; cdecl;
procedure test(); virtual; cdecl;
end;
procedure CTest.DefDestructor1(Mode: Integer); external Lib name
CTest_x1_CTest;
procedure CTest.DefDestructor2(Mode: Integer); external Lib name
CTest_x2_CTest;
procedure CTest.DefDestructor3(Mode: Integer); external Lib name
CTest_x3_CTest;
procedure CTest.test(); external Lib name CTest__test;
----------------------------
For freepascal you must modify the VMT and you have loose the first 3
virtual methods because they are where the 3 dwords are.
--
Regards,
Andreas Hausladen
(www.kylix-patch.de.vu - unofficial Kylix 3 patches)
 

{smallsort}

Re:Re: OpenCLX release

do you think that a translation wxWidgets C++ to ObjectPascal
could be done ? in an automated way ?
(there is OpenCToPas project on SF)
Regards
Olivier
Andreas Hausladen a écrit:
Quote
Michael Schnell wrote:


>Is there something special about GTK, or is there a clear ABI used by
>Gnu C++ 3.x (compiler and linker) that can be used. What might be the
>cause that Lazarus/Free pascal don't use it ?


How far I know is the GTK+ nothing else than a collection of C++ classes
that call the GTK functions.



>>And Kylix can link against GTK the same as FreePascal can. The
>>difference for the C++ ABI is that FreePascal has 3 dwords in front of
>>the first virtual method in the VMT and all TObject virtual methods
>>have positive VMT indices.
>
>Why do they do this and can / will they change it to gain Gnu C++
>compatibility ?


This question should go tho the free pascal developers.


>>That could be worked around by using the "object" keyword.
>>But there FreePascal has the 3 dwords too.
>
>Why do they do this and can / will they change it to gain Gnu C++
>compatibility ?


This question should go tho the free pascal developers.



>Do you think of some software "compiling" the binary
>object format into Gnu format ?


No.



>>Kylix does not have these 3
>>dwords and gcc 3.x doesn't have them, too. So it is easier to map a
>>Kylix object to a gcc class than a FreePascal object/class to a gcc
>>class.
>
>Want means "map", who would do that ?


I mean something like this:
----------------------------
class CTest {
int field1;
char* field2;
protected:
virtual void test();
}
----------------------------
CTest = object
private
field1: Integer;
field2: Integer;
protected
procedure DefDestructor1(Mode: Integer); virtual; cdecl;
procedure DefDestructor2(Mode: Integer); virtual; cdecl;
procedure DefDestructor3(Mode: Integer); virtual; cdecl;

procedure test(); virtual; cdecl;
end;

procedure CTest.DefDestructor1(Mode: Integer); external Lib name
CTest_x1_CTest;
procedure CTest.DefDestructor2(Mode: Integer); external Lib name
CTest_x2_CTest;
procedure CTest.DefDestructor3(Mode: Integer); external Lib name
CTest_x3_CTest;
procedure CTest.test(); external Lib name CTest__test;
----------------------------

For freepascal you must modify the VMT and you have loose the first 3
virtual methods because they are where the 3 dwords are.


 

Re:Re: OpenCLX release

honey wrote:
Quote
do you think that a translation wxWidgets C++ to ObjectPascal
could be done ? in an automated way ?
(there is OpenCToPas project on SF)
I have not looked into the wxWidget code so I cannot say anything about
this. But the more templates and macros are used in wxWidgets the more
complicated would it be to translate to pascal.
--
Regards,
Andreas Hausladen
(www.kylix-patch.de.vu - unofficial Kylix 3 patches)
 

Re:Re: OpenCLX release

Quote
>Why do they do this and can / will they change it to gain Gnu C++
>compatibility ?

This question should go tho the free pascal developers.

I did ask.
On www.freepascal.org/future.html they state that it's planned
foe a "later" version, but not the next major.
-Michael
 

Re:Re: OpenCLX release

Quote
For freepascal you must modify the VMT and you have loose the first 3
virtual methods because they are where the 3 dwords are.

I see. You think of modifying the VMS by the user software at runtime
and not before linking.
-Michael
 

Re:Re: OpenCLX release

Michael Schnell wrote:
Quote
I see. You think of modifying the VMS by the user software at runtime
and not before linking.
I had done this for gcc 2.95 (old C++ ABI) but there was the situation
upside down. The gcc had two dwords more in the VT (virtual table) and
this could be easiely worked around by simply introducing two dummy
virtual methods to an Delphi object and class.
--
Regards,
Andreas Hausladen
(www.kylix-patch.de.vu - unofficial Kylix 3 patches)