Delphi RTL/VCL

Top  Previous  Next

Pretranslated C++ code > Delphi RTL/VCL

 

There is some ready to use C++ code translated from the free pascal sources:

 

http://www.freepascal.org/

 

This code covers

 

missing parts of Delphi's System.pas for C++Builder and
most parts of the System unit and the Sysutils.unit for Visual C++
most parts of the System unit and the Sysutils.unit for Linux

 

 

Other units of the VCl can be translated with Delphi2Cpp, but an automatic translation just of these two files is insufficient, firstly because the System.pas is incomplete and secondly because they depend on assembler code and on calls of API functions of the operating System. It would be nonsense to retranslate the Delphi adaptations to the C++ Windows or Linux API back to C++.

 

 

Restrictions

 

The code was made originally by automatic translation with a special version of Delphi2Cpp: FreePascal2Cpp. Some parts of the generated C++ code were improved manually. Large parts were tested and are working well, but there isn't any guarantee that the code is completely bug-free. There is no translation for the Variant class and only a minimal implementation of a Currency class. The formatting of real types in free pascal depend on a special binary layout of that types. The formatting couldn't be reproduced exactly. Free pascal uses Mersenne twister for the generation of random numbers.This part was not translated back to C++ because there are a lot of C++ implementations of Mersenne twister in C++

 

http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/VERSIONS/C-LANG/c-lang.html

 

Currently a primitive random generator based on C++ standard functions is used. Such standard function were preferred to direct translations of Delphi functions at other places too. So there might be slight differences to the original Delphi behavior. For example the error position returned in the Code-parameter of the Val procedure, is a dummy only in C++.

 

Despite of these restrictions for many users this provided C++ code will make the migration of their Delphi code much easier.

 

 

Other operating systems and compilers

 

Though free pascal is made fur use on many different operating systems, the translation here is for Visual C++ under Windows and gcc under Linux only. Of course it would be desirable if the translation would cover all other operating systems and compilers too. But that's much effort and it has to be doubted that somebody wants to produce C++ code e.g. for OS2 or Amiga  with a Delphi2Cpp. In addition it is not desirable to reproduce the complicated folder structure in which the free pascal code is organized. It was a lot of work to find just the needed parts of code for Windows and Linux in the in the scattered files. Ohter parts of the free pascal sources can be translated on demand.

 

 

 

 

 



This page belongs to the Delphi2Cpp Documentation

Delphi2Cpp home  Content