Previous: Interfacing to Fortran, Up: Interfacing to Other Languages
It is possible to specify the convention Ada
in a pragma Import
or
pragma Export
. However this refers to the calling conventions used
by GNAT, which may or may not be similar enough to those used by
some other Ada 83 or Ada 95 compiler to allow interoperation.
If arguments types are kept simple, and if the foreign compiler generally follows system calling conventions, then it may be possible to integrate files compiled by other Ada compilers, provided that the elaboration issues are adequately addressed (for example by eliminating the need for any load time elaboration).
In particular, GNAT running on VMS is designed to be highly compatible with the DEC Ada 83 compiler, so this is one case in which it is possible to import foreign units of this type, provided that the data items passed are restricted to simple scalar values or simple record types without variants, or simple array types with fixed bounds.