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