/* UTYPEDEFS : This file contains the macros and type definitions commonly
** used by all my programs and is designed to enhance portability.  The
** only machines I have actually compiled these under are my Compaq running
** OS/2 and MSDOS, my Amiga, and my AT&T Unix PC 7300.
*/

#ifdef MSDOS /* Microsoft C 5.1 */
  #ifndef M_I86LM
    #error Program must be compiled under large model
  #endif

  typedef unsigned char U8;
  typedef signed char S8;
  typedef unsigned short U16;
  typedef signed short S16;
  typedef unsigned long U32;
  typedef signed long S32;

  #define FAR far
  #define PRDEVICE	"/DEV/PRN"
  #define CONST const
  #define DUMMY 1
#endif

#ifdef AMIGA /* Lattice C 3.02 for Amiga */
  typedef UBYTE U8;
  typedef BYTE S8;
  typedef UWORD U16;
  typedef WORD S16;
  typedef unsigned int U32;
  typedef int S32;

  #define FAR
  #define PRDEVICE  "PRT:"
  #define CONST
  #define DUMMY 1
#endif

#ifndef DUMMY
  typedef unsigned char U8;
  typedef signed char S8;
  typedef unsigned short U16;
  typedef signed short S16;
  typedef unsigned long U32;
  typedef signed long S32;

  #define DUMMY 1
  #define CONST
#endif

#undef DUMMY

#ifdef MAIN_MODULE
  #define GLOBAL
  #define INIT(x) = x
#else
  #define GLOBAL extern
  #define INIT(x)
#endif

#ifdef unix
  #define FAR
  #define PRDEVICE  "/dev/lp"
#endif

#ifdef M_I86
  #define LOBYTE(w)  (*(U8*)(&(w)))
  #define HIBYTE(w)  (*(U8*)(&(w)+1))
  #define PUT16(c,w) *((U16*)(&(c)))=(w)  /* For machines which put */
  #define GET16(c,w) (w)=*((U16*)(&(c)))  /* low order byte first   */
#else
  #define LOBYTE(w)  (*(U8*)(&(w)+1))
  #define HIBYTE(w)  (*(U8*)(&(w)))
  #define PUT16(c,w) (c)=LOBYTE(w),*((char*)(&(c)+1))=HIBYTE(w)
  #define GET16(c,w) LOBYTE(w)=(c),HIBYTE(w)=*((char*)(&(c)+1))
#endif

#define UTYPEDEFS 1
