ada: Fix renaming of predefined equality operator for unchecked union types
[official-gcc.git] / gcc / ada / uintp.h
blob337ac7ca7b32b546abb817e33f8d53601951d558
1 /****************************************************************************
2 * *
3 * GNAT COMPILER COMPONENTS *
4 * *
5 * U I N T P *
6 * *
7 * C Header File *
8 * *
9 * Copyright (C) 1992-2023, 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. 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 COPYING3. If not, go to *
19 * http://www.gnu.org/licenses for a complete copy of the license. *
20 * *
21 * GNAT was originally developed by the GNAT team at New York University. *
22 * Extensive contributions were provided by Ada Core Technologies Inc. *
23 * *
24 ****************************************************************************/
26 /* This is the C header that corresponds to the Ada package specification for
27 Uintp. It was created manually from uintp.ads and must be kept synchronized
28 with changes in this file. */
30 #ifdef __cplusplus
31 extern "C" {
32 #endif
34 /* Support for universal integer arithmetic */
36 struct Uint_Entry
38 Pos Length;
39 Int Loc;
42 /* See if a Uint is within the range of an integer. */
43 #define UI_Is_In_Int_Range uintp__ui_is_in_int_range
44 extern Boolean UI_Is_In_Int_Range (Uint);
46 /* Obtain Char_Code value from Uint input. Value must be in range. */
47 #define UI_To_CC uintp__ui_to_cc
48 extern Char_Code UI_To_CC (Uint);
50 /* Convert a Char_Code into a Uint. */
51 #define UI_From_CC uintp__ui_from_cc
52 extern Uint UI_From_CC (Char_Code);
54 /* Obtain Int value from Uint input. Abort if the result is out of range. */
55 #define UI_To_Int uintp__ui_to_int
56 extern Int UI_To_Int (Uint);
58 /* Similarly, but return a GCC INTEGER_CST. */
59 extern tree UI_To_gnu (Uint, tree);
61 /* Convert an Int into a Uint. */
62 #define UI_From_Int uintp__ui_from_int
63 extern Uint UI_From_Int (int);
65 /* Similarly, but take a GCC INTEGER_CST. */
66 extern Uint UI_From_gnu (tree);
68 /* A constant value indicating a missing or unset Uint value. */
69 #define UI_No_Uint uintp__no_uint
70 extern const Uint UI_No_Uint;
72 /* Uint values are represented as multiple precision integers stored in a
73 multi-digit format using UI_Base as the base. This value is chosen so
74 that the product UI_Base*UI_Base is within the range of Int values. */
75 #define UI_Base uintp__base
76 extern const int UI_Base;
78 /* Types for the fat pointer of Int vectors and the template it points to. */
79 typedef struct {int Low_Bound, High_Bound; } Vector_Template;
80 typedef struct {const int *Array; Vector_Template *Bounds; }
81 __attribute ((aligned (sizeof (char *) * 2))) Int_Vector;
83 /* Create and return the Uint value from the Int vector. */
84 #define Vector_To_Uint uintp__vector_to_uint
85 extern Uint Vector_To_Uint (Int_Vector, Boolean);
87 /* Compare integer values for equality. */
88 #define UI_Eq uintp__ui_eq
89 extern Boolean UI_Eq (Uint, Uint);
91 /* Compare integer values for less than. */
92 #define UI_Lt uintp__ui_lt
93 extern Boolean UI_Lt (Uint, Uint);
95 /* Universal integers are represented by the Uint type which is an index into
96 the Uints_Ptr table containing Uint_Entry values. A Uint_Entry contains an
97 index and length for getting the "digits" of the universal integer from the
98 Udigits_Ptr table.
100 For efficiency, this method is used only for integer values larger than the
101 constant Uint_Bias. If a Uint is less than this constant, then it contains
102 the integer value itself. */
104 #define Uints_Ptr uintp__uints__table
105 extern struct Uint_Entry (*Uints_Ptr)[];
107 #define Udigits_Ptr uintp__udigits__table
108 extern int (*Udigits_Ptr)[];
110 #ifdef __cplusplus
112 #endif