home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 1997 May / Pcwk0597.iso / sybase / starbuck / java.z / typedefs_md.h < prev    next >
C/C++ Source or Header  |  1996-05-03  |  3KB  |  85 lines

  1. /*
  2.  * @(#)typedefs_md.h    1.18 95/11/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.  * Win32 dependent type definitions
  22.  */
  23.  
  24. #ifndef _WIN32_TYPEDEF_MD_H_
  25. #define _WIN32_TYPEDEF_MD_H_
  26.  
  27. #include <windows.h>
  28.  
  29. #include "bool.h"
  30.  
  31. typedef unsigned int uint_t;
  32. typedef long int32_t;
  33. typedef unsigned long uint32_t;
  34. typedef __int64    int64_t;
  35. typedef unsigned __int64 uint64_t;
  36.  
  37. /* use these macros when the compiler supports the long long type */
  38.  
  39. #define ll_high(a)    ((long)((a)>>32))
  40. #define ll_low(a)    ((long)(a))
  41. #define int2ll(a)    ((int64_t)(a))
  42. #define ll2int(a)    ((int)(a))
  43. #define ll_add(a, b)    ((a) + (b))
  44. #define ll_and(a, b)    ((a) & (b))
  45. #define ll_div(a, b)    ((a) / (b))
  46. #define ll_mul(a, b)    ((a) * (b))
  47. #define ll_neg(a)    (-(a))
  48. #define ll_not(a)    (~(a))
  49. #define ll_or(a, b)    ((a) | (b))
  50. /* THE FOLLOWING DEFINITION IS NOW A FUNCTION CALL IN ORDER TO WORKAROUND
  51.    OPTIMIZER BUG IN MSVC++ 2.1 (see system_md.c)
  52.    #define ll_shl(a, n)    ((a) << (n)) */
  53. #define ll_shr(a, n)    ((a) >> (n))
  54. #define ll_sub(a, b)    ((a) - (b))
  55. #define ll_ushr(a, n)    ((uint64_t)(a) >> (n))
  56. #define ll_xor(a, b)    ((a) ^ (b))
  57. #define uint2ll(a)    ((uint64_t)(unsigned long)(a))
  58. #define ll_rem(a,b)    ((a) % (b))
  59.  
  60. #define float2ll(f)    ((int64_t) (f))
  61. #define ll2float(a)    ((float) (a))
  62. #define ll2double(a)    ((double) (a))
  63. #define double2ll(f)    ((int64_t) (f))
  64.  
  65. /* comparison operators */
  66. #define ll_ltz(ll)    ((ll) < 0)
  67. #define ll_gez(ll)    ((ll) >= 0)
  68. #define ll_eqz(a)    ((a) == 0)
  69. #define ll_eq(a, b)    ((a) == (b))
  70. #define ll_ne(a,b)    ((a) != (b))
  71. #define ll_ge(a,b)    ((a) >= (b))
  72. #define ll_le(a,b)    ((a) <= (b))
  73. #define ll_lt(a,b)    ((a) < (b))
  74. #define ll_gt(a,b)    ((a) > (b))
  75.  
  76. #define ll_zero_const    ((int64_t) 0)
  77. #define ll_one_const    ((int64_t) 1)
  78.  
  79. extern void ll2str(int64_t a, char *s, char *limit);
  80. extern int64_t ll_shl(int64_t a, int bits);
  81.  
  82. #include <stdlib.h>    /* For malloc() and free() */
  83.  
  84. #endif /* !_WIN32_TYPEDEF_MD_H_ */
  85.