home *** CD-ROM | disk | FTP | other *** search
/ nisttime.carsoncity.k12.mi.us / nisttime.carsoncity.k12.mi.us.tar / nisttime.carsoncity.k12.mi.us / pub / acts / sizint.h < prev    next >
C/C++ Source or Header  |  1996-11-07  |  2KB  |  52 lines

  1. /*
  2.     include file sizint.h
  3.  
  4.     the DOS version of the program assumes that the 
  5.     declaration "int" implies a 16-bit quantity and 
  6.     that a "long int" is 32-bits long.  some work-station
  7.     environments use 32-bit quantities for both "int"
  8.     and "long int" with 16-bit quantities defined as
  9.     "short int". This should not be a problem in most
  10.     cases, since there is usually no harm is using a
  11.     32-bit integer when a 16-bit one would have been
  12.     sufficient.
  13.     The code may not work, however, if the machine uses
  14.     64 bits for a "long int" and 32-bits for an "int"
  15.     (e.g., DEC Alpha).  The long-int declarations will
  16.     then produce 64 bit quantities which will not be
  17.     correct in many cases (mostly when the quantity
  18.     is passed by reference to a system subroutine which
  19.     expects a parameter that is 32 bits long, but possibly
  20.     in other situations as well).
  21.     this problem is addressed using the pseudo type LONG,
  22.     which is defined below so as to produce a 32 bit quantity
  23.     in the target environment.  The pseudo type LONG is
  24.     defined as "long int" if a standard int would be 16 bits
  25.     and as "int" if an unqualified int is 32 bits and a long
  26.     int is 64 bits.
  27.  
  28.  
  29.     therefore --
  30.     if SUN is defined and if the machine uses 16 or 32 bits 
  31.     for an "int" and 32 bits for a "long int" then define
  32.     B64 as 0.
  33.     if SUN is defined and if the machine uses 64 bits for a 
  34.     "long int" then define B64 as 1.  The only common machine
  35.     currently in this category is a DEC Alpha-based system.
  36.     if IBMPC is defined then a long int is 32 bits in this 
  37.     environment and B64 is not needed.
  38.     (note that some compilers require that pre-processor 
  39.     directives of this type start in col 1.)
  40. */
  41. #define B64   1
  42. /*      #define B64   0 */
  43. #ifdef IBMPC
  44. #define LONG long int
  45. #else
  46. #if B64 == 1
  47. #define LONG int
  48. #else
  49. #define LONG long int
  50. #endif
  51. #endif     
  52.