Improvements for cppclass + first test
Original Reporter info from Mantis: PascalDragon @PascalDragon
-
Reporter name: Sven Barth
Original Reporter info from Mantis: PascalDragon @PascalDragon
- Reporter name: Sven Barth
Description:
I proudly present the first improvements for linking with C++ classes since years.
Compiler now supports this syntax:
MyTestClass = cppclass
procedure Foo;
end; external 'foolib' name 'BarClass';
The name of the library and the name for the class are optional.
(renaming a method is not yet supported)
Also I updated the name mangling for GCC 3+ type names and added support for floating point parameters.
I also added a first test which tests the name mangling and static linking (contained in the tar.gz file).
Additional information:
Attached:
- patch for the compiler itself
- archive for the test
The archive contains:
- patch for tests/Makefile.fpc (to copy the object file to its destination)
- cpptestclass.cpp (should be put into tests/test/cg/obj)
- cpptestclass.o (should be put into tests/test/cg/obj/linux/i386)
- tcppclass1.pp (should be put into tests/test/cg - that's where the .o file is copied to)
The test is currently set to compile only on i386-linux.
The name mangling must be tested on 64-bit CPUs, because gcc follows a different approach on 64-bit as FPC (e. g. sizeof(long) != sizeof(int) on x86_64). I have a 64-bit CPU, but currently no such OS running on it.
Mantis conversion info:
- Mantis ID: 15082
- OS: Linux
- OS Build: 2.6.31
- Platform: i386
- Version: 2.5.1
- Fixed in version: 2.6.0
- Fixed in revision: 14185 (#60a9ef96)
- Monitored by: » mspiller (mspiller)