C++ code for other compilers |
Top Previous Next |
Pretranslated C++ code > Delphi RTL/VCL > C++ code for other compilers There is only one version of RTL C++ code for all compilers other then C++Builder. This is possible, because this code is based on the standard library. However, there is a special extension in Visual C++ to define property getters and setters. These definitions also exist in the RTL code, but are initially commented out so that they do not affect compilers other than Visual C++. Commenting is done using the expression VC_ONLY defined as a line comment. For example:
int ReadPropertyCapacity() const {return FCapacity;} void WritePropertyCapacity(int NewCapacity){SetCapacity(NewCapacity);} VC_ONLY __declspec(property(get = ReadPropertyCapacity, put = WritePropertyCapacity)) int Capacity;
If the definition of VC_ONLY as comment is replace by the empty definition:
#define VC_ONLY
the specific Visual C++ properties are enabled.If Visual C++ is set as target compiler, the resulting code will use these properties.
The code for Visual C++ and other compilers is in the folder (if installed as suggested):
C:\Users\[USER]\Documents\Delphi2Cpp\d2c_vc
(The postfix _vc allows possible future parallel installation of special code variants for other compilers.)
The code consists in .cpp and .h files with the following names. The names denote the subject of the files. The most important of these files is d2c_system, which provides basic functions like "High" and "Succ" etc. The other files also are supplementing missing parts of System.pas and other helper functions. The include directives of needed files are inserted into the generated code automatically by Delphi2Cpp.
The complete code also contains:
and an rtl-folder with the pre-translated files of the Delphi RTL |
This page belongs to the Delphi2Cpp Documentation |
Delphi2Cpp home Content |