Previous: A Simple Example, Up: Building Mixed Ada & C++ Programs


2.11.4 Adapting the Run Time to a New C++ Compiler

GNAT offers the capability to derive Ada 95 tagged types directly from preexisting C++ classes and . See "Interfacing with C++" in the GNAT reference manual. The mechanism used by GNAT for achieving such a goal has been made user configurable through a GNAT library unit Interfaces.CPP. The default version of this file is adapted to the GNU c++ compiler. Internal knowledge of the virtual table layout used by the new C++ compiler is needed to configure properly this unit. The Interface of this unit is known by the compiler and cannot be changed except for the value of the constants defining the characteristics of the virtual table: CPP_DT_Prologue_Size, CPP_DT_Entry_Size, CPP_TSD_Prologue_Size, CPP_TSD_Entry_Size. Read comments in the source of this unit for more details.