Previous: Interfacing to C, Up: Mixed Language Programming


2.10.2 Calling Conventions

GNAT follows standard calling sequence conventions and will thus interface to any other language that also follows these conventions. The following Convention identifiers are recognized by GNAT:

GNAT additionally provides a useful pragma Convention_Identifier that can be used to parametrize conventions and allow additional synonyms to be specified. For example if you have legacy code in which the convention identifier Fortran77 was used for Fortran, you can use the configuration pragma:

        pragma Convention_Identifier (Fortran77, Fortran);

And from now on the identifier Fortran77 may be used as a convention identifier (for example in an Import pragma) with the same meaning as Fortran.