home *** CD-ROM | disk | FTP | other *** search
/ Ultra Pack / UltraComputing Technology Demos and Tools.iso / java / include / solaris / typedefs_md.h < prev   
Encoding:
C/C++ Source or Header  |  1996-05-03  |  2.5 KB  |  89 lines

  1. /*
  2.  * @(#)typedefs_md.h    1.22 96/03/20
  3.  *
  4.  * Copyright (c) 1994 Sun Microsystems, Inc. All Rights Reserved.
  5.  *
  6.  * Permission to use, copy, modify, and distribute this software
  7.  * and its documentation for NON-COMMERCIAL purposes and without
  8.  * fee is hereby granted provided that this copyright notice
  9.  * appears in all copies. Please refer to the file "copyright.html"
  10.  * for further important copyright and licensing information.
  11.  *
  12.  * SUN MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF
  13.  * THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
  14.  * TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
  15.  * PARTICULAR PURPOSE, OR NON-INFRINGEMENT. SUN SHALL NOT BE LIABLE FOR
  16.  * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
  17.  * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES.
  18.  */
  19.  
  20. /*
  21.  * Solaris-dependent types for Green threads
  22.  */
  23.  
  24. #ifndef _SOLARIS_TYPES_MD_H_
  25. #define _SOLARIS_TYPES_MD_H_
  26.  
  27. #include <sys/types.h>
  28. #include <sys/stat.h>
  29. #include "bool.h"
  30.  
  31. #ifndef    _UINT64_T
  32. #define    _UINT64_T
  33. typedef unsigned long long uint64_t;
  34. #define _UINT32_T
  35. typedef unsigned long uint32_t;
  36. #endif
  37.  
  38. #ifndef    _INT64_T
  39. #define    _INT64_T
  40. typedef long long int64_t;
  41. #define _INT32_T
  42. typedef long int32_t;
  43. #endif
  44.  
  45.  
  46. /* use these macros when the compiler supports the long long type */
  47.  
  48. #define ll_high(a)    ((long)((a)>>32))
  49. #define ll_low(a)    ((long)(a))
  50. #define int2ll(a)    ((int64_t)(a))
  51. #define ll2int(a)    ((int)(a))
  52. #define ll_add(a, b)    ((a) + (b))
  53. #define ll_and(a, b)    ((a) & (b))
  54. #define ll_div(a, b)    ((a) / (b))
  55. #define ll_mul(a, b)    ((a) * (b))
  56. #define ll_neg(a)    (-(a))
  57. #define ll_not(a)    (~(a))
  58. #define ll_or(a, b)    ((a) | (b))
  59. #define ll_shl(a, n)    ((a) << (n))
  60. #define ll_shr(a, n)    ((a) >> (n))
  61. #define ll_sub(a, b)    ((a) - (b))
  62. #define ll_ushr(a, n)    ((unsigned long long)(a) >> (n))
  63. #define ll_xor(a, b)    ((a) ^ (b))
  64. #define uint2ll(a)    ((uint64_t)(unsigned long)(a))
  65. #define ll_rem(a,b)    ((a) % (b))
  66.  
  67. #define float2ll(f)    ((int64_t) (f))
  68. #define ll2float(a)    ((float) (a))
  69. #define ll2double(a)    ((double) (a))
  70. #define double2ll(f)    ((int64_t) (f))
  71.  
  72. /* comparison operators */
  73. #define ll_ltz(ll)    ((ll)<0)
  74. #define ll_gez(ll)    ((ll)>=0)
  75. #define ll_eqz(a)    ((a) == 0)
  76. #define ll_eq(a, b)    ((a) == (b))
  77. #define ll_ne(a,b)    ((a) != (b))
  78. #define ll_ge(a,b)    ((a) >= (b))
  79. #define ll_le(a,b)    ((a) <= (b))
  80. #define ll_lt(a,b)    ((a) < (b))
  81. #define ll_gt(a,b)    ((a) > (b))
  82.  
  83. #define ll_zero_const    ((int64_t) 0)
  84. #define ll_one_const    ((int64_t) 1)
  85.  
  86. extern void ll2str(int64_t a, char *s, char *limit);
  87.  
  88. #endif /* !_SOLARIS_TYPES_MD_H_ */
  89.