1 ------------------------------------------------------------------------------
3 -- GNAT COMPILER COMPONENTS --
5 -- I N T E R F A C E S . F O R T R A N --
11 -- This specification is adapted from the Ada Reference Manual for use with --
12 -- GNAT. In accordance with the copyright of that document, you can freely --
13 -- copy and modify this specification, provided that if you redistribute a --
14 -- modified version, any changes that you have made are clearly indicated. --
16 ------------------------------------------------------------------------------
18 with Ada.Numerics.Generic_Complex_Types;
19 pragma Elaborate_All (Ada.Numerics.Generic_Complex_Types);
21 package Interfaces.Fortran is
22 pragma Pure (Fortran);
24 type Fortran_Integer is new Integer;
25 type Real is new Float;
26 type Double_Precision is new Long_Float;
28 type Logical is new Boolean;
29 for Logical'Size use Integer'Size;
30 pragma Convention (Fortran, Logical);
31 -- As required by Fortran standard, stand alone logical allocates same
32 -- space as integer (but what about the array case???). The convention
33 -- is important, since in Fortran, Booleans have zero/non-zero semantics
34 -- for False/True, and the pragma Convention (Fortran) activates the
35 -- special handling required in this case.
37 package Single_Precision_Complex_Types is
38 new Ada.Numerics.Generic_Complex_Types (Real);
40 type Complex is new Single_Precision_Complex_Types.Complex;
42 subtype Imaginary is Single_Precision_Complex_Types.Imaginary;
43 i : Imaginary renames Single_Precision_Complex_Types.i;
44 j : Imaginary renames Single_Precision_Complex_Types.j;
46 type Character_Set is new Character;
48 type Fortran_Character is array (Positive range <>) of Character_Set;
50 function To_Fortran (Item : in Character) return Character_Set;
51 function To_Ada (Item : in Character_Set) return Character;
53 function To_Fortran (Item : in String) return Fortran_Character;
54 function To_Ada (Item : in Fortran_Character) return String;
58 Target : out Fortran_Character;
62 (Item : in Fortran_Character;
66 end Interfaces.Fortran;