DEADSOFTWARE

Patched for Linux
[mp3cc.git] / MPC.3.5.LINUX / preverifier / typedefs_md.h
1 /*
2 * @(#)typedefs_md.h 1.2 00/05/31
3 *
4 * Copyright 1995-1998 by Sun Microsystems, Inc.,
5 * 901 San Antonio Road, Palo Alto, California, 94303, U.S.A.
6 * All rights reserved.
7 *
8 * This software is the confidential and proprietary information
9 * of Sun Microsystems, Inc. ("Confidential Information"). You
10 * shall not disclose such Confidential Information and shall use
11 * it only in accordance with the terms of the license agreement
12 * you entered into with Sun.
13 * Use is subject to license terms.
14 */
16 #ifndef _TYPES_MD_H_
17 #define _TYPES_MD_H_
19 #include <sys/types.h>
20 #include <sys/stat.h>
22 #ifdef SOLARIS2
23 /* don't redefine typedef's on Solaris 2.6 or Later */
25 #if !defined(_ILP32) && !defined(_LP64)
27 #ifndef _UINT64_T
28 #define _UINT64_T
29 typedef unsigned long long uint64_t;
30 #define _UINT32_T
31 typedef unsigned long uint32_t;
32 #endif
34 #ifndef _INT64_T
35 #define _INT64_T
36 typedef long long int64_t;
37 #define _INT32_T
38 typedef long int32_t;
39 #endif
41 #endif /* !defined(_ILP32) && !defined(_LP64) */
42 #endif /* SOLARIS2 */
44 #ifdef LINUX
45 #ifndef _UINT64_T
46 #define _UINT64_T
47 typedef unsigned long long uint64_t;
48 #define _UINT32_T
49 typedef unsigned long uint32_t;
50 #endif
51 #endif /* LINUX */
53 #ifdef WIN32
54 typedef __int64 int64_t;
55 typedef unsigned __int64 uint64_t;
56 typedef long int32_t;
57 typedef unsigned long uint32_t;
58 typedef unsigned int uint_t;
59 #endif
61 /* use these macros when the compiler supports the long long type */
63 #define ll_high(a) ((long)((a)>>32))
64 #define ll_low(a) ((long)(a))
65 #define int2ll(a) ((int64_t)(a))
66 #define ll2int(a) ((int)(a))
67 #define ll_add(a, b) ((a) + (b))
68 #define ll_and(a, b) ((a) & (b))
69 #define ll_div(a, b) ((a) / (b))
70 #define ll_mul(a, b) ((a) * (b))
71 #define ll_neg(a) (-(a))
72 #define ll_not(a) (~(a))
73 #define ll_or(a, b) ((a) | (b))
74 #define ll_shl(a, n) ((a) << (n))
75 #define ll_shr(a, n) ((a) >> (n))
76 #define ll_sub(a, b) ((a) - (b))
77 #define ll_ushr(a, n) ((unsigned long long)(a) >> (n))
78 #define ll_xor(a, b) ((a) ^ (b))
79 #define uint2ll(a) ((uint64_t)(unsigned long)(a))
80 #define ll_rem(a,b) ((a) % (b))
82 #define INT_OP(x,op,y) ((x) op (y))
83 #define NAN_CHECK(l,r,x) x
84 #define IS_NAN(x) isnand(x)
87 /* On Intel these conversions have to be method calls and not typecasts.
88 See the win32 typedefs_md.h file */
89 #if defined(i386) || defined (__i386)
91 extern int32_t float2l(float f);
92 extern int32_t double2l(double d);
93 extern int64_t float2ll(float f);
94 extern int64_t double2ll(double d);
96 #else /* not i386 */
98 #define float2l(f) (f)
99 #define double2l(f) (f)
100 #define float2ll(f) ((int64_t) (f))
101 #define double2ll(f) ((int64_t) (f))
103 #endif /* i386 */
106 #define ll2float(a) ((float) (a))
107 #define ll2double(a) ((double) (a))
109 /* comparison operators */
110 #define ll_ltz(ll) ((ll)<0)
111 #define ll_gez(ll) ((ll)>=0)
112 #define ll_eqz(a) ((a) == 0)
113 #define ll_eq(a, b) ((a) == (b))
114 #define ll_ne(a,b) ((a) != (b))
115 #define ll_ge(a,b) ((a) >= (b))
116 #define ll_le(a,b) ((a) <= (b))
117 #define ll_lt(a,b) ((a) < (b))
118 #define ll_gt(a,b) ((a) > (b))
120 #define ll_zero_const ((int64_t) 0)
121 #define ll_one_const ((int64_t) 1)
123 extern void ll2str(int64_t a, char *s, char *limit);
125 #ifdef ppc
126 #define HAVE_ALIGNED_DOUBLES
127 #define HAVE_ALIGNED_LONGLONGS
128 #endif
130 #ifdef SOLARIS2
131 #include <sys/byteorder.h>
132 #endif
134 #ifdef LINUX
135 #include <asm/byteorder.h>
136 #endif
138 #ifdef WIN32
139 #include <windows.h>
140 #endif
142 #endif /* !_TYPES_MD_H_ */