1 ------------------------------------------------------------------------------
3 -- GNAT COMPILER COMPONENTS --
9 -- Copyright (C) 1992-2004 Free Software Foundation, Inc. --
11 -- GNAT is free software; you can redistribute it and/or modify it under --
12 -- terms of the GNU General Public License as published by the Free Soft- --
13 -- ware Foundation; either version 2, or (at your option) any later ver- --
14 -- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
15 -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
16 -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
17 -- for more details. You should have received a copy of the GNU General --
18 -- Public License distributed with GNAT; see file COPYING. If not, write --
19 -- to the Free Software Foundation, 51 Franklin Street, Fifth Floor, --
20 -- Boston, MA 02110-1301, USA. --
22 -- GNAT was originally developed by the GNAT team at New York University. --
23 -- Extensive contributions were provided by Ada Core Technologies Inc. --
25 ------------------------------------------------------------------------------
27 -- This package provides an Import to the C functions which provide
28 -- values related to types on the target system. It is only needed for
29 -- exp_dbug and the elaboration of ttypes.
31 -- NOTE: Any changes in this package must be reflected in jgettarg.ads
34 -- Note that all these values return sizes of C types with corresponding
35 -- names. This allows GNAT to define the corresponding Ada types to have
36 -- the same representation. There is one exception to this: the
37 -- Wide_Character_Type uses twice the size of a C char, instead of the
40 with Types
; use Types
;
43 pragma Preelaborate
(Get_Targ
);
45 function Get_Bits_Per_Unit
return Pos
;
46 pragma Import
(C
, Get_Bits_Per_Unit
, "get_target_bits_per_unit");
48 function Get_Bits_Per_Word
return Pos
;
49 pragma Import
(C
, Get_Bits_Per_Word
, "get_target_bits_per_word");
51 function Get_Char_Size
return Pos
; -- Standard.Character'Size
52 pragma Import
(C
, Get_Char_Size
, "get_target_char_size");
54 function Get_Wchar_T_Size
return Pos
; -- Interfaces.C.wchar_t'Size
55 pragma Import
(C
, Get_Wchar_T_Size
, "get_target_wchar_t_size");
57 function Get_Short_Size
return Pos
; -- Standard.Short_Integer'Size
58 pragma Import
(C
, Get_Short_Size
, "get_target_short_size");
60 function Get_Int_Size
return Pos
; -- Standard.Integer'Size
61 pragma Import
(C
, Get_Int_Size
, "get_target_int_size");
63 function Get_Long_Size
return Pos
; -- Standard.Long_Integer'Size
64 pragma Import
(C
, Get_Long_Size
, "get_target_long_size");
66 function Get_Long_Long_Size
return Pos
; -- Standard.Long_Long_Integer'Size
67 pragma Import
(C
, Get_Long_Long_Size
, "get_target_long_long_size");
69 function Get_Float_Size
return Pos
; -- Standard.Float'Size
70 pragma Import
(C
, Get_Float_Size
, "get_target_float_size");
72 function Get_Double_Size
return Pos
; -- Standard.Long_Float'Size
73 pragma Import
(C
, Get_Double_Size
, "get_target_double_size");
75 function Get_Long_Double_Size
return Pos
; -- Standard.Long_Long_Float'Size
76 pragma Import
(C
, Get_Long_Double_Size
, "get_target_long_double_size");
78 function Get_Pointer_Size
return Pos
; -- System.Address'Size
79 pragma Import
(C
, Get_Pointer_Size
, "get_target_pointer_size");
81 function Get_Maximum_Alignment
return Pos
;
82 pragma Import
(C
, Get_Maximum_Alignment
, "get_target_maximum_alignment");
84 function Get_Float_Words_BE
return Nat
;
85 pragma Import
(C
, Get_Float_Words_BE
, "get_float_words_be");
87 function Get_Words_BE
return Nat
;
88 pragma Import
(C
, Get_Words_BE
, "get_words_be");
90 function Get_Bytes_BE
return Nat
;
91 pragma Import
(C
, Get_Bytes_BE
, "get_bytes_be");
93 function Get_Bits_BE
return Nat
;
94 pragma Import
(C
, Get_Bits_BE
, "get_bits_be");
96 function Get_Strict_Alignment
return Nat
;
97 pragma Import
(C
, Get_Strict_Alignment
, "get_strict_alignment");
99 function Get_Max_Unaligned_Field
return Pos
;
100 -- Returns the maximum supported size in bits for a field that is
101 -- not aligned on a storage unit boundary.
103 function Width_From_Size
(Size
: Pos
) return Pos
;
104 function Digits_From_Size
(Size
: Pos
) return Pos
;
105 -- Calculate values for 'Width or 'Digits from 'Size