Back to index

lightning-sunbird  0.9+nobinonly
jri_md.h
Go to the documentation of this file.
00001 /* -*- Mode: C; tab-width: 4; -*- */
00002 /* ***** BEGIN LICENSE BLOCK *****
00003  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
00004  *
00005  * The contents of this file are subject to the Mozilla Public License Version
00006  * 1.1 (the "License"); you may not use this file except in compliance with
00007  * the License. You may obtain a copy of the License at
00008  * http://www.mozilla.org/MPL/
00009  *
00010  * Software distributed under the License is distributed on an "AS IS" basis,
00011  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
00012  * for the specific language governing rights and limitations under the
00013  * License.
00014  *
00015  * The Original Code is the Java Runtime Interface.
00016  *
00017  * The Initial Developer of the Original Code is
00018  * Netscape Communications Corp.
00019  * Portions created by the Initial Developer are Copyright (C) 1996
00020  * the Initial Developer. All Rights Reserved.
00021  *
00022  * Contributor(s):
00023  *
00024  * Alternatively, the contents of this file may be used under the terms of
00025  * either the GNU General Public License Version 2 or later (the "GPL"), or
00026  * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
00027  * in which case the provisions of the GPL or the LGPL are applicable instead
00028  * of those above. If you wish to allow use of your version of this file only
00029  * under the terms of either the GPL or the LGPL, and not to allow others to
00030  * use your version of this file under the terms of the MPL, indicate your
00031  * decision by deleting the provisions above and replace them with the notice
00032  * and other provisions required by the GPL or the LGPL. If you do not delete
00033  * the provisions above, a recipient may use your version of this file under
00034  * the terms of any one of the MPL, the GPL or the LGPL.
00035  *
00036  * ***** END LICENSE BLOCK ***** */  
00037  
00038 #ifndef JRI_MD_H
00039 #define JRI_MD_H
00040 
00041 #include <assert.h>
00042 
00043 #ifdef __cplusplus
00044 extern "C" {
00045 #endif
00046 
00047 /*******************************************************************************
00048  * WHAT'S UP WITH THIS FILE?
00049  * 
00050  * This is where we define the mystical JRI_PUBLIC_API macro that works on all
00051  * platforms. If you're running with Visual C++, Symantec C, or Borland's 
00052  * development environment on the PC, you're all set. Or if you're on the Mac
00053  * with Metrowerks, Symantec or MPW with SC you're ok too. For UNIX it shouldn't
00054  * matter.
00055  *
00056  * On UNIX though you probably care about a couple of other symbols though:
00057  *     IS_LITTLE_ENDIAN must be defined for little-endian systems
00058  *     HAVE_LONG_LONG must be defined on systems that have 'long long' integers
00059  *     HAVE_ALIGNED_LONGLONGS must be defined if long-longs must be 8 byte aligned
00060  *     HAVE_ALIGNED_DOUBLES must be defined if doubles must be 8 byte aligned
00061  *     IS_64 must be defined on 64-bit machines (like Dec Alpha)
00062  ******************************************************************************/
00063 
00064 /* DLL Entry modifiers... */
00065 
00066 /* PC */
00067 #if defined(XP_WIN) || defined(XP_OS2) || defined(_WINDOWS) || defined(WIN32) || defined(_WIN32)
00068 #      include <windows.h>
00069 #      if defined(_MSC_VER)
00070 #             if defined(WIN32) || defined(_WIN32)
00071 #                    define JRI_PUBLIC_API(ResultType)  _declspec(dllexport) ResultType
00072 #                    define JRI_PUBLIC_VAR(VarType)            VarType
00073 #                    define JRI_NATIVE_STUB(ResultType) _declspec(dllexport) ResultType
00074 #                    define JRI_CALLBACK
00075 #             else /* !_WIN32 */
00076 #                 if defined(_WINDLL)
00077 #                    define JRI_PUBLIC_API(ResultType)  ResultType __cdecl __export __loadds 
00078 #                    define JRI_PUBLIC_VAR(VarType)            VarType
00079 #                    define JRI_NATIVE_STUB(ResultType) ResultType __cdecl __loadds
00080 #                    define JRI_CALLBACK                __loadds
00081 #             else /* !WINDLL */
00082 #                    define JRI_PUBLIC_API(ResultType)  ResultType __cdecl __export
00083 #                    define JRI_PUBLIC_VAR(VarType)            VarType
00084 #                    define JRI_NATIVE_STUB(ResultType) ResultType __cdecl __export
00085 #                    define JRI_CALLBACK                __export
00086 #                   endif /* !WINDLL */
00087 #             endif /* !_WIN32 */
00088 #      elif defined(__BORLANDC__)
00089 #             if defined(WIN32) || defined(_WIN32)
00090 #                    define JRI_PUBLIC_API(ResultType)  __export ResultType
00091 #                    define JRI_PUBLIC_VAR(VarType)            VarType
00092 #                    define JRI_NATIVE_STUB(ResultType)  __export ResultType
00093 #                    define JRI_CALLBACK
00094 #             else /* !_WIN32 */
00095 #                    define JRI_PUBLIC_API(ResultType)  ResultType _cdecl _export _loadds 
00096 #                    define JRI_PUBLIC_VAR(VarType)            VarType
00097 #                    define JRI_NATIVE_STUB(ResultType) ResultType _cdecl _loadds
00098 #                    define JRI_CALLBACK                _loadds
00099 #             endif
00100 #      else
00101 #             error Unsupported PC development environment.    
00102 #      endif
00103 #      ifndef IS_LITTLE_ENDIAN
00104 #             define IS_LITTLE_ENDIAN
00105 #      endif
00106 
00107 /* Mac */
00108 #elif macintosh || Macintosh || THINK_C
00109 #      if defined(__MWERKS__)                           /* Metrowerks */
00110 #             if !__option(enumsalwaysint)
00111 #                    error You need to define 'Enums Always Int' for your project.
00112 #             endif
00113 #             if defined(GENERATING68K) && !GENERATINGCFM 
00114 #                    if !__option(fourbyteints) 
00115 #                           error You need to define 'Struct Alignment: 68k' for your project.
00116 #                    endif
00117 #             endif /* !GENERATINGCFM */
00118 #             define JRI_PUBLIC_API(ResultType)  __declspec(export) ResultType
00119 #             define JRI_PUBLIC_VAR(VarType)            JRI_PUBLIC_API(VarType)
00120 #             define JRI_NATIVE_STUB(ResultType) JRI_PUBLIC_API(ResultType)
00121 #      elif defined(__SC__)                      /* Symantec */
00122 #             error What are the Symantec defines? (warren@netscape.com)
00123 #      elif macintosh && applec                  /* MPW */
00124 #             error Please upgrade to the latest MPW compiler (SC).
00125 #      else
00126 #             error Unsupported Mac development environment.
00127 #      endif
00128 #      define JRI_CALLBACK
00129 
00130 /* Unix or else */
00131 #else
00132 #      define JRI_PUBLIC_API(ResultType)         ResultType
00133 #   define JRI_PUBLIC_VAR(VarType)          VarType
00134 #       define JRI_NATIVE_STUB(ResultType)                  ResultType
00135 #      define JRI_CALLBACK
00136 #endif
00137 
00138 #ifndef FAR          /* for non-Win16 */
00139 #define FAR
00140 #endif
00141 
00142 /******************************************************************************/
00143 
00144 /* Java Scalar Types */
00145 
00146 #if 0  /* now in jni.h */
00147 typedef short               jchar;
00148 typedef short               jshort;
00149 typedef float               jfloat;
00150 typedef double                     jdouble;
00151 typedef juint               jsize;
00152 #endif
00153 
00154 typedef unsigned char       jbool;
00155 typedef signed char  jbyte;
00156 #ifdef IS_64 /* XXX ok for alpha, but not right on all 64-bit architectures */
00157 typedef unsigned int juint;
00158 typedef int                        jint;
00159 #else
00160 typedef unsigned long       juint;
00161 typedef long                jint;
00162 #endif
00163 
00164 /*******************************************************************************
00165  * jlong : long long (64-bit signed integer type) support.
00166  ******************************************************************************/
00167 
00168 /*
00169 ** Bit masking macros.  (n must be <= 31 to be portable)
00170 */
00171 #define JRI_BIT(n)                 ((juint)1 << (n))
00172 #define JRI_BITMASK(n)             (JRI_BIT(n) - 1)
00173 
00174 #ifdef HAVE_LONG_LONG
00175 
00176 #if !(defined(WIN32) || defined(_WIN32))
00177 typedef long long                  jlong;
00178 typedef unsigned long long  julong;
00179 
00180 #define jlong_MAXINT        0x7fffffffffffffffLL
00181 #define jlong_MININT        0x8000000000000000LL
00182 #define jlong_ZERO                 0x0LL
00183 
00184 #else
00185 typedef LONGLONG                   jlong;
00186 typedef DWORDLONG                  julong;
00187 
00188 #define jlong_MAXINT        0x7fffffffffffffffi64
00189 #define jlong_MININT        0x8000000000000000i64
00190 #define jlong_ZERO                 0x0i64
00191 
00192 #endif
00193 
00194 #define jlong_IS_ZERO(a)    ((a) == 0)
00195 #define jlong_EQ(a, b)             ((a) == (b))
00196 #define jlong_NE(a, b)             ((a) != (b))
00197 #define jlong_GE_ZERO(a)    ((a) >= 0)
00198 #define jlong_CMP(a, op, b) ((a) op (b))
00199 
00200 #define jlong_AND(r, a, b)  ((r) = (a) & (b))
00201 #define jlong_OR(r, a, b)   ((r) = (a) | (b))
00202 #define jlong_XOR(r, a, b)  ((r) = (a) ^ (b))
00203 #define jlong_OR2(r, a)            ((r) = (r) | (a))
00204 #define jlong_NOT(r, a)            ((r) = ~(a))
00205 
00206 #define jlong_NEG(r, a)            ((r) = -(a))
00207 #define jlong_ADD(r, a, b)  ((r) = (a) + (b))
00208 #define jlong_SUB(r, a, b)  ((r) = (a) - (b))
00209 
00210 #define jlong_MUL(r, a, b)  ((r) = (a) * (b))
00211 #define jlong_DIV(r, a, b)  ((r) = (a) / (b))
00212 #define jlong_MOD(r, a, b)  ((r) = (a) % (b))
00213 
00214 #define jlong_SHL(r, a, b)  ((r) = (a) << (b))
00215 #define jlong_SHR(r, a, b)  ((r) = (a) >> (b))
00216 #define jlong_USHR(r, a, b) ((r) = (julong)(a) >> (b))
00217 #define jlong_ISHL(r, a, b) ((r) = ((jlong)(a)) << (b))
00218 
00219 #define jlong_L2I(i, l)            ((i) = (int)(l))
00220 #define jlong_L2UI(ui, l)   ((ui) =(unsigned int)(l))
00221 #define jlong_L2F(f, l)            ((f) = (l))
00222 #define jlong_L2D(d, l)            ((d) = (l))
00223 
00224 #define jlong_I2L(l, i)            ((l) = (i))
00225 #define jlong_UI2L(l, ui)   ((l) = (ui))
00226 #define jlong_F2L(l, f)            ((l) = (f))
00227 #define jlong_D2L(l, d)            ((l) = (d))
00228 
00229 #define jlong_UDIVMOD(qp, rp, a, b)  \
00230     (*(qp) = ((julong)(a) / (b)), \
00231      *(rp) = ((julong)(a) % (b)))
00232 
00233 #else  /* !HAVE_LONG_LONG */
00234 
00235 typedef struct {
00236 #ifdef IS_LITTLE_ENDIAN
00237     juint lo, hi;
00238 #else
00239     juint hi, lo;
00240 #endif
00241 } jlong;
00242 typedef jlong                      julong;
00243 
00244 extern jlong jlong_MAXINT, jlong_MININT, jlong_ZERO;
00245 
00246 #define jlong_IS_ZERO(a)    (((a).hi == 0) && ((a).lo == 0))
00247 #define jlong_EQ(a, b)             (((a).hi == (b).hi) && ((a).lo == (b).lo))
00248 #define jlong_NE(a, b)             (((a).hi != (b).hi) || ((a).lo != (b).lo))
00249 #define jlong_GE_ZERO(a)    (((a).hi >> 31) == 0)
00250 
00251 /*
00252  * NB: jlong_CMP and jlong_UCMP work only for strict relationals (<, >).
00253  */
00254 #define jlong_CMP(a, op, b) (((int32)(a).hi op (int32)(b).hi) ||          \
00255                              (((a).hi == (b).hi) && ((a).lo op (b).lo)))
00256 #define jlong_UCMP(a, op, b)       (((a).hi op (b).hi) ||                    \
00257                              (((a).hi == (b).hi) && ((a).lo op (b).lo)))
00258 
00259 #define jlong_AND(r, a, b)  ((r).lo = (a).lo & (b).lo,                    \
00260                              (r).hi = (a).hi & (b).hi)
00261 #define jlong_OR(r, a, b)   ((r).lo = (a).lo | (b).lo,                    \
00262                              (r).hi = (a).hi | (b).hi)
00263 #define jlong_XOR(r, a, b)  ((r).lo = (a).lo ^ (b).lo,                    \
00264                              (r).hi = (a).hi ^ (b).hi)
00265 #define jlong_OR2(r, a)            ((r).lo = (r).lo | (a).lo,                    \
00266                              (r).hi = (r).hi | (a).hi)
00267 #define jlong_NOT(r, a)            ((r).lo = ~(a).lo,                             \
00268                              (r).hi = ~(a).hi)
00269 
00270 #define jlong_NEG(r, a)            ((r).lo = -(int32)(a).lo,                     \
00271                              (r).hi = -(int32)(a).hi - ((r).lo != 0))
00272 #define jlong_ADD(r, a, b) {                                              \
00273     jlong _a, _b;                                                         \
00274     _a = a; _b = b;                                                       \
00275     (r).lo = _a.lo + _b.lo;                                               \
00276     (r).hi = _a.hi + _b.hi + ((r).lo < _b.lo);                            \
00277 }
00278 
00279 #define jlong_SUB(r, a, b) {                                              \
00280     jlong _a, _b;                                                         \
00281     _a = a; _b = b;                                                       \
00282     (r).lo = _a.lo - _b.lo;                                               \
00283     (r).hi = _a.hi - _b.hi - (_a.lo < _b.lo);                             \
00284 }                                                                         \
00285 
00286 /*
00287  * Multiply 64-bit operands a and b to get 64-bit result r.
00288  * First multiply the low 32 bits of a and b to get a 64-bit result in r.
00289  * Then add the outer and inner products to r.hi.
00290  */
00291 #define jlong_MUL(r, a, b) {                                              \
00292     jlong _a, _b;                                                         \
00293     _a = a; _b = b;                                                       \
00294     jlong_MUL32(r, _a.lo, _b.lo);                                         \
00295     (r).hi += _a.hi * _b.lo + _a.lo * _b.hi;                              \
00296 }
00297 
00298 /* XXX _jlong_lo16(a) = ((a) << 16 >> 16) is better on some archs (not on mips) */
00299 #define _jlong_lo16(a)             ((a) & JRI_BITMASK(16))
00300 #define _jlong_hi16(a)             ((a) >> 16)
00301 
00302 /*
00303  * Multiply 32-bit operands a and b to get 64-bit result r.
00304  * Use polynomial expansion based on primitive field element (1 << 16).
00305  */
00306 #define jlong_MUL32(r, a, b) {                                            \
00307      juint _a1, _a0, _b1, _b0, _y0, _y1, _y2, _y3;                        \
00308      _a1 = _jlong_hi16(a), _a0 = _jlong_lo16(a);                          \
00309      _b1 = _jlong_hi16(b), _b0 = _jlong_lo16(b);                          \
00310      _y0 = _a0 * _b0;                                                     \
00311      _y1 = _a0 * _b1;                                                     \
00312      _y2 = _a1 * _b0;                                                     \
00313      _y3 = _a1 * _b1;                                                     \
00314      _y1 += _jlong_hi16(_y0);                   /* can't carry */         \
00315      _y1 += _y2;                                /* might carry */         \
00316      if (_y1 < _y2) _y3 += 1 << 16;             /* propagate */           \
00317      (r).lo = (_jlong_lo16(_y1) << 16) + _jlong_lo16(_y0);                \
00318      (r).hi = _y3 + _jlong_hi16(_y1);                                     \
00319 }
00320 
00321 /*
00322  * Divide 64-bit unsigned operand a by 64-bit unsigned operand b, setting *qp
00323  * to the 64-bit unsigned quotient, and *rp to the 64-bit unsigned remainder.
00324  * Minimize effort if one of qp and rp is null.
00325  */
00326 #define jlong_UDIVMOD(qp, rp, a, b)       jlong_udivmod(qp, rp, a, b)
00327 
00328 extern JRI_PUBLIC_API(void)
00329 jlong_udivmod(julong *qp, julong *rp, julong a, julong b);
00330 
00331 #define jlong_DIV(r, a, b) {                                              \
00332     jlong _a, _b;                                                         \
00333     juint _negative = (int32)(a).hi < 0;                                  \
00334     if (_negative) {                                                      \
00335        jlong_NEG(_a, a);                                                     \
00336     } else {                                                              \
00337        _a = a;                                                               \
00338     }                                                                     \
00339     if ((int32)(b).hi < 0) {                                              \
00340        _negative ^= 1;                                                       \
00341        jlong_NEG(_b, b);                                                     \
00342     } else {                                                              \
00343        _b = b;                                                               \
00344     }                                                                     \
00345     jlong_UDIVMOD(&(r), 0, _a, _b);                                       \
00346     if (_negative)                                                        \
00347        jlong_NEG(r, r);                                                      \
00348 }
00349 
00350 #define jlong_MOD(r, a, b) {                                              \
00351     jlong _a, _b;                                                         \
00352     juint _negative = (int32)(a).hi < 0;                                  \
00353     if (_negative) {                                                      \
00354        jlong_NEG(_a, a);                                                     \
00355     } else {                                                              \
00356        _a = a;                                                               \
00357     }                                                                     \
00358     if ((int32)(b).hi < 0) {                                              \
00359        jlong_NEG(_b, b);                                                     \
00360     } else {                                                              \
00361        _b = b;                                                               \
00362     }                                                                     \
00363     jlong_UDIVMOD(0, &(r), _a, _b);                                       \
00364     if (_negative)                                                        \
00365        jlong_NEG(r, r);                                                      \
00366 }
00367 
00368 /*
00369  * NB: b is a juint, not jlong or julong, for the shift ops.
00370  */
00371 #define jlong_SHL(r, a, b) {                                              \
00372     if (b) {                                                              \
00373        jlong _a;                                                             \
00374         _a = a;                                                           \
00375         if ((b) < 32) {                                                   \
00376            (r).lo = _a.lo << (b);                                            \
00377            (r).hi = (_a.hi << (b)) | (_a.lo >> (32 - (b)));                  \
00378        } else {                                                              \
00379            (r).lo = 0;                                                       \
00380            (r).hi = _a.lo << ((b) & 31);                                     \
00381        }                                                                     \
00382     } else {                                                              \
00383        (r) = (a);                                                            \
00384     }                                                                     \
00385 }
00386 
00387 /* a is an int32, b is int32, r is jlong */
00388 #define jlong_ISHL(r, a, b) {                                             \
00389     if (b) {                                                              \
00390        jlong _a;                                                             \
00391        _a.lo = (a);                                                          \
00392        _a.hi = 0;                                                            \
00393         if ((b) < 32) {                                                   \
00394            (r).lo = (a) << (b);                                              \
00395            (r).hi = ((a) >> (32 - (b)));                                     \
00396        } else {                                                              \
00397            (r).lo = 0;                                                       \
00398            (r).hi = (a) << ((b) & 31);                                       \
00399        }                                                                     \
00400     } else {                                                              \
00401        (r).lo = (a);                                                         \
00402        (r).hi = 0;                                                           \
00403     }                                                                     \
00404 }
00405 
00406 #define jlong_SHR(r, a, b) {                                              \
00407     if (b) {                                                              \
00408        jlong _a;                                                             \
00409         _a = a;                                                           \
00410        if ((b) < 32) {                                                       \
00411            (r).lo = (_a.hi << (32 - (b))) | (_a.lo >> (b));                  \
00412            (r).hi = (int32)_a.hi >> (b);                                     \
00413        } else {                                                              \
00414            (r).lo = (int32)_a.hi >> ((b) & 31);                              \
00415            (r).hi = (int32)_a.hi >> 31;                                      \
00416        }                                                                     \
00417     } else {                                                              \
00418        (r) = (a);                                                            \
00419     }                                                                     \
00420 }
00421 
00422 #define jlong_USHR(r, a, b) {                                             \
00423     if (b) {                                                              \
00424        jlong _a;                                                             \
00425         _a = a;                                                           \
00426        if ((b) < 32) {                                                       \
00427            (r).lo = (_a.hi << (32 - (b))) | (_a.lo >> (b));                  \
00428            (r).hi = _a.hi >> (b);                                            \
00429        } else {                                                              \
00430            (r).lo = _a.hi >> ((b) & 31);                                     \
00431            (r).hi = 0;                                                       \
00432        }                                                                     \
00433     } else {                                                              \
00434        (r) = (a);                                                            \
00435     }                                                                     \
00436 }
00437 
00438 #define jlong_L2I(i, l)            ((i) = (l).lo)
00439 #define jlong_L2UI(ui, l)   ((ui) = (l).lo)
00440 #define jlong_L2F(f, l)            { double _d; jlong_L2D(_d, l); (f) = (float) _d; }
00441 
00442 #define jlong_L2D(d, l) {                                                 \
00443     int32 _negative;                                                      \
00444     jlong _absval;                                                        \
00445                                                                           \
00446     _negative = (l).hi >> 31;                                             \
00447     if (_negative) {                                                      \
00448        jlong_NEG(_absval, l);                                                \
00449     } else {                                                              \
00450        _absval = l;                                                          \
00451     }                                                                     \
00452     (d) = (double)_absval.hi * 4.294967296e9 + _absval.lo;                \
00453     if (_negative)                                                        \
00454        (d) = -(d);                                                           \
00455 }
00456 
00457 #define jlong_I2L(l, i)            ((l).hi = (i) >> 31, (l).lo = (i))
00458 #define jlong_UI2L(l, ui)   ((l).hi = 0, (l).lo = (ui))
00459 #define jlong_F2L(l, f)            { double _d = (double) f; jlong_D2L(l, _d); }
00460 
00461 #define jlong_D2L(l, d) {                                                 \
00462     int _negative;                                                        \
00463     double _absval, _d_hi;                                                \
00464     jlong _lo_d;                                                          \
00465                                                                           \
00466     _negative = ((d) < 0);                                                \
00467     _absval = _negative ? -(d) : (d);                                     \
00468                                                                           \
00469     (l).hi = (juint)(_absval / 4.294967296e9);                            \
00470     (l).lo = 0;                                                           \
00471     jlong_L2D(_d_hi, l);                                                  \
00472     _absval -= _d_hi;                                                     \
00473     _lo_d.hi = 0;                                                         \
00474     if (_absval < 0) {                                                    \
00475        _lo_d.lo = (juint) -_absval;                                          \
00476        jlong_SUB(l, l, _lo_d);                                               \
00477     } else {                                                              \
00478        _lo_d.lo = (juint) _absval;                                           \
00479        jlong_ADD(l, l, _lo_d);                                               \
00480     }                                                                     \
00481                                                                           \
00482     if (_negative)                                                        \
00483        jlong_NEG(l, l);                                                      \
00484 }
00485 
00486 #endif /* !HAVE_LONG_LONG */
00487 
00488 /******************************************************************************/
00489 
00490 #ifdef HAVE_ALIGNED_LONGLONGS
00491 #define JRI_GET_INT64(_t,_addr) ( ((_t).x[0] = ((jint*)(_addr))[0]), \
00492                               ((_t).x[1] = ((jint*)(_addr))[1]),      \
00493                               (_t).l )
00494 #define JRI_SET_INT64(_t, _addr, _v) ( (_t).l = (_v),                \
00495                                    ((jint*)(_addr))[0] = (_t).x[0], \
00496                                    ((jint*)(_addr))[1] = (_t).x[1] )
00497 #else
00498 #define JRI_GET_INT64(_t,_addr) (*(jlong*)(_addr))
00499 #define JRI_SET_INT64(_t, _addr, _v) (*(jlong*)(_addr) = (_v))
00500 #endif
00501 
00502 /* If double's must be aligned on doubleword boundaries then define this */
00503 #ifdef HAVE_ALIGNED_DOUBLES
00504 #define JRI_GET_DOUBLE(_t,_addr) ( ((_t).x[0] = ((jint*)(_addr))[0]), \
00505                                ((_t).x[1] = ((jint*)(_addr))[1]),      \
00506                                (_t).d )
00507 #define JRI_SET_DOUBLE(_t, _addr, _v) ( (_t).d = (_v),                \
00508                                     ((jint*)(_addr))[0] = (_t).x[0], \
00509                                     ((jint*)(_addr))[1] = (_t).x[1] )
00510 #else
00511 #define JRI_GET_DOUBLE(_t,_addr) (*(jdouble*)(_addr))
00512 #define JRI_SET_DOUBLE(_t, _addr, _v) (*(jdouble*)(_addr) = (_v))
00513 #endif
00514 
00515 /******************************************************************************/
00516 #ifdef __cplusplus
00517 }
00518 #endif
00519 #endif /* JRI_MD_H */
00520 /******************************************************************************/