$HppEmit Compiler Directive
Use the
$HppEmit
compiler directive to write String
in the
.hpp file for C++ Builder. The string is written
to the user-supplied section at the top of the file. All the
$HppEmit
strings appear in the same order as their
appearance in the .pas
file.
You can use $HppEmit
to include any text you want
in the .hpp file, from additional
#include
directives to type declarations.
type TComplex = record Re, Im: Double; end; // Define the structure differently in C++. // Note the use of { and } in the HppEmit code, which would interfere // in Pascal comments that use { and } because the comments do not // recognize quoted strings. Use (* and *) instead. {$ExternalSym TComplex} (*$HppEmit 'struct TComplex {'*) (*$HppEmit ' double Re;'*) (*$HppEmit ' double Im;'*) (*$HppEmit ' TComplex(double r=0, double i=0) : Re(r), Im(i) {}'*) (*$HppEmit '};'*)