DEADSOFTWARE

Patched for Linux
[mp3cc.git] / MPC.3.5.LINUX / preverifier / typedefs.h
1 /*
2 * @(#)typedefs.h 1.4 02/09/27
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 _TYPEDEFS_H_
17 #define _TYPEDEFS_H_
19 #include "typedefs_md.h" /* for int64_t */
21 /*
22 * Macros to deal with the JavaVM's stack alignment. Many machines
23 * require doublewords to be double aligned. This union is used by
24 * code in math.h as a more portable way do alignment on machines
25 * that require it. This union and the macros that use it came from
26 * Netscape.
27 */
29 typedef union Java8Str {
30 int32_t x[2];
31 double d;
32 int64_t l;
33 void *p;
34 } Java8;
37 #ifdef HAVE_ALIGNED_LONGLONGS
38 #define GET_INT64(_t,_addr) ( ((_t).x[0] = ((int32_t*)(_addr))[0]), \
39 ((_t).x[1] = ((int32_t*)(_addr))[1]), \
40 (_t).l )
41 #define SET_INT64(_t, _addr, _v) ( (_t).l = (_v), \
42 ((int32_t*)(_addr))[0] = (_t).x[0], \
43 ((int32_t*)(_addr))[1] = (_t).x[1] )
44 #else
45 #define GET_INT64(_t,_addr) (*(int64_t*)(_addr))
46 #define SET_INT64(_t, _addr, _v) (*(int64_t*)(_addr) = (_v))
47 #endif
49 /* If double's must be aligned on doubleword boundaries then define this */
50 #ifdef HAVE_ALIGNED_DOUBLES
51 #define GET_DOUBLE(_t,_addr) ( ((_t).x[0] = ((int32_t*)(_addr))[0]), \
52 ((_t).x[1] = ((int32_t*)(_addr))[1]), \
53 (_t).d )
54 #define SET_DOUBLE(_t, _addr, _v) ( (_t).d = (_v), \
55 ((int32_t*)(_addr))[0] = (_t).x[0], \
56 ((int32_t*)(_addr))[1] = (_t).x[1] )
57 #else
58 #define GET_DOUBLE(_t,_addr) (*(double*)(_addr))
59 #define SET_DOUBLE(_t, _addr, _v) (*(double*)(_addr) = (_v))
60 #endif
62 /* If pointers are 64bits then define this */
63 #ifdef HAVE_64BIT_POINTERS
64 #define GET_HANDLE(_t,_addr) ( ((_t).x[0] = ((int32_t*)(_addr))[0]), \
65 ((_t).x[1] = ((int32_t*)(_addr))[1]), \
66 (_t).p )
67 #define SET_HANDLE(_t, _addr, _v) ( (_t).p = (_v), \
68 ((int32_t*)(_addr))[0] = (_t).x[0], \
69 ((int32_t*)(_addr))[1] = (_t).x[1] )
70 #else
71 #define GET_HANDLE(_t,_addr) (*(JHandle*)(_addr))
72 #define SET_HANDLE(_t, _addr, _v) (*(JHandle*)(_addr) = (_v))
73 #endif
75 #undef TRUE
76 #undef FALSE
78 typedef enum {
79 FALSE = 0,
80 TRUE = 1
81 } bool_t;
83 #endif /* !_TYPEDEFS_H_ */