type Logical is new Boolean;
for Logical'Size use Integer'Size;
pragma Convention (Fortran, Logical);
- -- As required by Fortran standard, stand alone logical allocates same
- -- space as integer (but what about the array case???). The convention
- -- is important, since in Fortran, Booleans have zero/non-zero semantics
- -- for False/True, and the pragma Convention (Fortran) activates the
- -- special handling required in this case.
+ -- As required by Fortran standard, logical allocates same space as
+ -- an integer. The convention is important, since in Fortran, Booleans
+ -- are implemented with zero/non-zero semantics for False/True, and the
+ -- pragma Convention (Fortran) activates the special handling required
+ -- in this case.
package Single_Precision_Complex_Types is
new Ada.Numerics.Generic_Complex_Types (Real);
type Fortran_Character is array (Positive range <>) of Character_Set;
+ -- Additional declarations as permitted by Ada 2012, p.608, paragraph 21.
+ -- Interoperability with Fortran 77's vendor extension using star
+ -- notation and Fortran 90's intrinsic types with kind=n parameter.
+ -- The following assumes that `n' matches the byte size, which
+ -- most Fortran compiler, including GCC's follow.
+
+ type Integer_Star_1 is new Integer_8;
+ type Integer_Kind_1 is new Integer_8;
+ type Integer_Star_2 is new Integer_16;
+ type Integer_Kind_2 is new Integer_16;
+ type Integer_Star_4 is new Integer_32;
+ type Integer_Kind_4 is new Integer_32;
+ type Integer_Star_8 is new Integer_64;
+ type Integer_Kind_8 is new Integer_64;
+
+ type Logical_Star_1 is new Boolean;
+ type Logical_Star_2 is new Boolean;
+ type Logical_Star_4 is new Boolean;
+ type Logical_Star_8 is new Boolean;
+ type Logical_Kind_1 is new Boolean;
+ type Logical_Kind_2 is new Boolean;
+ type Logical_Kind_4 is new Boolean;
+ type Logical_Kind_8 is new Boolean;
+ for Logical_Star_1'Size use Integer_8'Size;
+ for Logical_Star_2'Size use Integer_16'Size;
+ for Logical_Star_4'Size use Integer_32'Size;
+ for Logical_Star_8'Size use Integer_64'Size;
+ for Logical_Kind_1'Size use Integer_8'Size;
+ for Logical_Kind_2'Size use Integer_16'Size;
+ for Logical_Kind_4'Size use Integer_32'Size;
+ for Logical_Kind_8'Size use Integer_64'Size;
+ pragma Convention (Fortran, Logical_Star_1);
+ pragma Convention (Fortran, Logical_Star_2);
+ pragma Convention (Fortran, Logical_Star_4);
+ pragma Convention (Fortran, Logical_Star_8);
+ pragma Convention (Fortran, Logical_Kind_1);
+ pragma Convention (Fortran, Logical_Kind_2);
+ pragma Convention (Fortran, Logical_Kind_4);
+ pragma Convention (Fortran, Logical_Kind_8);
+
+ type Real_Star_4 is new Float;
+ type Real_Kind_4 is new Float;
+ type Real_Star_8 is new Long_Float;
+ type Real_Kind_8 is new Long_Float;
+
+ -- In the kind syntax, n is the same as the associated real kind.
+ -- In the star syntax, n is twice as large (real+imaginary size)
+ type Complex_Star_8 is new Complex;
+ type Complex_Kind_4 is new Complex;
+ type Complex_Star_16 is new Double_Complex;
+ type Complex_Kind_8 is new Double_Complex;
+
+ type Character_Kind_n is new Fortran_Character;
+
function To_Fortran (Item : Character) return Character_Set;
function To_Ada (Item : Character_Set) return Character;