home *** CD-ROM | disk | FTP | other *** search
/ PC Online 1999 February / PCO_0299.ISO / filesbbs / dos / indigo01.exe / DATATYP.H < prev    next >
Encoding:
C/C++ Source or Header  |  1997-08-21  |  1.4 KB  |  55 lines

  1. // datatyp.h
  2. // Defines data types that are independent of the compiler specific
  3. // char/short/int/long types.
  4.  
  5. #ifndef __DATATYP_H
  6. #define __DATATYP_H
  7. #include <limits.h>
  8.  
  9. #if (UCHAR_MAX == 255)
  10.     typedef unsigned char UINT8;
  11.     typedef signed char SINT8;
  12. #else
  13.     #error No 8-bit integer type found
  14. #endif
  15.  
  16. #if (UCHAR_MAX == 65535)
  17.     typedef unsigned char UINT16;
  18.     typedef signed char SINT16;
  19. #else
  20.     #if (USHRT_MAX == 65535)
  21.         typedef unsigned short UINT16;
  22.         typedef signed short SINT16;
  23.     #else
  24.         #if (UINT_MAX == 65535)
  25.             typedef unsigned int UINT16;
  26.             typedef signed int SINT16;
  27.         #else
  28.             #error No 16-bit integer type found
  29.         #endif
  30.     #endif
  31. #endif
  32.  
  33. #if (UCHAR_MAX == 4294967295)
  34.     typedef unsigned char UINT32;
  35.     typedef signed char SINT32;
  36. #else
  37.     #if (USHRT_MAX == 4294967295)
  38.         typedef unsigned short UINT32;
  39.         typedef signed short SINT32;
  40.     #else
  41.         #if (UINT_MAX == 4294967295)
  42.             typedef unsigned int UINT32;
  43.             typedef signed int SINT32;
  44.         #else
  45.             #if (ULONG_MAX == 4294967295)
  46.                 typedef unsigned long UINT32;
  47.                 typedef signed long SINT32;
  48.             #else
  49.                 #error No 32-bit integer type found
  50.             #endif
  51.         #endif
  52.     #endif
  53. #endif
  54. #endif
  55.