1 #include __TAO_IDL_FEATURES
2 #ifdef TAO_IDL_HAS_EXPLICIT_INTS
3 # if
!TAO_IDL_HAS_EXPLICIT_INTS
4 # error
"Expecting macro to be true"
7 # error
"Expecting macro to be defined"
10 #include
"tao/Int8Seq.pidl"
11 #include
"tao/UInt8Seq.pidl"
12 #include
"tao/OctetSeq.pidl"
13 #include
"tao/CharSeq.pidl"
15 const uint8 u8_min
= 0;
16 const uint8 u8_max
= 255;
17 const int8 i8_min
= -128;
18 const int8 i8_max
= 127;
19 const uint16 u16_max
= 65535;
20 const int16 i16_min
= -32768;
21 const int16 i16_max
= 32767;
22 const uint32 u32_max
= 4294967295;
23 const int32 i32_min
= -2147483648;
24 const int32 i32_max
= 2147483647;
25 const uint64 u64_max
= 18446744073709551615;
26 const int64 i64_min
= -9223372036854775808;
27 const int64 i64_max
= 9223372036854775807;
29 const uint8 u8_min_overflow
= u8_min
- 1; // == u8_max
30 const int8 i8_min_overflow
= i8_min
- 1; // == i8_max
31 const uint8 u8_max_overflow
= u8_max
+ 1; // == 0
32 const int8 i8_max_overflow
= i8_max
+ 1; // == i8_min
34 const uint8 u8_max_negate
= ~u8_max
; // == 0
35 const int8 i8_max_negate
= ~i8_max
; // == i8_min
37 const uint8 u8_e1
= 2;
38 const uint8 u8_e2
= u8_e1
+ 2;
39 const uint8 u8_e3
= u8_e2
* 3;
40 const uint8 u8_e4
= u8_e3
/ 4;
41 const uint8 u8_e5
= u8_e4 |
5;
42 const uint8 u8_e6
= u8_e5 ^
6;
43 const uint8 u8_e7
= u8_e6
& 7;
44 const uint8 u8_e8
= u8_e7
<< 4;
45 const uint8 u8_e9
= u8_e8
>> 1;
47 const int8 i8_e1
= -2;
48 const int8 i8_e2
= i8_e1
- -6;
49 const int8 i8_e3
= i8_e2
* 3;
50 const int8 i8_e4
= i8_e3
/ 4;
51 const int8 i8_e5
= i8_e4 |
5;
52 const int8 i8_e6
= i8_e5 ^
6;
53 const int8 i8_e7
= i8_e6
& 7;
54 const int8 i8_e8
= i8_e7
<< 4;
55 const int8 i8_e9
= i8_e8
>> 1;
57 typedef uint8 U8arr
[3];
58 typedef int8 I8arr
[3];
59 typedef octet Oarr
[3];
61 typedef sequence
<uint8
> U8seq
;
62 typedef sequence
<int8
> I8seq
;
63 typedef sequence
<octet
> Oseq
;
64 typedef sequence
<char> Cseq
;
66 struct StructWithInts
{
76 // Make sure there's no conflict between uint8, int8, octet, and char.
79 sequence
<uint8
> u8_seq
;
80 sequence
<int8
> i8_seq
;
81 sequence
<octet
> o_seq
;
92 union UnionOverU8
switch (uint8
) {
102 sequence
<uint8
> u8seq
;
104 sequence
<int8
> i8seq
;
107 union UnionOverI8
switch (int8
) {
117 sequence
<uint8
> u8seq
;
119 sequence
<int8
> i8seq
;