Ada Programming/Pragmas/Convention

From Wikibooks, open books for an open world
Jump to navigation Jump to search

Ada. Time-tested, safe and secure.
Ada. Time-tested, safe and secure.

Summary[edit | edit source]

The pragma Convention directs the compiler to represent a type or subprogram using a foreign language convention.

The set of supported foreign languages depends on the compiler implementation. Typically C, C++, COBOL, and Fortran are supported.

Example[edit | edit source]

type My_C_Type is record [...];
-- Ada will represent My_C_Type as a C-style structure.
pragma Convention (C, My_C_Type);

See also[edit | edit source]

Wikibook[edit | edit source]