33 #ifndef CAIRO_WIDEINT_H
34 #define CAIRO_WIDEINT_H
45 #include "ns3/core-config.h"
47 #define HAVE_UINT64_T 1
57 #define HAVE_STDINT_H 1
59 #define HAVE_STDINT_H 1
66 # include <inttypes.h>
67 #elif HAVE_SYS_INT_TYPES_H
68 # include <sys/int_types.h>
69 #elif defined(_MSC_VER)
70 typedef __int8 int8_t;
71 typedef unsigned __int8 uint8_t;
72 typedef __int16 int16_t;
73 typedef unsigned __int16 uint16_t;
74 typedef __int32 int32_t;
75 typedef unsigned __int32 uint32_t;
76 typedef __int64 int64_t;
77 typedef unsigned __int64 uint64_t;
78 # ifndef HAVE_UINT64_T
79 # define HAVE_UINT64_T 1
82 # define INT16_MIN (-32767-1)
85 # define INT16_MAX (32767)
88 # define UINT16_MAX (65535)
91 #error Cannot find definitions for fixed-width integral types (uint8_t, uint32_t, etc.)
107 #define cairo_I cairo_private
113 typedef struct _cairo_uint64 {
118 #define _cairo_uint64_to_uint32(a) ((a).lo)
129 #define _cairo_uint64_negative(a) (((int32_t)((a).hi)) < 0)
132 #define _cairo_uint64_to_int64(i) (i)
133 #define _cairo_int64_to_uint64(i) (i)
136 #define _cairo_int64_to_int32(a) ((int32_t) _cairo_uint64_to_uint32 (a))
137 #define _cairo_int64_add(a,b) _cairo_uint64_add (a,b)
138 #define _cairo_int64_sub(a,b) _cairo_uint64_sub (a,b)
139 #define _cairo_int64_mul(a,b) _cairo_uint64_mul (a,b)
142 #define _cairo_int64_eq(a,b) _cairo_uint64_eq (a,b)
143 #define _cairo_int64_lsl(a,b) _cairo_uint64_lsl (a,b)
144 #define _cairo_int64_rsl(a,b) _cairo_uint64_rsl (a,b)
145 #define _cairo_int64_rsa(a,b) _cairo_uint64_rsa (a,b)
146 #define _cairo_int64_negate(a) _cairo_uint64_negate (a)
147 #define _cairo_int64_negative(a) (((int32_t)((a).hi)) < 0)
148 #define _cairo_int64_not(a) _cairo_uint64_not (a)
157 #define _cairo_uint32_to_uint64(i) ((uint64_t)(i))
158 #define _cairo_uint64_to_uint32(i) ((uint32_t)(i))
159 #define _cairo_uint64_add(a,b) ((a) + (b))
160 #define _cairo_uint64_sub(a,b) ((a) - (b))
161 #define _cairo_uint64_mul(a,b) ((a) * (b))
162 #define _cairo_uint32x32_64_mul(a,b) ((uint64_t)(a) * (b))
163 #define _cairo_uint64_lsl(a,b) ((a) << (b))
164 #define _cairo_uint64_rsl(a,b) ((uint64_t)(a) >> (b))
165 #define _cairo_uint64_rsa(a,b) ((uint64_t)((int64_t)(a) >> (b)))
166 #define _cairo_uint64_lt(a,b) ((a) < (b))
167 #define _cairo_uint64_eq(a,b) ((a) == (b))
168 #define _cairo_uint64_negate(a) ((uint64_t) -((int64_t)(a)))
169 #define _cairo_uint64_negative(a) ((int64_t)(a) < 0)
170 #define _cairo_uint64_not(a) (~(a))
172 #define _cairo_uint64_to_int64(i) ((int64_t)(i))
173 #define _cairo_int64_to_uint64(i) ((uint64_t)(i))
175 #define _cairo_int32_to_int64(i) ((int64_t)(i))
176 #define _cairo_int64_to_int32(i) ((int32_t)(i))
177 #define _cairo_int64_add(a,b) ((a) + (b))
178 #define _cairo_int64_sub(a,b) ((a) - (b))
179 #define _cairo_int64_mul(a,b) ((a) * (b))
180 #define _cairo_int32x32_64_mul(a,b) ((int64_t)(a) * (b))
181 #define _cairo_int64_lt(a,b) ((a) < (b))
182 #define _cairo_int64_eq(a,b) ((a) == (b))
183 #define _cairo_int64_lsl(a,b) ((a) << (b))
184 #define _cairo_int64_rsl(a,b) ((int64_t)((uint64_t)(a) >> (b)))
185 #define _cairo_int64_rsa(a,b) ((int64_t)(a) >> (b))
186 #define _cairo_int64_negate(a) (-(a))
187 #define _cairo_int64_negative(a) ((a) < 0)
188 #define _cairo_int64_not(a) (~(a))
195 #define _cairo_uint64_le(a,b) (!_cairo_uint64_gt (a,b))
196 #define _cairo_uint64_ne(a,b) (!_cairo_uint64_eq (a,b))
197 #define _cairo_uint64_ge(a,b) (!_cairo_uint64_lt (a,b))
198 #define _cairo_uint64_gt(a,b) _cairo_uint64_lt (b,a)
200 #define _cairo_int64_le(a,b) (!_cairo_int64_gt (a,b))
201 #define _cairo_int64_ne(a,b) (!_cairo_int64_eq (a,b))
202 #define _cairo_int64_ge(a,b) (!_cairo_int64_lt (a,b))
203 #define _cairo_int64_gt(a,b) _cairo_int64_lt (b,a)
210 typedef struct _cairo_uquorem64 {
215 typedef struct _cairo_quorem64 {
236 typedef struct cairo_uint128 {
242 #define _cairo_uint128_to_uint64(a) ((a).lo)
243 #define _cairo_uint128_to_uint32(a) _cairo_uint64_to_uint32 (_cairo_uint128_to_uint64 (a))
254 #define _cairo_uint128_negative(a) (_cairo_uint64_negative (a.hi))
257 #define _cairo_uint128_to_int128(i) (i)
258 #define _cairo_int128_to_uint128(i) (i)
262 #define _cairo_int128_to_int64(a) ((cairo_int64_t)(a).lo)
263 #define _cairo_int128_to_int32(a) _cairo_int64_to_int32 (_cairo_int128_to_int64 (a))
264 #define _cairo_int128_add(a,b) _cairo_uint128_add (a,b)
265 #define _cairo_int128_sub(a,b) _cairo_uint128_sub (a,b)
266 #define _cairo_int128_mul(a,b) _cairo_uint128_mul (a,b)
268 #define _cairo_int128_lsl(a,b) _cairo_uint128_lsl (a,b)
269 #define _cairo_int128_rsl(a,b) _cairo_uint128_rsl (a,b)
270 #define _cairo_int128_rsa(a,b) _cairo_uint128_rsa (a,b)
272 #define _cairo_int128_eq(a,b) _cairo_uint128_eq (a,b)
273 #define _cairo_int128_negate(a) _cairo_uint128_negate (a)
274 #define _cairo_int128_negative(a) (_cairo_uint128_negative (a))
275 #define _cairo_int128_not(a) _cairo_uint128_not (a)
284 #define _cairo_uint32_to_uint128(i) ((uint128_t)(i))
285 #define _cairo_uint64_to_uint128(i) ((uint128_t)(i))
286 #define _cairo_uint128_to_uint64(i) ((uint64_t)(i))
287 #define _cairo_uint128_to_uint32(i) ((uint32_t)(i))
288 #define _cairo_uint128_add(a,b) ((a) + (b))
289 #define _cairo_uint128_sub(a,b) ((a) - (b))
290 #define _cairo_uint128_mul(a,b) ((a) * (b))
291 #define _cairo_uint64x64_128_mul(a,b) ((uint128_t)(a) * (b))
292 #define _cairo_uint128_lsl(a,b) ((a) << (b))
293 #define _cairo_uint128_rsl(a,b) ((uint128_t)(a) >> (b))
294 #define _cairo_uint128_rsa(a,b) ((uint128_t)((int128_t)(a) >> (b)))
295 #define _cairo_uint128_lt(a,b) ((a) < (b))
296 #define _cairo_uint128_eq(a,b) ((a) == (b))
297 #define _cairo_uint128_negate(a) ((uint128_t) -((int128_t)(a)))
298 #define _cairo_uint128_negative(a) ((int128_t)(a) < 0)
299 #define _cairo_uint128_not(a) (~(a))
301 #define _cairo_uint128_to_int128(i) ((int128_t)(i))
302 #define _cairo_int128_to_uint128(i) ((uint128_t)(i))
304 #define _cairo_int32_to_int128(i) ((int128_t)(i))
305 #define _cairo_int64_to_int128(i) ((int128_t)(i))
306 #define _cairo_int128_to_int64(i) ((int64_t)(i))
307 #define _cairo_int128_to_int32(i) ((int32_t)(i))
308 #define _cairo_int128_add(a,b) ((a) + (b))
309 #define _cairo_int128_sub(a,b) ((a) - (b))
310 #define _cairo_int128_mul(a,b) ((a) * (b))
311 #define _cairo_int64x64_128_mul(a,b) ((int128_t)(a) * (b))
312 #define _cairo_int128_lt(a,b) ((a) < (b))
313 #define _cairo_int128_eq(a,b) ((a) == (b))
314 #define _cairo_int128_lsl(a,b) ((a) << (b))
315 #define _cairo_int128_rsl(a,b) ((int128_t)((uint128_t)(a) >> (b)))
316 #define _cairo_int128_rsa(a,b) ((int128_t)(a) >> (b))
317 #define _cairo_int128_negate(a) (-(a))
318 #define _cairo_int128_negative(a) ((a) < 0)
319 #define _cairo_int128_not(a) (~(a))
323 typedef struct _cairo_uquorem128 {
328 typedef struct _cairo_quorem128 {
347 #define _cairo_uint128_le(a,b) (!_cairo_uint128_gt (a,b))
348 #define _cairo_uint128_ne(a,b) (!_cairo_uint128_eq (a,b))
349 #define _cairo_uint128_ge(a,b) (!_cairo_uint128_lt (a,b))
350 #define _cairo_uint128_gt(a,b) _cairo_uint128_lt (b,a)
352 #define _cairo_int128_le(a,b) (!_cairo_int128_gt (a,b))
353 #define _cairo_int128_ne(a,b) (!_cairo_int128_eq (a,b))
354 #define _cairo_int128_ge(a,b) (!_cairo_int128_lt (a,b))
355 #define _cairo_int128_gt(a,b) _cairo_int128_lt (b,a)
#define _cairo_int64_lt(a, b)
cairo_uquorem64_t cairo_I _cairo_uint_96by64_32x64_divrem(cairo_uint128_t num, cairo_uint64_t den)
_cairo_uint_96by64_32x64_divrem:
cairo_quorem64_t cairo_I _cairo_int_96by64_32x64_divrem(cairo_int128_t num, cairo_int64_t den)
#define _cairo_uint64_eq(a, b)
cairo_uint128_t cairo_I _cairo_uint128_negate(cairo_uint128_t a)
#define _cairo_uint64_add(a, b)
cairo_quorem128_t cairo_I _cairo_int128_divrem(cairo_int128_t num, cairo_int128_t den)
int cairo_I _cairo_int128_lt(cairo_int128_t a, cairo_int128_t b)
#define _cairo_uint64_negate(a)
cairo_uint128_t cairo_I _cairo_uint128_not(cairo_uint128_t a)
#define _cairo_uint64_lt(a, b)
#define _cairo_int32x32_64_mul(a, b)
cairo_int128_t cairo_I _cairo_int64_to_int128(cairo_int64_t i)
cairo_uquorem64_t cairo_I _cairo_uint64_divrem(cairo_uint64_t num, cairo_uint64_t den)
#define _cairo_uint64_mul(a, b)
const char * cairo_impl64
int cairo_I _cairo_uint128_eq(cairo_uint128_t a, cairo_uint128_t b)
cairo_uint128_t cairo_I _cairo_uint128_add(cairo_uint128_t a, cairo_uint128_t b)
cairo_quorem64_t cairo_I _cairo_int64_divrem(cairo_int64_t num, cairo_int64_t den)
#define _cairo_uint32x32_64_mul(a, b)
cairo_uint128_t cairo_I _cairo_uint128_mul(cairo_uint128_t a, cairo_uint128_t b)
#define _cairo_uint64_lsl(a, b)
const char * cairo_impl128
cairo_int128_t cairo_I _cairo_int64x64_128_mul(cairo_int64_t a, cairo_int64_t b)
#define _cairo_int32_to_int64(i)
cairo_uint128_t cairo_I _cairo_uint32_to_uint128(uint32_t i)
#define _cairo_uint64_sub(a, b)
cairo_uint128_t cairo_I _cairo_uint64x64_128_mul(cairo_uint64_t a, cairo_uint64_t b)
cairo_uint128_t cairo_I _cairo_uint128_sub(cairo_uint128_t a, cairo_uint128_t b)
#define _cairo_uint64_rsa(a, b)
cairo_uint128_t cairo_I _cairo_uint128_lsl(cairo_uint128_t a, int shift)
#define _cairo_uint64_rsl(a, b)
cairo_uint128_t cairo_I _cairo_uint128_rsl(cairo_uint128_t a, int shift)
int cairo_I _cairo_uint128_lt(cairo_uint128_t a, cairo_uint128_t b)
cairo_uquorem128_t cairo_I _cairo_uint128_divrem(cairo_uint128_t num, cairo_uint128_t den)
cairo_uint128_t cairo_I _cairo_uint128_rsa(cairo_uint128_t a, int shift)
#define _cairo_uint64_not(a)
#define _cairo_uint32_to_uint64(i)
cairo_int128_t cairo_I _cairo_int32_to_int128(int32_t i)
cairo_uint128_t cairo_I _cairo_uint64_to_uint128(cairo_uint64_t i)
__uint128_t uint128_t
Some compilers do not have this defined, so we define it.
__int128_t int128_t
Some compilers do not have this defined, so we define it.