2002-04-02 David S. Miller <davem@redhat.com>
[official-gcc.git] / gcc / ada / i-fortra.ads
blob4b3dcc9648552c44c36c280c058d399ab7a384ea
1 ------------------------------------------------------------------------------
2 -- --
3 -- GNAT COMPILER COMPONENTS --
4 -- --
5 -- I N T E R F A C E S . F O R T R A N --
6 -- --
7 -- S p e c --
8 -- --
9 -- --
10 -- This specification is adapted from the Ada Reference Manual for use with --
11 -- GNAT. In accordance with the copyright of that document, you can freely --
12 -- copy and modify this specification, provided that if you redistribute a --
13 -- modified version, any changes that you have made are clearly indicated. --
14 -- --
15 ------------------------------------------------------------------------------
17 with Ada.Numerics.Generic_Complex_Types;
18 pragma Elaborate_All (Ada.Numerics.Generic_Complex_Types);
20 package Interfaces.Fortran is
21 pragma Pure (Fortran);
23 type Fortran_Integer is new Integer;
24 type Real is new Float;
25 type Double_Precision is new Long_Float;
27 type Logical is new Boolean;
28 for Logical'Size use Integer'Size;
29 pragma Convention (Fortran, Logical);
30 -- As required by Fortran standard, stand alone logical allocates same
31 -- space as integer (but what about the array case???). The convention
32 -- is important, since in Fortran, Booleans have zero/non-zero semantics
33 -- for False/True, and the pragma Convention (Fortran) activates the
34 -- special handling required in this case.
36 package Single_Precision_Complex_Types is
37 new Ada.Numerics.Generic_Complex_Types (Real);
39 type Complex is new Single_Precision_Complex_Types.Complex;
41 subtype Imaginary is Single_Precision_Complex_Types.Imaginary;
42 i : Imaginary renames Single_Precision_Complex_Types.i;
43 j : Imaginary renames Single_Precision_Complex_Types.j;
45 type Character_Set is new Character;
47 type Fortran_Character is array (Positive range <>) of Character_Set;
49 function To_Fortran (Item : in Character) return Character_Set;
50 function To_Ada (Item : in Character_Set) return Character;
52 function To_Fortran (Item : in String) return Fortran_Character;
53 function To_Ada (Item : in Fortran_Character) return String;
55 procedure To_Fortran
56 (Item : in String;
57 Target : out Fortran_Character;
58 Last : out Natural);
60 procedure To_Ada
61 (Item : in Fortran_Character;
62 Target : out String;
63 Last : out Natural);
65 end Interfaces.Fortran;