< prev index next >

src/java.base/unix/native/libjava/jlong_md.h

Print this page
rev 59105 : imported patch corelibs


   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.  Oracle designates this
   8  * particular file as subject to the "Classpath" exception as provided
   9  * by Oracle in the LICENSE file that accompanied this code.
  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any
  23  * questions.
  24  */
  25 
  26 #ifndef _SOLARIS_JLONG_MD_H_
  27 #define _SOLARIS_JLONG_MD_H_
  28 
  29 /* Make sure ptrdiff_t is defined */
  30 #include <stddef.h>
  31 #include <stdint.h>  /* For uintptr_t */
  32 
  33 #define jlong_high(a)   ((jint)((a)>>32))
  34 #define jlong_low(a)    ((jint)(a))
  35 #define jlong_add(a, b) ((a) + (b))
  36 #define jlong_and(a, b) ((a) & (b))
  37 #define jlong_div(a, b) ((a) / (b))
  38 #define jlong_mul(a, b) ((a) * (b))
  39 #define jlong_neg(a)    (-(a))
  40 #define jlong_not(a)    (~(a))
  41 #define jlong_or(a, b)  ((a) | (b))
  42 #define jlong_shl(a, n) ((a) << (n))
  43 #define jlong_shr(a, n) ((a) >> (n))
  44 #define jlong_sub(a, b) ((a) - (b))
  45 #define jlong_xor(a, b) ((a) ^ (b))
  46 #define jlong_rem(a,b)  ((a) % (b))
  47 


  80   #endif
  81 #endif
  82 
  83 #define jint_to_jlong(a)        ((jlong)(a))
  84 #define jlong_to_jint(a)        ((jint)(a))
  85 
  86 /* Useful on machines where jlong and jdouble have different endianness. */
  87 #define jlong_to_jdouble_bits(a)
  88 #define jdouble_to_jlong_bits(a)
  89 
  90 #define jlong_to_int(a)     ((int)(a))
  91 #define int_to_jlong(a)     ((jlong)(a))
  92 #define jlong_to_uint(a)    ((unsigned int)(a))
  93 #define uint_to_jlong(a)    ((jlong)(a))
  94 #define jlong_to_ptrdiff(a) ((ptrdiff_t)(a))
  95 #define ptrdiff_to_jlong(a) ((jlong)(a))
  96 #define jlong_to_size(a)    ((size_t)(a))
  97 #define size_to_jlong(a)    ((jlong)(a))
  98 #define long_to_jlong(a)    ((jlong)(a))
  99 
 100 #endif /* !_SOLARIS_JLONG_MD_H_ */


   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.  Oracle designates this
   8  * particular file as subject to the "Classpath" exception as provided
   9  * by Oracle in the LICENSE file that accompanied this code.
  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any
  23  * questions.
  24  */
  25 
  26 #ifndef _UNIX_JLONG_MD_H_
  27 #define _UNIX_JLONG_MD_H_
  28 
  29 /* Make sure ptrdiff_t is defined */
  30 #include <stddef.h>
  31 #include <stdint.h>  /* For uintptr_t */
  32 
  33 #define jlong_high(a)   ((jint)((a)>>32))
  34 #define jlong_low(a)    ((jint)(a))
  35 #define jlong_add(a, b) ((a) + (b))
  36 #define jlong_and(a, b) ((a) & (b))
  37 #define jlong_div(a, b) ((a) / (b))
  38 #define jlong_mul(a, b) ((a) * (b))
  39 #define jlong_neg(a)    (-(a))
  40 #define jlong_not(a)    (~(a))
  41 #define jlong_or(a, b)  ((a) | (b))
  42 #define jlong_shl(a, n) ((a) << (n))
  43 #define jlong_shr(a, n) ((a) >> (n))
  44 #define jlong_sub(a, b) ((a) - (b))
  45 #define jlong_xor(a, b) ((a) ^ (b))
  46 #define jlong_rem(a,b)  ((a) % (b))
  47 


  80   #endif
  81 #endif
  82 
  83 #define jint_to_jlong(a)        ((jlong)(a))
  84 #define jlong_to_jint(a)        ((jint)(a))
  85 
  86 /* Useful on machines where jlong and jdouble have different endianness. */
  87 #define jlong_to_jdouble_bits(a)
  88 #define jdouble_to_jlong_bits(a)
  89 
  90 #define jlong_to_int(a)     ((int)(a))
  91 #define int_to_jlong(a)     ((jlong)(a))
  92 #define jlong_to_uint(a)    ((unsigned int)(a))
  93 #define uint_to_jlong(a)    ((jlong)(a))
  94 #define jlong_to_ptrdiff(a) ((ptrdiff_t)(a))
  95 #define ptrdiff_to_jlong(a) ((jlong)(a))
  96 #define jlong_to_size(a)    ((size_t)(a))
  97 #define size_to_jlong(a)    ((jlong)(a))
  98 #define long_to_jlong(a)    ((jlong)(a))
  99 
 100 #endif /* !_UNIX_JLONG_MD_H_ */
< prev index next >