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