2 |
7u83 |
1 |
/*
|
|
|
2 |
Crown Copyright (c) 1997, 1998
|
|
|
3 |
|
|
|
4 |
This TenDRA(r) Computer Program is subject to Copyright
|
|
|
5 |
owned by the United Kingdom Secretary of State for Defence
|
|
|
6 |
acting through the Defence Evaluation and Research Agency
|
|
|
7 |
(DERA). It is made available to Recipients with a
|
|
|
8 |
royalty-free licence for its use, reproduction, transfer
|
|
|
9 |
to other parties and amendment for any purpose not excluding
|
|
|
10 |
product development provided that any such use et cetera
|
|
|
11 |
shall be deemed to be acceptance of the following conditions:-
|
|
|
12 |
|
|
|
13 |
(1) Its Recipients shall ensure that this Notice is
|
|
|
14 |
reproduced upon any copies or amended versions of it;
|
|
|
15 |
|
|
|
16 |
(2) Any amended version of it shall be clearly marked to
|
|
|
17 |
show both the nature of and the organisation responsible
|
|
|
18 |
for the relevant amendment or amendments;
|
|
|
19 |
|
|
|
20 |
(3) Its onward transfer from a recipient to another
|
|
|
21 |
party shall be deemed to be that party's acceptance of
|
|
|
22 |
these conditions;
|
|
|
23 |
|
|
|
24 |
(4) DERA gives no warranty or assurance as to its
|
|
|
25 |
quality or suitability for any purpose and DERA accepts
|
|
|
26 |
no liability whatsoever in relation to any use to which
|
|
|
27 |
it may be put.
|
|
|
28 |
*/
|
|
|
29 |
|
|
|
30 |
|
|
|
31 |
/*
|
|
|
32 |
** abstract.h
|
|
|
33 |
**
|
|
|
34 |
** This file contains C #pragma statements which act
|
|
|
35 |
** as the interface to the tokens defined in the file
|
|
|
36 |
** abstract.pl.
|
|
|
37 |
*/
|
|
|
38 |
|
|
|
39 |
#if !defined(__INT64_API_h)
|
|
|
40 |
#define __INT64_API_h
|
|
|
41 |
|
|
|
42 |
|
|
|
43 |
/* Define the generic 32-bit signed and unsigned types */
|
|
|
44 |
|
|
|
45 |
#ifdef NATIVE_INT64
|
|
|
46 |
typedef int INT32;
|
|
|
47 |
typedef unsigned int UINT32;
|
|
|
48 |
#else
|
|
|
49 |
typedef long INT32;
|
|
|
50 |
typedef unsigned long UINT32;
|
|
|
51 |
#endif
|
|
|
52 |
|
|
|
53 |
|
|
|
54 |
|
|
|
55 |
/* Define the widest floating variety - not possible in C */
|
|
|
56 |
|
|
|
57 |
/* The C Producer can't tokenise FLOATING_VARIETIES. */
|
|
|
58 |
|
|
|
59 |
|
|
|
60 |
|
|
|
61 |
/* Define the new types for 64-bit integers */
|
|
|
62 |
|
|
|
63 |
#pragma token TYPE INT64 #
|
|
|
64 |
#pragma token TYPE UINT64 #
|
|
|
65 |
#pragma no_def INT64
|
|
|
66 |
#pragma no_def UINT64
|
|
|
67 |
|
|
|
68 |
|
|
|
69 |
/* Are 64-bit integers are conceptually hi-word first ? */
|
|
|
70 |
|
|
|
71 |
#if BIGENDIAN_INT64
|
|
|
72 |
struct _s {
|
|
|
73 |
INT32 hi32;
|
|
|
74 |
UINT32 lo32;
|
|
|
75 |
};
|
|
|
76 |
struct _u {
|
|
|
77 |
UINT32 hi32;
|
|
|
78 |
UINT32 lo32;
|
|
|
79 |
} u;
|
|
|
80 |
|
|
|
81 |
#else
|
|
|
82 |
|
|
|
83 |
struct _s {
|
|
|
84 |
UINT32 lo32;
|
|
|
85 |
INT32 hi32;
|
|
|
86 |
};
|
|
|
87 |
struct _u {
|
|
|
88 |
UINT32 lo32;
|
|
|
89 |
UINT32 hi32;
|
|
|
90 |
} u;
|
|
|
91 |
#endif /* BIGENDIAN_INT64 */
|
|
|
92 |
|
|
|
93 |
|
|
|
94 |
typedef union {
|
|
|
95 |
struct _s s;
|
|
|
96 |
struct _u u;
|
|
|
97 |
INT64 s64;
|
|
|
98 |
UINT64 u64;
|
|
|
99 |
} TDF_INT64;
|
|
|
100 |
|
|
|
101 |
/* Macros for extracting the high- and low-32 bits */
|
|
|
102 |
|
|
|
103 |
#define hi_32(X) ((X).s.hi32)
|
|
|
104 |
#define lo_32(X) ((X).s.lo32)
|
|
|
105 |
|
|
|
106 |
#define hi_u32(X) ((X).u.hi32)
|
|
|
107 |
#define lo_u32(X) ((X).u.lo32)
|
|
|
108 |
|
|
|
109 |
#define PARAM(X) ((X).s64)
|
|
|
110 |
#define UPARAM(X) ((X).u64)
|
|
|
111 |
|
|
|
112 |
|
|
|
113 |
|
|
|
114 |
/* 64-bit constants used in the implementation */
|
|
|
115 |
|
|
|
116 |
#pragma token EXP rvalue : TDF_INT64 : const_0 #
|
|
|
117 |
#pragma token EXP rvalue : TDF_INT64 : const_u0 #
|
|
|
118 |
#pragma token EXP rvalue : TDF_INT64 : const_1 #
|
|
|
119 |
#pragma token EXP rvalue : TDF_INT64 : const_u1 #
|
|
|
120 |
|
|
|
121 |
|
|
|
122 |
#endif /* !defined(__INT64_API_h) */
|