2010-07-27 Paolo Carlini <paolo.carlini@oracle.com>
[official-gcc/alias-decl.git] / gcc / ada / i-fortra.ads
blob992eb28634ceda588e883521fa5c46f29f855fd8
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 -- This specification is derived 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. --
13 -- --
14 ------------------------------------------------------------------------------
16 with Ada.Numerics.Generic_Complex_Types;
17 pragma Elaborate_All (Ada.Numerics.Generic_Complex_Types);
19 package Interfaces.Fortran is
20 pragma Pure;
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 package Double_Precision_Complex_Types is
39 new Ada.Numerics.Generic_Complex_Types (Double_Precision);
41 type Complex is new Single_Precision_Complex_Types.Complex;
43 type Double_Complex is new Double_Precision_Complex_Types.Complex;
45 subtype Imaginary is Single_Precision_Complex_Types.Imaginary;
46 i : Imaginary renames Single_Precision_Complex_Types.i;
47 j : Imaginary renames Single_Precision_Complex_Types.j;
49 type Character_Set is new Character;
51 type Fortran_Character is array (Positive range <>) of Character_Set;
53 function To_Fortran (Item : Character) return Character_Set;
54 function To_Ada (Item : Character_Set) return Character;
56 function To_Fortran (Item : String) return Fortran_Character;
57 function To_Ada (Item : Fortran_Character) return String;
59 procedure To_Fortran
60 (Item : String;
61 Target : out Fortran_Character;
62 Last : out Natural);
64 procedure To_Ada
65 (Item : Fortran_Character;
66 Target : out String;
67 Last : out Natural);
69 end Interfaces.Fortran;