
/****************************************************************************/

/*  PNLC.H

    PANEL System portability header file.

    This module contains statements to select the compiler-dependent code for
    different C compilers.  The compiler, processor, and operating system 
    will have been specified by the defines in PNLI.H, which must always be
    included ahead of this file in any PANEL application source file.  

    To improve compilation speed you should edit this file to remove all the 
    'ifdef' blocks which you are sure will never be executed.  The full file
    is provided to assist users who have more than one operating environment. 

    Roundhill Computer Systems Limited warrants the information in this 
    file only to the extent that it appears to support the operation of
    PANEL programs in versions so far released.  The inclusion of compiler
    details here should not be taken to mean that a version of PANEL will
    either work or be made commercially available to support the compiler
    or operating environment.  Compiler and operating system names shown
    are generally trademarks of their authors or suppliers.

    Modification History:

        18.01.86      : Distribution Source PANEL 6.20
        26.10.85      : Distribution Source PANEL 6.01b
        31.03.85      : Distribution Source PANEL 6.00

*****************************************************************************/

#ifndef PNLC            /* prevent multiple inclusion */
#define PNLC 1

   /*********************************************************************/
   /* Section 1:  Find compiler and define the processing for unsigned  */
   /*             characters and integers, and the integer format       */
   /*********************************************************************/

#ifdef  LATTICE
        typedef char uchar;             /* NOTE: must use -cu LC V3 option */
        typedef unsigned int  uint;     /* must specify unsigned */
#define UCI(x) (x)              /* unsigned char -> int is not sign extended */
#endif
        
#ifdef  MSC3
        typedef unsigned char uchar;    /* must specify unsigned */
        typedef unsigned int  uint;     /* must specify unsigned */
#define UCI(x) (x)              /* unsigned char -> int is not sign extended */
#endif
        
#ifdef  CSYSTEMS
        typedef char uchar;     /* chars default to unsigned */
        typedef unsigned uint;  /* 'integer' unnecessary */
#define UCI(x) (x)              /* unsigned char -> int is not sign extended */
#endif
        
#ifdef  MARKWILLIAMS
        typedef unsigned char uchar;    /* must specify unsigned */
        typedef unsigned int  uint;     /* must specify unsigned */
#ifndef LARGE
#define UCI(x) (x)              /* unsigned char -> int is not sign extended */
#else
#define UCI(x) ((uint)x)        /* avoids code generation feature in MWC */
#endif                          /* large model for:  "if (UCI(x) > 132)" */
#endif
        
#ifdef  AZTEC
        typedef char uchar;             /* avoids errors/warnings */
        typedef unsigned int  uint;     /* must specify unsigned */
#define UCI(x) (x & 0xff)       /* signed char -> int is sign extended */
#endif
        
#ifdef  CIC86
        typedef unsigned char uchar;    /* must specify unsigned */
        typedef unsigned int  uint;     /* must specify unsigned */
#define UCI(x) (x)              /* unsigned char -> int is not sign extended */
#endif

#ifdef  DESMET
        typedef char uchar;     /* chars default to unsigned */
        typedef unsigned uint;  /* 'integer' unnecessary */
#define UCI(x) ((int)x)         /* char -> int not automatic in expressions */
#endif
        
#ifdef  DRC
        typedef char uchar;     /* chars default to unsigned */
        typedef unsigned int  uint;     /* must specify unsigned */
#define UCI(x) (x)              /* unsigned char -> int is not sign extended */
#endif

#ifdef  WIZARD 
        typedef unsigned char uchar;    /* must specify unsigned */
        typedef unsigned int  uint;     /* must specify unsigned */
#define UCI(x) (x)              /* unsigned char -> int is not sign extended */
#endif
        
#ifdef  XENIX
#define NIX 1                   /* UNIX-alike operating system */
#endif

#ifdef  UNIX
#define NIX 1                   /* UNIX-alike operating system */
#endif

#ifdef  WSL                     /* Whitesmiths Limited */
#define NIX 1
#endif

#ifdef  NIX
        typedef char uchar;
        typedef unsigned short uint;    /* must specify unsigned */
#define UCI(x) (x & 0xff)       /* char -> short is sign extended */
#endif

#ifdef  QNX
        typedef char uchar;
        typedef unsigned uint;
#define UCI(x) (x & 0xff)       /* char -> short is sign extended */
#endif


   /*********************************************************************/
   /* Section 2:  Find processor chip and define the processing for the */
   /*             two-byte values in external portable disk files. The  */
   /*             integers in .pnl files are two-byte, low byte first.  */
   /*********************************************************************/

#ifdef  I8080
#define SWAP(x) (x)         /* Most Sig. byte is at high address in word */
#endif

#ifdef  I8086
#define SWAP(x) (x)         /* Most Sig. byte is at high address in word */
#endif

#ifdef  PDP11
#define SWAP(x) (x)         /* Most Sig. byte is at high address in word */
#endif

#ifdef  VAX
#define SWAP(x) (x)         /* Most Sig. byte is at high address in word */
#endif

#ifdef  M68000
#define BYTESWAP 1          /* Most Sig. byte is at low address in word */
#define SWAP(x) (PASWAP(x)) /* so we need to change them round to match 8086 */
#endif

#ifdef  Z8000 
#define BYTESWAP 1          /* Most Sig. byte is at low address in word */
#define SWAP(x) (PASWAP(x)) /* so we need to change them round to match 8086 */
#endif

#ifdef  WE32002
#define BYTESWAP 1          /* Most Sig. byte is at low address in word */
#define SWAP(x) (PASWAP(x)) /* so we need to change them round to match 8086 */
#endif

   /*********************************************************************/
   /* Section 3:  Set various switches to control PANEL programs and    */
   /*             subroutines                                           */
   /*********************************************************************/

#ifdef  NIX             /* UNIX-alike operating system */
#define OSINIT 1        /* OS init required (eg special stty) */
#define OSTERM 1        /* OS term required (eg stty restore) */
#define DATETIME 1      /* OS has date and time available */
#define ENVIRON 1       /* Environment available */
#define NEWLINE 1       /* Uses single newline character, not CR,LF */
#endif

#ifdef  AMIGA
#define OSINIT 1        /* OS init required */
#define OSTERM 1        /* OS term required */
#define DATETIME 1      /* OS has date and time available */
#define NEWLINE 1       /* Uses single newline character, not CR,LF */
#endif  

#ifdef  WSL
#undef  ENVIRON         /* not available for WSL */  
#endif

#ifdef  IRMX86          /* Intel iRMX86 operating system */
#define NOKS 1          /* No keyboard status available */
#define FLUSH 1         /* Flush screen o/p buffer at intervals */
#define OSINIT 1        /* OS init required (input connection) */
#define OSTERM 1        /* OS term required (final buffer flush) */
#define DATETIME 1      /* OS has date and time available */
#define FLUSH 1         /* Output will be buffered and flushed at intervals */
#endif

#ifdef  MSDOS           /* MS-DOS or PC-DOS */
#define IBMBIOS 1       /* Provide option to use ROM bios calls */
#define DATETIME 1      /* OS has date and time available */
#define ENVIRON 1       /* Environment available */
#endif

#ifdef  QNX
#define OSINIT 1
#define OSTERM 1
#define DATETIME 1
#define EXTFUNC  extern
#define NEWLINE 1       /* Uses single newline character, not CR,LF */
#endif

#ifndef WSL
#ifndef QNX
#define EXTFUNC /* */   /* function declarations dont need extern */
#endif  
#endif

#endif                  /* end of ifndef PNLC */
