2015-03-04 Robert Dewar <dewar@adacore.com>
[official-gcc.git] / gcc / ada / i-cexten.ads
blobe256dec22ba0515547bef331a97961b4345a6a43
1 ------------------------------------------------------------------------------
2 -- --
3 -- GNAT COMPILER COMPONENTS --
4 -- --
5 -- I N T E R F A C E S . C . E X T E N S I O N S --
6 -- --
7 -- S p e c --
8 -- --
9 -- Copyright (C) 1992-2013, Free Software Foundation, Inc. --
10 -- --
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 3, 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. --
17 -- --
18 -- As a special exception under Section 7 of GPL version 3, you are granted --
19 -- additional permissions described in the GCC Runtime Library Exception, --
20 -- version 3.1, as published by the Free Software Foundation. --
21 -- --
22 -- You should have received a copy of the GNU General Public License and --
23 -- a copy of the GCC Runtime Library Exception along with this program; --
24 -- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see --
25 -- <http://www.gnu.org/licenses/>. --
26 -- --
27 -- GNAT was originally developed by the GNAT team at New York University. --
28 -- Extensive contributions were provided by Ada Core Technologies Inc. --
29 -- --
30 ------------------------------------------------------------------------------
32 -- This package contains additional C-related definitions, intended for use
33 -- with either manually or automatically generated bindings to C libraries.
35 with System;
37 package Interfaces.C.Extensions is
38 pragma Pure;
40 -- Definitions for C "void" and "void *" types
42 subtype void is System.Address;
43 subtype void_ptr is System.Address;
45 -- Definitions for C incomplete/unknown structs
47 subtype opaque_structure_def is System.Address;
48 type opaque_structure_def_ptr is access opaque_structure_def;
49 for opaque_structure_def_ptr'Storage_Size use 0;
51 -- Definitions for C++ incomplete/unknown classes
53 subtype incomplete_class_def is System.Address;
54 type incomplete_class_def_ptr is access incomplete_class_def;
55 for incomplete_class_def_ptr'Storage_Size use 0;
57 -- C bool
59 subtype bool is plain_char;
61 -- 64-bit integer types
63 subtype long_long is Long_Long_Integer;
64 type unsigned_long_long is mod 2 ** 64;
66 -- 128-bit integer type available on 64-bit platforms:
67 -- typedef int signed_128 __attribute__ ((mode (TI)));
69 type Signed_128 is record
70 low, high : unsigned_long_long;
71 end record;
72 pragma Convention (C_Pass_By_Copy, Signed_128);
73 for Signed_128'Alignment use unsigned_long_long'Alignment * 2;
75 -- Types for bitfields
77 type Unsigned_1 is mod 2 ** 1;
78 for Unsigned_1'Size use 1;
80 type Unsigned_2 is mod 2 ** 2;
81 for Unsigned_2'Size use 2;
83 type Unsigned_3 is mod 2 ** 3;
84 for Unsigned_3'Size use 3;
86 type Unsigned_4 is mod 2 ** 4;
87 for Unsigned_4'Size use 4;
89 type Unsigned_5 is mod 2 ** 5;
90 for Unsigned_5'Size use 5;
92 type Unsigned_6 is mod 2 ** 6;
93 for Unsigned_6'Size use 6;
95 type Unsigned_7 is mod 2 ** 7;
96 for Unsigned_7'Size use 7;
98 type Unsigned_8 is mod 2 ** 8;
99 for Unsigned_8'Size use 8;
101 type Unsigned_9 is mod 2 ** 9;
102 for Unsigned_9'Size use 9;
104 type Unsigned_10 is mod 2 ** 10;
105 for Unsigned_10'Size use 10;
107 type Unsigned_11 is mod 2 ** 11;
108 for Unsigned_11'Size use 11;
110 type Unsigned_12 is mod 2 ** 12;
111 for Unsigned_12'Size use 12;
113 type Unsigned_13 is mod 2 ** 13;
114 for Unsigned_13'Size use 13;
116 type Unsigned_14 is mod 2 ** 14;
117 for Unsigned_14'Size use 14;
119 type Unsigned_15 is mod 2 ** 15;
120 for Unsigned_15'Size use 15;
122 type Unsigned_16 is mod 2 ** 16;
123 for Unsigned_16'Size use 16;
125 type Unsigned_17 is mod 2 ** 17;
126 for Unsigned_17'Size use 17;
128 type Unsigned_18 is mod 2 ** 18;
129 for Unsigned_18'Size use 18;
131 type Unsigned_19 is mod 2 ** 19;
132 for Unsigned_19'Size use 19;
134 type Unsigned_20 is mod 2 ** 20;
135 for Unsigned_20'Size use 20;
137 type Unsigned_21 is mod 2 ** 21;
138 for Unsigned_21'Size use 21;
140 type Unsigned_22 is mod 2 ** 22;
141 for Unsigned_22'Size use 22;
143 type Unsigned_23 is mod 2 ** 23;
144 for Unsigned_23'Size use 23;
146 type Unsigned_24 is mod 2 ** 24;
147 for Unsigned_24'Size use 24;
149 type Unsigned_25 is mod 2 ** 25;
150 for Unsigned_25'Size use 25;
152 type Unsigned_26 is mod 2 ** 26;
153 for Unsigned_26'Size use 26;
155 type Unsigned_27 is mod 2 ** 27;
156 for Unsigned_27'Size use 27;
158 type Unsigned_28 is mod 2 ** 28;
159 for Unsigned_28'Size use 28;
161 type Unsigned_29 is mod 2 ** 29;
162 for Unsigned_29'Size use 29;
164 type Unsigned_30 is mod 2 ** 30;
165 for Unsigned_30'Size use 30;
167 type Unsigned_31 is mod 2 ** 31;
168 for Unsigned_31'Size use 31;
170 type Unsigned_32 is mod 2 ** 32;
171 for Unsigned_32'Size use 32;
173 type Unsigned_33 is mod 2 ** 33;
174 for Unsigned_33'Size use 33;
176 type Unsigned_34 is mod 2 ** 34;
177 for Unsigned_34'Size use 34;
179 type Unsigned_35 is mod 2 ** 35;
180 for Unsigned_35'Size use 35;
182 type Unsigned_36 is mod 2 ** 36;
183 for Unsigned_36'Size use 36;
185 type Unsigned_37 is mod 2 ** 37;
186 for Unsigned_37'Size use 37;
188 type Unsigned_38 is mod 2 ** 38;
189 for Unsigned_38'Size use 38;
191 type Unsigned_39 is mod 2 ** 39;
192 for Unsigned_39'Size use 39;
194 type Unsigned_40 is mod 2 ** 40;
195 for Unsigned_40'Size use 40;
197 type Unsigned_41 is mod 2 ** 41;
198 for Unsigned_41'Size use 41;
200 type Unsigned_42 is mod 2 ** 42;
201 for Unsigned_42'Size use 42;
203 type Unsigned_43 is mod 2 ** 43;
204 for Unsigned_43'Size use 43;
206 type Unsigned_44 is mod 2 ** 44;
207 for Unsigned_44'Size use 44;
209 type Unsigned_45 is mod 2 ** 45;
210 for Unsigned_45'Size use 45;
212 type Unsigned_46 is mod 2 ** 46;
213 for Unsigned_46'Size use 46;
215 type Unsigned_47 is mod 2 ** 47;
216 for Unsigned_47'Size use 47;
218 type Unsigned_48 is mod 2 ** 48;
219 for Unsigned_48'Size use 48;
221 type Unsigned_49 is mod 2 ** 49;
222 for Unsigned_49'Size use 49;
224 type Unsigned_50 is mod 2 ** 50;
225 for Unsigned_50'Size use 50;
227 type Unsigned_51 is mod 2 ** 51;
228 for Unsigned_51'Size use 51;
230 type Unsigned_52 is mod 2 ** 52;
231 for Unsigned_52'Size use 52;
233 type Unsigned_53 is mod 2 ** 53;
234 for Unsigned_53'Size use 53;
236 type Unsigned_54 is mod 2 ** 54;
237 for Unsigned_54'Size use 54;
239 type Unsigned_55 is mod 2 ** 55;
240 for Unsigned_55'Size use 55;
242 type Unsigned_56 is mod 2 ** 56;
243 for Unsigned_56'Size use 56;
245 type Unsigned_57 is mod 2 ** 57;
246 for Unsigned_57'Size use 57;
248 type Unsigned_58 is mod 2 ** 58;
249 for Unsigned_58'Size use 58;
251 type Unsigned_59 is mod 2 ** 59;
252 for Unsigned_59'Size use 59;
254 type Unsigned_60 is mod 2 ** 60;
255 for Unsigned_60'Size use 60;
257 type Unsigned_61 is mod 2 ** 61;
258 for Unsigned_61'Size use 61;
260 type Unsigned_62 is mod 2 ** 62;
261 for Unsigned_62'Size use 62;
263 type Unsigned_63 is mod 2 ** 63;
264 for Unsigned_63'Size use 63;
266 type Unsigned_64 is mod 2 ** 64;
267 for Unsigned_64'Size use 64;
269 type Signed_2 is range -2 ** 1 .. 2 ** 1 - 1;
270 for Signed_2'Size use 2;
272 type Signed_3 is range -2 ** 2 .. 2 ** 2 - 1;
273 for Signed_3'Size use 3;
275 type Signed_4 is range -2 ** 3 .. 2 ** 3 - 1;
276 for Signed_4'Size use 4;
278 type Signed_5 is range -2 ** 4 .. 2 ** 4 - 1;
279 for Signed_5'Size use 5;
281 type Signed_6 is range -2 ** 5 .. 2 ** 5 - 1;
282 for Signed_6'Size use 6;
284 type Signed_7 is range -2 ** 6 .. 2 ** 6 - 1;
285 for Signed_7'Size use 7;
287 type Signed_8 is range -2 ** 7 .. 2 ** 7 - 1;
288 for Signed_8'Size use 8;
290 type Signed_9 is range -2 ** 8 .. 2 ** 8 - 1;
291 for Signed_9'Size use 9;
293 type Signed_10 is range -2 ** 9 .. 2 ** 9 - 1;
294 for Signed_10'Size use 10;
296 type Signed_11 is range -2 ** 10 .. 2 ** 10 - 1;
297 for Signed_11'Size use 11;
299 type Signed_12 is range -2 ** 11 .. 2 ** 11 - 1;
300 for Signed_12'Size use 12;
302 type Signed_13 is range -2 ** 12 .. 2 ** 12 - 1;
303 for Signed_13'Size use 13;
305 type Signed_14 is range -2 ** 13 .. 2 ** 13 - 1;
306 for Signed_14'Size use 14;
308 type Signed_15 is range -2 ** 14 .. 2 ** 14 - 1;
309 for Signed_15'Size use 15;
311 type Signed_16 is range -2 ** 15 .. 2 ** 15 - 1;
312 for Signed_16'Size use 16;
314 type Signed_17 is range -2 ** 16 .. 2 ** 16 - 1;
315 for Signed_17'Size use 17;
317 type Signed_18 is range -2 ** 17 .. 2 ** 17 - 1;
318 for Signed_18'Size use 18;
320 type Signed_19 is range -2 ** 18 .. 2 ** 18 - 1;
321 for Signed_19'Size use 19;
323 type Signed_20 is range -2 ** 19 .. 2 ** 19 - 1;
324 for Signed_20'Size use 20;
326 type Signed_21 is range -2 ** 20 .. 2 ** 20 - 1;
327 for Signed_21'Size use 21;
329 type Signed_22 is range -2 ** 21 .. 2 ** 21 - 1;
330 for Signed_22'Size use 22;
332 type Signed_23 is range -2 ** 22 .. 2 ** 22 - 1;
333 for Signed_23'Size use 23;
335 type Signed_24 is range -2 ** 23 .. 2 ** 23 - 1;
336 for Signed_24'Size use 24;
338 type Signed_25 is range -2 ** 24 .. 2 ** 24 - 1;
339 for Signed_25'Size use 25;
341 type Signed_26 is range -2 ** 25 .. 2 ** 25 - 1;
342 for Signed_26'Size use 26;
344 type Signed_27 is range -2 ** 26 .. 2 ** 26 - 1;
345 for Signed_27'Size use 27;
347 type Signed_28 is range -2 ** 27 .. 2 ** 27 - 1;
348 for Signed_28'Size use 28;
350 type Signed_29 is range -2 ** 28 .. 2 ** 28 - 1;
351 for Signed_29'Size use 29;
353 type Signed_30 is range -2 ** 29 .. 2 ** 29 - 1;
354 for Signed_30'Size use 30;
356 type Signed_31 is range -2 ** 30 .. 2 ** 30 - 1;
357 for Signed_31'Size use 31;
359 type Signed_32 is range -2 ** 31 .. 2 ** 31 - 1;
360 for Signed_32'Size use 32;
362 type Signed_33 is range -2 ** 32 .. 2 ** 32 - 1;
363 for Signed_33'Size use 33;
365 type Signed_34 is range -2 ** 33 .. 2 ** 33 - 1;
366 for Signed_34'Size use 34;
368 type Signed_35 is range -2 ** 34 .. 2 ** 34 - 1;
369 for Signed_35'Size use 35;
371 type Signed_36 is range -2 ** 35 .. 2 ** 35 - 1;
372 for Signed_36'Size use 36;
374 type Signed_37 is range -2 ** 36 .. 2 ** 36 - 1;
375 for Signed_37'Size use 37;
377 type Signed_38 is range -2 ** 37 .. 2 ** 37 - 1;
378 for Signed_38'Size use 38;
380 type Signed_39 is range -2 ** 38 .. 2 ** 38 - 1;
381 for Signed_39'Size use 39;
383 type Signed_40 is range -2 ** 39 .. 2 ** 39 - 1;
384 for Signed_40'Size use 40;
386 type Signed_41 is range -2 ** 40 .. 2 ** 40 - 1;
387 for Signed_41'Size use 41;
389 type Signed_42 is range -2 ** 41 .. 2 ** 41 - 1;
390 for Signed_42'Size use 42;
392 type Signed_43 is range -2 ** 42 .. 2 ** 42 - 1;
393 for Signed_43'Size use 43;
395 type Signed_44 is range -2 ** 43 .. 2 ** 43 - 1;
396 for Signed_44'Size use 44;
398 type Signed_45 is range -2 ** 44 .. 2 ** 44 - 1;
399 for Signed_45'Size use 45;
401 type Signed_46 is range -2 ** 45 .. 2 ** 45 - 1;
402 for Signed_46'Size use 46;
404 type Signed_47 is range -2 ** 46 .. 2 ** 46 - 1;
405 for Signed_47'Size use 47;
407 type Signed_48 is range -2 ** 47 .. 2 ** 47 - 1;
408 for Signed_48'Size use 48;
410 type Signed_49 is range -2 ** 48 .. 2 ** 48 - 1;
411 for Signed_49'Size use 49;
413 type Signed_50 is range -2 ** 49 .. 2 ** 49 - 1;
414 for Signed_50'Size use 50;
416 type Signed_51 is range -2 ** 50 .. 2 ** 50 - 1;
417 for Signed_51'Size use 51;
419 type Signed_52 is range -2 ** 51 .. 2 ** 51 - 1;
420 for Signed_52'Size use 52;
422 type Signed_53 is range -2 ** 52 .. 2 ** 52 - 1;
423 for Signed_53'Size use 53;
425 type Signed_54 is range -2 ** 53 .. 2 ** 53 - 1;
426 for Signed_54'Size use 54;
428 type Signed_55 is range -2 ** 54 .. 2 ** 54 - 1;
429 for Signed_55'Size use 55;
431 type Signed_56 is range -2 ** 55 .. 2 ** 55 - 1;
432 for Signed_56'Size use 56;
434 type Signed_57 is range -2 ** 56 .. 2 ** 56 - 1;
435 for Signed_57'Size use 57;
437 type Signed_58 is range -2 ** 57 .. 2 ** 57 - 1;
438 for Signed_58'Size use 58;
440 type Signed_59 is range -2 ** 58 .. 2 ** 58 - 1;
441 for Signed_59'Size use 59;
443 type Signed_60 is range -2 ** 59 .. 2 ** 59 - 1;
444 for Signed_60'Size use 60;
446 type Signed_61 is range -2 ** 60 .. 2 ** 60 - 1;
447 for Signed_61'Size use 61;
449 type Signed_62 is range -2 ** 61 .. 2 ** 61 - 1;
450 for Signed_62'Size use 62;
452 type Signed_63 is range -2 ** 62 .. 2 ** 62 - 1;
453 for Signed_63'Size use 63;
455 type Signed_64 is range -2 ** 63 .. 2 ** 63 - 1;
456 for Signed_64'Size use 64;
458 end Interfaces.C.Extensions;