File : interfac-avr.ads
1 ------------------------------------------------------------------------------
2 -- --
3 -- GNAT COMPILER COMPONENTS --
4 -- --
5 -- I N T E R F A C E S --
6 -- --
7 -- S p e c --
8 -- --
9 -- Copyright (C) 2002-2014, Free Software Foundation, Inc. --
10 -- --
11 -- This specification is derived from the Ada Reference Manual for use with --
12 -- GNAT. The copyright notice above, and the license provisions that follow --
13 -- apply solely to the implementation dependent sections of this file. --
14 -- --
15 -- GNAT is free software; you can redistribute it and/or modify it under --
16 -- terms of the GNU General Public License as published by the Free Soft- --
17 -- ware Foundation; either version 3, or (at your option) any later ver- --
18 -- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
19 -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
20 -- or FITNESS FOR A PARTICULAR PURPOSE. --
21 -- --
22 -- --
23 -- --
24 -- --
25 -- --
26 -- You should have received a copy of the GNU General Public License and --
27 -- a copy of the GCC Runtime Library Exception along with this program; --
28 -- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see --
29 -- <http://www.gnu.org/licenses/>. --
30 -- --
31 -- GNAT was originally developed by the GNAT team at New York University. --
32 -- Extensive contributions were provided by Ada Core Technologies Inc. --
33 -- --
34 ------------------------------------------------------------------------------
35
36 -- This is the AVR version of this package
37
38 package Interfaces is
39 pragma Pure;
40
41 -- All identifiers in this unit are implementation defined
42
43 pragma Implementation_Defined;
44
45 type Integer_8 is range -2 ** 7 .. 2 ** 7 - 1;
46 for Integer_8'Size use 8;
47
48 type Integer_16 is range -2 ** 15 .. 2 ** 15 - 1;
49 for Integer_16'Size use 16;
50
51 type Integer_32 is range -2 ** 31 .. 2 ** 31 - 1;
52 for Integer_32'Size use 32;
53
54 type Integer_64 is range -2 ** 63 .. 2 ** 63 - 1;
55 for Integer_64'Size use 64;
56
57 type Unsigned_8 is mod 2 ** 8;
58 for Unsigned_8'Size use 8;
59 pragma Provide_Shift_Operators (Unsigned_8);
60
61 type Unsigned_16 is mod 2 ** 16;
62 for Unsigned_16'Size use 16;
63 pragma Provide_Shift_Operators (Unsigned_16);
64
65 type Unsigned_32 is mod 2 ** 32;
66 for Unsigned_32'Size use 32;
67 pragma Provide_Shift_Operators (Unsigned_32);
68
69 type Unsigned_64 is mod 2 ** 64;
70 for Unsigned_64'Size use 64;
71 pragma Provide_Shift_Operators (Unsigned_64);
72
73 -- IEEE Floating point types
74
75 type IEEE_Float_32 is digits 6;
76 for IEEE_Float_32'Size use 32;
77
78 -- Note: The following type can't be compiled on AVR, because the
79 -- largest AVR floating-point type is 32 bits. It would be confusing
80 -- and misleading to provide this type on a target without 64-bit
81 -- floating-point support, so it's commented out in the AVR version
82 -- of this unit.
83
84 -- type IEEE_Float_64 is digits 15;
85 -- for IEEE_Float_64;
86
87 -- There is no IEEE extended float available on the machine, but we still
88 -- define the synonym for Long_Long_Float to accomodate code that uses this
89 -- type as a way of specifying the largest available floating-point type.
90
91 -- Note: it is harmless, and explicitly permitted, to include additional
92 -- types in interfaces, so it is not wrong to have IEEE_Extended_Float
93 -- defined even if the extended format is not available.
94
95 type IEEE_Extended_Float is new Long_Long_Float;
96
97 end Interfaces;