]>
Commit | Line | Data |
---|---|---|
38cbfe40 RK |
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 | -- -- | |
4dfba737 | 9 | -- Copyright (C) 1992-2018, Free Software Foundation, Inc. -- |
38cbfe40 RK |
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- -- | |
748086b7 | 13 | -- ware Foundation; either version 3, or (at your option) any later ver- -- |
38cbfe40 RK |
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 -- | |
748086b7 JJ |
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/>. -- | |
38cbfe40 RK |
26 | -- -- |
27 | -- GNAT was originally developed by the GNAT team at New York University. -- | |
71ff80dc | 28 | -- Extensive contributions were provided by Ada Core Technologies Inc. -- |
38cbfe40 RK |
29 | -- -- |
30 | ------------------------------------------------------------------------------ | |
31 | ||
32 | -- This package contains additional C-related definitions, intended for use | |
33 | -- with either manually or automatically generated bindings to C libraries. | |
34 | ||
35 | with System; | |
36 | ||
37 | package Interfaces.C.Extensions is | |
cb7fa356 | 38 | pragma Pure; |
38cbfe40 | 39 | |
c95e0edc | 40 | -- Definitions for C "void" and "void *" types |
514d0fc5 | 41 | |
38cbfe40 RK |
42 | subtype void is System.Address; |
43 | subtype void_ptr is System.Address; | |
44 | ||
4b6133ea AC |
45 | -- Definitions for C incomplete/unknown structs |
46 | ||
38cbfe40 RK |
47 | subtype opaque_structure_def is System.Address; |
48 | type opaque_structure_def_ptr is access opaque_structure_def; | |
cb7fa356 | 49 | for opaque_structure_def_ptr'Storage_Size use 0; |
38cbfe40 | 50 | |
4b6133ea AC |
51 | -- Definitions for C++ incomplete/unknown classes |
52 | ||
38cbfe40 RK |
53 | subtype incomplete_class_def is System.Address; |
54 | type incomplete_class_def_ptr is access incomplete_class_def; | |
cb7fa356 | 55 | for incomplete_class_def_ptr'Storage_Size use 0; |
38cbfe40 | 56 | |
4b6133ea AC |
57 | -- C bool |
58 | ||
514d0fc5 AC |
59 | subtype bool is plain_char; |
60 | ||
c95e0edc | 61 | -- 64-bit integer types |
38cbfe40 RK |
62 | |
63 | subtype long_long is Long_Long_Integer; | |
64 | type unsigned_long_long is mod 2 ** 64; | |
65 | ||
c95e0edc | 66 | -- 128-bit integer type available on 64-bit platforms: |
4b6133ea AC |
67 | -- typedef int signed_128 __attribute__ ((mode (TI))); |
68 | ||
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; | |
74 | ||
c6db43fa EB |
75 | -- 128-bit floating-point type available on x86: |
76 | -- typedef long_double float_128 __attribute__ ((mode (TF))); | |
77 | ||
78 | type Float_128 is record | |
79 | low, high : unsigned_long_long; | |
80 | end record; | |
81 | pragma Convention (C_Pass_By_Copy, Float_128); | |
82 | for Float_128'Alignment use unsigned_long_long'Alignment * 2; | |
83 | ||
38cbfe40 | 84 | -- Types for bitfields |
38cbfe40 RK |
85 | |
86 | type Unsigned_1 is mod 2 ** 1; | |
87 | for Unsigned_1'Size use 1; | |
88 | ||
89 | type Unsigned_2 is mod 2 ** 2; | |
90 | for Unsigned_2'Size use 2; | |
91 | ||
92 | type Unsigned_3 is mod 2 ** 3; | |
93 | for Unsigned_3'Size use 3; | |
94 | ||
95 | type Unsigned_4 is mod 2 ** 4; | |
96 | for Unsigned_4'Size use 4; | |
97 | ||
98 | type Unsigned_5 is mod 2 ** 5; | |
99 | for Unsigned_5'Size use 5; | |
100 | ||
101 | type Unsigned_6 is mod 2 ** 6; | |
102 | for Unsigned_6'Size use 6; | |
103 | ||
104 | type Unsigned_7 is mod 2 ** 7; | |
105 | for Unsigned_7'Size use 7; | |
106 | ||
107 | type Unsigned_8 is mod 2 ** 8; | |
108 | for Unsigned_8'Size use 8; | |
109 | ||
110 | type Unsigned_9 is mod 2 ** 9; | |
111 | for Unsigned_9'Size use 9; | |
112 | ||
113 | type Unsigned_10 is mod 2 ** 10; | |
114 | for Unsigned_10'Size use 10; | |
115 | ||
116 | type Unsigned_11 is mod 2 ** 11; | |
117 | for Unsigned_11'Size use 11; | |
118 | ||
119 | type Unsigned_12 is mod 2 ** 12; | |
120 | for Unsigned_12'Size use 12; | |
121 | ||
122 | type Unsigned_13 is mod 2 ** 13; | |
123 | for Unsigned_13'Size use 13; | |
124 | ||
125 | type Unsigned_14 is mod 2 ** 14; | |
126 | for Unsigned_14'Size use 14; | |
127 | ||
128 | type Unsigned_15 is mod 2 ** 15; | |
129 | for Unsigned_15'Size use 15; | |
130 | ||
131 | type Unsigned_16 is mod 2 ** 16; | |
132 | for Unsigned_16'Size use 16; | |
133 | ||
134 | type Unsigned_17 is mod 2 ** 17; | |
135 | for Unsigned_17'Size use 17; | |
136 | ||
137 | type Unsigned_18 is mod 2 ** 18; | |
138 | for Unsigned_18'Size use 18; | |
139 | ||
140 | type Unsigned_19 is mod 2 ** 19; | |
141 | for Unsigned_19'Size use 19; | |
142 | ||
143 | type Unsigned_20 is mod 2 ** 20; | |
144 | for Unsigned_20'Size use 20; | |
145 | ||
146 | type Unsigned_21 is mod 2 ** 21; | |
147 | for Unsigned_21'Size use 21; | |
148 | ||
149 | type Unsigned_22 is mod 2 ** 22; | |
150 | for Unsigned_22'Size use 22; | |
151 | ||
152 | type Unsigned_23 is mod 2 ** 23; | |
153 | for Unsigned_23'Size use 23; | |
154 | ||
155 | type Unsigned_24 is mod 2 ** 24; | |
156 | for Unsigned_24'Size use 24; | |
157 | ||
158 | type Unsigned_25 is mod 2 ** 25; | |
159 | for Unsigned_25'Size use 25; | |
160 | ||
161 | type Unsigned_26 is mod 2 ** 26; | |
162 | for Unsigned_26'Size use 26; | |
163 | ||
164 | type Unsigned_27 is mod 2 ** 27; | |
165 | for Unsigned_27'Size use 27; | |
166 | ||
167 | type Unsigned_28 is mod 2 ** 28; | |
168 | for Unsigned_28'Size use 28; | |
169 | ||
170 | type Unsigned_29 is mod 2 ** 29; | |
171 | for Unsigned_29'Size use 29; | |
172 | ||
173 | type Unsigned_30 is mod 2 ** 30; | |
174 | for Unsigned_30'Size use 30; | |
175 | ||
176 | type Unsigned_31 is mod 2 ** 31; | |
177 | for Unsigned_31'Size use 31; | |
178 | ||
179 | type Unsigned_32 is mod 2 ** 32; | |
180 | for Unsigned_32'Size use 32; | |
181 | ||
7610fee8 AC |
182 | type Unsigned_33 is mod 2 ** 33; |
183 | for Unsigned_33'Size use 33; | |
184 | ||
185 | type Unsigned_34 is mod 2 ** 34; | |
186 | for Unsigned_34'Size use 34; | |
187 | ||
188 | type Unsigned_35 is mod 2 ** 35; | |
189 | for Unsigned_35'Size use 35; | |
190 | ||
191 | type Unsigned_36 is mod 2 ** 36; | |
192 | for Unsigned_36'Size use 36; | |
193 | ||
194 | type Unsigned_37 is mod 2 ** 37; | |
195 | for Unsigned_37'Size use 37; | |
196 | ||
197 | type Unsigned_38 is mod 2 ** 38; | |
198 | for Unsigned_38'Size use 38; | |
199 | ||
200 | type Unsigned_39 is mod 2 ** 39; | |
201 | for Unsigned_39'Size use 39; | |
202 | ||
203 | type Unsigned_40 is mod 2 ** 40; | |
204 | for Unsigned_40'Size use 40; | |
205 | ||
206 | type Unsigned_41 is mod 2 ** 41; | |
207 | for Unsigned_41'Size use 41; | |
208 | ||
209 | type Unsigned_42 is mod 2 ** 42; | |
210 | for Unsigned_42'Size use 42; | |
211 | ||
212 | type Unsigned_43 is mod 2 ** 43; | |
213 | for Unsigned_43'Size use 43; | |
214 | ||
215 | type Unsigned_44 is mod 2 ** 44; | |
216 | for Unsigned_44'Size use 44; | |
217 | ||
218 | type Unsigned_45 is mod 2 ** 45; | |
219 | for Unsigned_45'Size use 45; | |
220 | ||
221 | type Unsigned_46 is mod 2 ** 46; | |
222 | for Unsigned_46'Size use 46; | |
223 | ||
224 | type Unsigned_47 is mod 2 ** 47; | |
225 | for Unsigned_47'Size use 47; | |
226 | ||
227 | type Unsigned_48 is mod 2 ** 48; | |
228 | for Unsigned_48'Size use 48; | |
229 | ||
230 | type Unsigned_49 is mod 2 ** 49; | |
231 | for Unsigned_49'Size use 49; | |
232 | ||
233 | type Unsigned_50 is mod 2 ** 50; | |
234 | for Unsigned_50'Size use 50; | |
235 | ||
236 | type Unsigned_51 is mod 2 ** 51; | |
237 | for Unsigned_51'Size use 51; | |
238 | ||
239 | type Unsigned_52 is mod 2 ** 52; | |
240 | for Unsigned_52'Size use 52; | |
241 | ||
242 | type Unsigned_53 is mod 2 ** 53; | |
243 | for Unsigned_53'Size use 53; | |
244 | ||
245 | type Unsigned_54 is mod 2 ** 54; | |
246 | for Unsigned_54'Size use 54; | |
247 | ||
248 | type Unsigned_55 is mod 2 ** 55; | |
249 | for Unsigned_55'Size use 55; | |
250 | ||
251 | type Unsigned_56 is mod 2 ** 56; | |
252 | for Unsigned_56'Size use 56; | |
253 | ||
254 | type Unsigned_57 is mod 2 ** 57; | |
255 | for Unsigned_57'Size use 57; | |
256 | ||
257 | type Unsigned_58 is mod 2 ** 58; | |
258 | for Unsigned_58'Size use 58; | |
259 | ||
260 | type Unsigned_59 is mod 2 ** 59; | |
261 | for Unsigned_59'Size use 59; | |
262 | ||
263 | type Unsigned_60 is mod 2 ** 60; | |
264 | for Unsigned_60'Size use 60; | |
265 | ||
266 | type Unsigned_61 is mod 2 ** 61; | |
267 | for Unsigned_61'Size use 61; | |
268 | ||
269 | type Unsigned_62 is mod 2 ** 62; | |
270 | for Unsigned_62'Size use 62; | |
271 | ||
272 | type Unsigned_63 is mod 2 ** 63; | |
273 | for Unsigned_63'Size use 63; | |
274 | ||
275 | type Unsigned_64 is mod 2 ** 64; | |
276 | for Unsigned_64'Size use 64; | |
277 | ||
38cbfe40 RK |
278 | type Signed_2 is range -2 ** 1 .. 2 ** 1 - 1; |
279 | for Signed_2'Size use 2; | |
280 | ||
281 | type Signed_3 is range -2 ** 2 .. 2 ** 2 - 1; | |
282 | for Signed_3'Size use 3; | |
283 | ||
284 | type Signed_4 is range -2 ** 3 .. 2 ** 3 - 1; | |
285 | for Signed_4'Size use 4; | |
286 | ||
287 | type Signed_5 is range -2 ** 4 .. 2 ** 4 - 1; | |
288 | for Signed_5'Size use 5; | |
289 | ||
290 | type Signed_6 is range -2 ** 5 .. 2 ** 5 - 1; | |
291 | for Signed_6'Size use 6; | |
292 | ||
293 | type Signed_7 is range -2 ** 6 .. 2 ** 6 - 1; | |
294 | for Signed_7'Size use 7; | |
295 | ||
296 | type Signed_8 is range -2 ** 7 .. 2 ** 7 - 1; | |
297 | for Signed_8'Size use 8; | |
298 | ||
299 | type Signed_9 is range -2 ** 8 .. 2 ** 8 - 1; | |
300 | for Signed_9'Size use 9; | |
301 | ||
302 | type Signed_10 is range -2 ** 9 .. 2 ** 9 - 1; | |
303 | for Signed_10'Size use 10; | |
304 | ||
305 | type Signed_11 is range -2 ** 10 .. 2 ** 10 - 1; | |
306 | for Signed_11'Size use 11; | |
307 | ||
308 | type Signed_12 is range -2 ** 11 .. 2 ** 11 - 1; | |
309 | for Signed_12'Size use 12; | |
310 | ||
311 | type Signed_13 is range -2 ** 12 .. 2 ** 12 - 1; | |
312 | for Signed_13'Size use 13; | |
313 | ||
314 | type Signed_14 is range -2 ** 13 .. 2 ** 13 - 1; | |
315 | for Signed_14'Size use 14; | |
316 | ||
317 | type Signed_15 is range -2 ** 14 .. 2 ** 14 - 1; | |
318 | for Signed_15'Size use 15; | |
319 | ||
320 | type Signed_16 is range -2 ** 15 .. 2 ** 15 - 1; | |
321 | for Signed_16'Size use 16; | |
322 | ||
323 | type Signed_17 is range -2 ** 16 .. 2 ** 16 - 1; | |
324 | for Signed_17'Size use 17; | |
325 | ||
326 | type Signed_18 is range -2 ** 17 .. 2 ** 17 - 1; | |
327 | for Signed_18'Size use 18; | |
328 | ||
329 | type Signed_19 is range -2 ** 18 .. 2 ** 18 - 1; | |
330 | for Signed_19'Size use 19; | |
331 | ||
332 | type Signed_20 is range -2 ** 19 .. 2 ** 19 - 1; | |
333 | for Signed_20'Size use 20; | |
334 | ||
335 | type Signed_21 is range -2 ** 20 .. 2 ** 20 - 1; | |
336 | for Signed_21'Size use 21; | |
337 | ||
338 | type Signed_22 is range -2 ** 21 .. 2 ** 21 - 1; | |
339 | for Signed_22'Size use 22; | |
340 | ||
341 | type Signed_23 is range -2 ** 22 .. 2 ** 22 - 1; | |
342 | for Signed_23'Size use 23; | |
343 | ||
344 | type Signed_24 is range -2 ** 23 .. 2 ** 23 - 1; | |
345 | for Signed_24'Size use 24; | |
346 | ||
347 | type Signed_25 is range -2 ** 24 .. 2 ** 24 - 1; | |
348 | for Signed_25'Size use 25; | |
349 | ||
350 | type Signed_26 is range -2 ** 25 .. 2 ** 25 - 1; | |
351 | for Signed_26'Size use 26; | |
352 | ||
353 | type Signed_27 is range -2 ** 26 .. 2 ** 26 - 1; | |
354 | for Signed_27'Size use 27; | |
355 | ||
356 | type Signed_28 is range -2 ** 27 .. 2 ** 27 - 1; | |
357 | for Signed_28'Size use 28; | |
358 | ||
359 | type Signed_29 is range -2 ** 28 .. 2 ** 28 - 1; | |
360 | for Signed_29'Size use 29; | |
361 | ||
362 | type Signed_30 is range -2 ** 29 .. 2 ** 29 - 1; | |
363 | for Signed_30'Size use 30; | |
364 | ||
365 | type Signed_31 is range -2 ** 30 .. 2 ** 30 - 1; | |
366 | for Signed_31'Size use 31; | |
367 | ||
368 | type Signed_32 is range -2 ** 31 .. 2 ** 31 - 1; | |
369 | for Signed_32'Size use 32; | |
370 | ||
7610fee8 AC |
371 | type Signed_33 is range -2 ** 32 .. 2 ** 32 - 1; |
372 | for Signed_33'Size use 33; | |
373 | ||
374 | type Signed_34 is range -2 ** 33 .. 2 ** 33 - 1; | |
375 | for Signed_34'Size use 34; | |
376 | ||
377 | type Signed_35 is range -2 ** 34 .. 2 ** 34 - 1; | |
378 | for Signed_35'Size use 35; | |
379 | ||
380 | type Signed_36 is range -2 ** 35 .. 2 ** 35 - 1; | |
381 | for Signed_36'Size use 36; | |
382 | ||
383 | type Signed_37 is range -2 ** 36 .. 2 ** 36 - 1; | |
384 | for Signed_37'Size use 37; | |
385 | ||
386 | type Signed_38 is range -2 ** 37 .. 2 ** 37 - 1; | |
387 | for Signed_38'Size use 38; | |
388 | ||
389 | type Signed_39 is range -2 ** 38 .. 2 ** 38 - 1; | |
390 | for Signed_39'Size use 39; | |
391 | ||
392 | type Signed_40 is range -2 ** 39 .. 2 ** 39 - 1; | |
393 | for Signed_40'Size use 40; | |
394 | ||
395 | type Signed_41 is range -2 ** 40 .. 2 ** 40 - 1; | |
396 | for Signed_41'Size use 41; | |
397 | ||
398 | type Signed_42 is range -2 ** 41 .. 2 ** 41 - 1; | |
399 | for Signed_42'Size use 42; | |
400 | ||
401 | type Signed_43 is range -2 ** 42 .. 2 ** 42 - 1; | |
402 | for Signed_43'Size use 43; | |
403 | ||
404 | type Signed_44 is range -2 ** 43 .. 2 ** 43 - 1; | |
405 | for Signed_44'Size use 44; | |
406 | ||
407 | type Signed_45 is range -2 ** 44 .. 2 ** 44 - 1; | |
408 | for Signed_45'Size use 45; | |
409 | ||
410 | type Signed_46 is range -2 ** 45 .. 2 ** 45 - 1; | |
411 | for Signed_46'Size use 46; | |
412 | ||
413 | type Signed_47 is range -2 ** 46 .. 2 ** 46 - 1; | |
414 | for Signed_47'Size use 47; | |
415 | ||
416 | type Signed_48 is range -2 ** 47 .. 2 ** 47 - 1; | |
417 | for Signed_48'Size use 48; | |
418 | ||
419 | type Signed_49 is range -2 ** 48 .. 2 ** 48 - 1; | |
420 | for Signed_49'Size use 49; | |
421 | ||
422 | type Signed_50 is range -2 ** 49 .. 2 ** 49 - 1; | |
423 | for Signed_50'Size use 50; | |
424 | ||
425 | type Signed_51 is range -2 ** 50 .. 2 ** 50 - 1; | |
426 | for Signed_51'Size use 51; | |
427 | ||
428 | type Signed_52 is range -2 ** 51 .. 2 ** 51 - 1; | |
429 | for Signed_52'Size use 52; | |
430 | ||
431 | type Signed_53 is range -2 ** 52 .. 2 ** 52 - 1; | |
432 | for Signed_53'Size use 53; | |
433 | ||
434 | type Signed_54 is range -2 ** 53 .. 2 ** 53 - 1; | |
435 | for Signed_54'Size use 54; | |
436 | ||
437 | type Signed_55 is range -2 ** 54 .. 2 ** 54 - 1; | |
438 | for Signed_55'Size use 55; | |
439 | ||
440 | type Signed_56 is range -2 ** 55 .. 2 ** 55 - 1; | |
441 | for Signed_56'Size use 56; | |
442 | ||
443 | type Signed_57 is range -2 ** 56 .. 2 ** 56 - 1; | |
444 | for Signed_57'Size use 57; | |
445 | ||
446 | type Signed_58 is range -2 ** 57 .. 2 ** 57 - 1; | |
447 | for Signed_58'Size use 58; | |
448 | ||
449 | type Signed_59 is range -2 ** 58 .. 2 ** 58 - 1; | |
450 | for Signed_59'Size use 59; | |
451 | ||
452 | type Signed_60 is range -2 ** 59 .. 2 ** 59 - 1; | |
453 | for Signed_60'Size use 60; | |
454 | ||
455 | type Signed_61 is range -2 ** 60 .. 2 ** 60 - 1; | |
456 | for Signed_61'Size use 61; | |
457 | ||
458 | type Signed_62 is range -2 ** 61 .. 2 ** 61 - 1; | |
459 | for Signed_62'Size use 62; | |
460 | ||
461 | type Signed_63 is range -2 ** 62 .. 2 ** 62 - 1; | |
462 | for Signed_63'Size use 63; | |
463 | ||
464 | type Signed_64 is range -2 ** 63 .. 2 ** 63 - 1; | |
465 | for Signed_64'Size use 64; | |
466 | ||
38cbfe40 | 467 | end Interfaces.C.Extensions; |