/* @(#) $Id: //bas/46D/src/include/saptype.h#7 $ SAP*/
/**********************************************************************/
/**********************************************************************/
/*                                                                    */
/*  (C) Copyright (c) 2004 SAP AG Walldorf  1996 - 1997                       */
/*                                                                    */
/*                                                                    */
/*  saptype.h                                                         */
/*                                                                    */
/*  saptype.h (explanation of the file name)                          */
/*  =========                                                         */
/*                                                                    */
/*                                                                    */
/*  Author:   Uli Schoenbeck (d022181)                                */
/*  Reviewer:                                                         */
/*                                                                    */
/*  Description: Include file with definition of the current platform */
/*                                                                    */
/*  Created:                                                          */
/*    12.08.1996                                                      */
/*                                                                    */
/*  Modified: 22.08.1996 Ralf Hackmann                                */
/*  Remarks:  adapted to AS/400                                       */
/*                                                                    */
/*  Modified:                                                         */
/*  Remarks:                                                          */
/*                                                                    */
/**********************************************************************/

#ifdef __cplusplus
extern "C" {
#endif

/*
 * at the moment dummy for 46*
 */
#define BEGIN_externC
#define END_externC

#ifndef SAPTYPE_H

  #define SAPTYPE_H

  /* NI has a maximum of 2048 Handles and needs at least masks of    */
  /* this size                                                       */
  /* AIX is broken...                                                */
  #if ! defined (SAPonRS6000)
    #ifdef FD_SETSIZE
      #if FD_SETSIZE < 2048
        #undef FD_SETSIZE
        #define FD_SETSIZE 2048
      #endif
    #else
      #define FD_SETSIZE 2048
    #endif
  #endif

  #if defined (SAPonALPHA)

    /* ################################################################## */
    /* START: old 'typealphaosf.h'-file */
    /* ################################################################## */



    #define SAPTYPE_HF cU("DEC Alpha with OSF/1")


    /**********************************************************************/
    /*  switches for conditional compiling                                */
    /**********************************************************************/


    #define SAPonUNIX    1
    #define SAPonSYS5    1
    #define SAPonSYS5_2  1
    #define SAPonOSF1    1

    #define SAPwithX     1
    #define SAPwithSHM   1


    /**********************************************************************/
    /*  Modifiers for exported Windows DLL functions                      */
    /**********************************************************************/
    #ifndef SAP_MODIFIERS
      #define SAP_MODIFIERS
      #define SAP_FAR
      #define SAP_PASCAL
      #define SAP_EXPORT
      #define SAP_LOADDS
      #define API_DF
      #define API_DF_C
    #endif /* SAP_MODIFIERS */

    /**********************************************************************/
    /*  classification of int, float and char representation              */
    /*  - correct classification is checked in abcglob.c                  */
    /*  - values: SAPwithINT_BIGENDIAN/LITTLEENDIAN                       */
    /*            SAPwithFLOAT_IEEE/370                                   */
    /*            SAPwithCHAR_ASCII/EBCDIC                                */
    /**********************************************************************/
    #define SAPwithINT_LITTLEENDIAN  1
    #define SAPwithFLOAT_IEEE        1
    #define SAPwithCHAR_ASCII        1

    /**********************************************************************/
    /* always 64-bit compilation                                          */
    /**********************************************************************/
    #ifndef SAPwith64_BIT
      #ifndef SAPwith64_BIT
        #define SAPwith64_BIT
      #endif
    #endif

    /**********************************************************************/
    /*                                                                    */
    /*  Platform identification                                           */
    /*                                                                    */
    /*  SAP_SYSTEMID can be used to uniquely identify the platform, where */
    /*  SAP is running.                                                   */
    /*                                                                    */
    /*  Conventions:                                                      */
    /*    see saptypeb.h                                                  */
    /*                                                                    */
    /**********************************************************************/
    #define SAP_SYSTEMID 0x120


  #elif defined (SAPonATT)

    /* ################################################################## */
    /* START: old 'typeatt.h'-file */
    /* ################################################################## */



    #define SAPTYPE_HF cU("ATT on Intel Pentium with Unix SYSV 5.4.x")


    /**********************************************************************/
    /*  switches for conditional compiling                                */
    /**********************************************************************/

    #define SAPonUNIX    1

    #define SAPonSYS5    1
    #define SAPonSYS5_4  1

    #define SAPwithX     1
    #define SAPwithSHM   1


    /**********************************************************************/
    /*  Modifiers for exported Windows DLL functions                      */
    /**********************************************************************/
    #ifndef SAP_MODIFIERS
      #define SAP_MODIFIERS
      #define SAP_FAR
      #define SAP_PASCAL
      #define SAP_EXPORT
      #define SAP_LOADDS
      #define API_DF
      #define API_DF_C
    #endif /* SAP_MODIFIERS */


    /**********************************************************************/
    /*  classification of int, float and char representation              */
    /*  - correct classification is checked in abcglob.c                  */
    /*  - values: SAPwithINT_BIGENDIAN/LITTLEENDIAN                       */
    /*            SAPwithFLOAT_IEEE/370                                   */
    /*            SAPwithCHAR_ASCII/EBCDIC                                */
    /**********************************************************************/
    #define SAPwithINT_LITTLEENDIAN  1
    #define SAPwithFLOAT_IEEE     1
    #define SAPwithCHAR_ASCII     1


    /**********************************************************************/
    /*                                                                    */
    /*  Platform identification                                           */
    /*                                                                    */
    /*  SAP_SYSTEMID can be used to uniquely identify the platform, where */
    /*  SAP is running.                                                   */
    /*                                                                    */
    /*  Conventions:                                                      */
    /*    see saptypeb.h                                                  */
    /*                                                                    */
    /**********************************************************************/
    #define SAP_SYSTEMID  0x1



  #elif defined (SAPonBS2P)

    /* ################################################################## */
    /* START: old 'typebs2p.h'-file */
    /* ################################################################## */



    #define SAPTYPE_HF cU("BS2000 (370/390) with POSIX V1.0 in System V mode")

    /* we use the typerm600.h as basis of typebs2p.h */
    /**********************************************************************/
    /*  switches for conditional compiling                                */
    /**********************************************************************/


    #define SAPonUNIX    1
    #define SAPonSYS5    1
    #define SAPonSYS5_2  1
    #define SAPonSYS5_4  1

    #define SAPonSINIX   1
    #define SAPonSINIX5_42   1

    /* #define SAPwithX     1 */
    #define SAPwithSHM   1


    /**********************************************************************/
    /*  Modifiers for exported Windows DLL functions                      */
    /**********************************************************************/
    #ifndef SAP_MODIFIERS
      #define SAP_MODIFIERS
      #define SAP_FAR
      #define SAP_PASCAL
      #define SAP_EXPORT
      #define SAP_LOADDS
      #define API_DF
      #define API_DF_C
    #endif /* SAP_MODIFIERS */


    /**********************************************************************/
    /*  classification of int, float and char representation              */
    /*  - correct classification is checked in abcglob.c                  */
    /*  - values: SAPwithINT_BIGENDIAN/LITTLEENDIAN                       */
    /*            SAPwithFLOAT_IEEE/370                                   */
    /*            SAPwithCHAR_ASCII/EBCDIC                                */
    /**********************************************************************/
    #define SAPwithINT_BIGENDIAN  1
    #define SAPwithFLOAT_370      1
    #define SAPwithCHAR_EBCDIC    1


    /**********************************************************************/
    /*                                                                    */
    /*  Platform identification                                           */
    /*                                                                    */
    /*  SAP_SYSTEMID can be used to uniquely identify the platform, where */
    /*  SAP is running.                                                   */
    /*                                                                    */
    /*  Conventions:                                                      */
    /*    see saptypeb.h                                                  */
    /*                                                                    */
    /**********************************************************************/
    #define SAP_SYSTEMID  0x1300




  #elif defined (SAPonDGUX)

    /* ################################################################## */
    /* START: old 'typedg.h'-file */
    /* ################################################################## */



    #define SAPTYPE_HF cU("Data General on M88K RISC CPU with SYSV 5.4 rel 3.10")


    /**********************************************************************/
    /*  switches for conditional compiling                                */
    /**********************************************************************/

    #define SAPonUNIX   1
    #define DGUX	    1

    #define SAPonSYS5   1
    #define SAPonSYS5_4 1

    #define SAPwithX    1
    #define SAPwithSHM  1


    /**********************************************************************/
    /*  Modifiers for exported Windows DLL functions                      */
    /**********************************************************************/
    #ifndef SAP_MODIFIERS
      #define SAP_MODIFIERS
      #define SAP_FAR
      #define SAP_PASCAL
      #define SAP_EXPORT
      #define SAP_LOADDS
      #define API_DF
      #define API_DF_C
    #endif /* SAP_MODIFIERS */


    /**********************************************************************/
    /*  classification of int, float and char representation              */
    /*  - correct classification is checked in abcglob.c                  */
    /*  - values: SAPwithINT_BIGENDIAN/LITTLEENDIAN                       */
    /*            SAPwithFLOAT_IEEE/370                                   */
    /*            SAPwithCHAR_ASCII/EBCDIC                                */
    /**********************************************************************/
    #define SAPwithINT_BIGENDIAN  1
    #define SAPwithFLOAT_IEEE     1
    #define SAPwithCHAR_ASCII     1


    /**********************************************************************/
    /*                                                                    */
    /*  Platform identification                                           */
    /*                                                                    */
    /*  SAP_SYSTEMID can be used to uniquely identify the platform, where */
    /*  SAP is running.                                                   */
    /*                                                                    */
    /*  Conventions:                                                      */
    /*    see saptypeb.h                                                  */
    /*                                                                    */
    /**********************************************************************/
    #define SAP_SYSTEMID  0x181




  #elif defined (SAPonHPPA)

    /* ################################################################## */
    /* START: old 'typehp.h'-file */
    /* ################################################################## */

    #define SAPTYPE_HF cU("HP/9000 (PA-RISC) with HP-UX")


    /**********************************************************************/
    /*  switches for conditional compiling                                */
    /**********************************************************************/

    #define SAPonHP9000_825  1
    #define SAPonHP9000_8xx  1

    #define SAPonUNIX        1
    #define SAPonSYS5        1
    #define SAPonSYS5_2      1
    #define SAPonHP_UX       1

    #define SAPwithX         1
    #define SAPwithSHM       1


    /**********************************************************************/
    /*  Modifiers for exported Windows DLL functions                      */
    /**********************************************************************/
    #ifndef SAP_MODIFIERS
      #define SAP_MODIFIERS
      #define SAP_FAR
      #define SAP_PASCAL
      #define SAP_EXPORT
      #define SAP_LOADDS
      #define API_DF
      #define API_DF_C
    #endif /* SAP_MODIFIERS */


    /**********************************************************************/
    /*  classification of int, float and char representation              */
    /*  - correct classification is checked in abcglob.c                  */
    /*  - values: SAPwithINT_BIGENDIAN/LITTLEENDIAN                       */
    /*            SAPwithFLOAT_IEEE/370                                   */
    /*            SAPwithCHAR_ASCII/EBCDIC                                */
    /**********************************************************************/
    #define SAPwithINT_BIGENDIAN  1
    #define SAPwithFLOAT_IEEE     1
    #define SAPwithCHAR_ASCII     1


    /**********************************************************************/
    /* detect 64/32-bit compilation model and set according flags         */
    /* see hp cc manpage, +DD64 option, LP64 data model                   */
    /**********************************************************************/
    #if defined(__LP64__)
      #ifndef SAPwith64_BIT
        #define SAPwith64_BIT
      #endif
    #endif

    /**********************************************************************/
    /* set compile flag for oracle 64-bit/oci headers                     */
    /**********************************************************************/
    #ifdef SAPwith64_BIT
      #define SS_64BIT_SERVER 1
      #define HPPA64 1
    #endif

    /**********************************************************************/
    /*                                                                    */
    /*  Platform identification                                           */
    /*                                                                    */
    /*  SAP_SYSTEMID can be used to uniquely identify the platform, where */
    /*  SAP is running.                                                   */
    /*                                                                    */
    /*  Conventions:                                                      */
    /*    see saptypeb.h                                                  */
    /*                                                                    */
    /**********************************************************************/
    #ifdef SAPwith64_BIT
      #define SAP_SYSTEMID  0x111
    #else
      #define SAP_SYSTEMID  0x110
    #endif




  #elif defined (SAPonM88K)

    /* ################################################################## */
    /* START: old 'typem88k.h'-file */
    /* ################################################################## */



    #define SAPTYPE_HF cU("Motorola on M88K risc cpu with SYSV 5.4 rel 4")


    /**********************************************************************/
    /*  switches for conditional compiling                                */
    /**********************************************************************/


    #define SAPonUNIX   1
    #define SAPonSYS5   1
    #define SAPonSYS5_4 1

    #define SAPwithX    1
    #define SAPwithSHM  1


    /**********************************************************************/
    /*  Modifiers for exported Windows DLL functions                      */
    /**********************************************************************/
    #ifndef SAP_MODIFIERS
      #define SAP_MODIFIERS
      #define SAP_FAR
      #define SAP_PASCAL
      #define SAP_EXPORT
      #define SAP_LOADDS
      #define API_DF
      #define API_DF_C
    #endif /* SAP_MODIFIERS */


    /**********************************************************************/
    /*  classification of int, float and char representation              */
    /*  - correct classification is checked in abcglob.c                  */
    /*  - values: SAPwithINT_BIGENDIAN/LITTLEENDIAN                       */
    /*            SAPwithFLOAT_IEEE/370                                   */
    /*            SAPwithCHAR_ASCII/EBCDIC                                */
    /**********************************************************************/
    #define SAPwithINT_BIGENDIAN  1
    #define SAPwithFLOAT_IEEE     1
    #define SAPwithCHAR_ASCII     1


    /**********************************************************************/
    /*                                                                    */
    /*  Platform identification                                           */
    /*                                                                    */
    /*  SAP_SYSTEMID can be used to uniquely identify the platform, where */
    /*  SAP is running.                                                   */
    /*                                                                    */
    /*  Conventions:                                                      */
    /*    see saptypeb.h                                                  */
    /*                                                                    */
    /**********************************************************************/
    #define SAP_SYSTEMID 0x171




  #elif defined (SAPonApple)

    /* ################################################################## */
    /* START: old 'typemac.h'-file */
    /* ################################################################## */



    #define SAPTYPE_HF cU("Apple Macintosh with Mac OS 7.x")


    /**********************************************************************/
    /*  switches for conditional compiling                                */
    /**********************************************************************/



    /**********************************************************************/
    /*  Modifiers for exported Windows DLL functions                      */
    /**********************************************************************/
    #ifndef SAP_MODIFIERS
      #define SAP_MODIFIERS
      #define SAP_FAR
      #define SAP_PASCAL
      #define SAP_EXPORT
      #define SAP_LOADDS
      #define API_DF
      #define API_DF_C
    #endif /* SAP_MODIFIERS */


    /**********************************************************************/
    /*  classification of int, float and char representation              */
    /*  - correct classification is checked in abcglob.c                  */
    /*  - values: SAPwithINT_BIGENDIAN/LITTLEENDIAN                       */
    /*            SAPwithFLOAT_IEEE/370                                   */
    /*            SAPwithCHAR_ASCII/EBCDIC                                */
    /**********************************************************************/
    #define SAPwithINT_BIGENDIAN  1
    #define SAPwithFLOAT_IEEE     1
    #define SAPwithCHAR_ASCII     1


    /**********************************************************************/
    /*                                                                    */
    /*  Platform identification                                           */
    /*                                                                    */
    /*  SAP_SYSTEMID can be used to uniquely identify the platform, where */
    /*  SAP is running.                                                   */
    /*                                                                    */
    /*  Conventions:                                                      */
    /*    see saptypeb.h                                                  */
    /*                                                                    */
    /**********************************************************************/
    #define SAP_SYSTEMID  0x110




  #elif defined (SAPonNCR)

    /* ################################################################## */
    /* START: old 'typencr.h'-file */
    /* ################################################################## */



    #define SAPTYPE_HF cU("NCR on Intel Pentium with Unix SYSV 5.4.x")


    /**********************************************************************/
    /*  switches for conditional compiling                                */
    /**********************************************************************/

    #define SAPonUNIX    1

    #define SAPonSYS5    1
    #define SAPonSYS5_4  1

    #define SAPwithX     1
    #define SAPwithSHM   1


    /**********************************************************************/
    /*  Modifiers for exported Windows DLL functions                      */
    /**********************************************************************/
    #ifndef SAP_MODIFIERS
      #define SAP_MODIFIERS
      #define SAP_FAR
      #define SAP_PASCAL
      #define SAP_EXPORT
      #define SAP_LOADDS
      #define API_DF
      #define API_DF_C
    #endif /* SAP_MODIFIERS */


    /**********************************************************************/
    /*  classification of int, float and char representation              */
    /*  - correct classification is checked in abcglob.c                  */
    /*  - values: SAPwithINT_BIGENDIAN/LITTLEENDIAN                       */
    /*            SAPwithFLOAT_IEEE/370                                   */
    /*            SAPwithCHAR_ASCII/EBCDIC                                */
    /**********************************************************************/
    #define SAPwithINT_LITTLEENDIAN  1
    #define SAPwithFLOAT_IEEE     1
    #define SAPwithCHAR_ASCII     1


    /**********************************************************************/
    /*                                                                    */
    /*  Platform identification                                           */
    /*                                                                    */
    /*  SAP_SYSTEMID can be used to uniquely identify the platform, where */
    /*  SAP is running.                                                   */
    /*                                                                    */
    /*  Conventions:                                                      */
    /*    see saptypeb.h                                                  */
    /*                                                                    */
    /**********************************************************************/
    #define SAP_SYSTEMID  0x1




  #elif defined (SAPonNT)

    /* ################################################################## */
    /* START: old 'typent.h'-file */
    /* ################################################################## */

    #define SAPTYPE_HF cU("PC with Windows NT")


    /**********************************************************************/
    /*  switches for conditional compiling                                */
    /**********************************************************************/

    /* #pragma warning */
    #ifdef PRAGMA_WARNING
    #include "pw_value.h" /* nocheck */
    #endif

    /**********************************************************************/
    /*  Modifiers for exported Windows DLL functions                      */
    /**********************************************************************/
    #ifndef SAP_MODIFIERS
    #define SAP_MODIFIERS
    #define SAP_FAR
    #define SAP_PASCAL
    #define SAP_EXPORT
    #define SAP_LOADDS

    #if defined(_OS2DAPIE_)
     #define SAP_STDCALL
    #else
     #define SAP_STDCALL _stdcall
    #endif

    #define _SYSTEM
    #define SAP_API SAP_FAR SAP_LOADDS SAP_PASCAL SAP_STDCALL
    #define API_DF
    #define API_DF_C
    #endif /* SAP_MODIFIERS */


    /**********************************************************************/
    /*  classification of int, float and char representation              */
    /*  - correct classification is checked in abcglob.c                  */
    /*  - values: SAPwithINT_BIGENDIAN/LITTLEENDIAN                       */
    /*            SAPwithFLOAT_IEEE/370                                   */
    /*            SAPwithCHAR_ASCII/EBCDIC                                */
    /**********************************************************************/
    #define SAPwithINT_LITTLEENDIAN  1
    #define SAPwithFLOAT_IEEE     1
    #define SAPwithCHAR_ASCII     1

    #ifndef ECONNREFUSED
      #define ECONNREFUSED WSAECONNREFUSED
    #endif

    #ifndef ECONNRESET
      #define ECONNRESET WSAECONNRESET
    #endif

    /* portable 16 bit / 32 bit source code ..............................*/
    #define _export
    #define __export  _export
    #define _huge
    #define _near


    /**********************************************************************/
    /*                                                                    */
    /*  some UNIX C-rtl routines are not available on Windows NT and      */
    /*  were ported by SAP.                                               */
    /*                                                                    */
    /*  To avoid changes to all source code files and related makefiles   */
    /*  we decided to define prototypes for these functions here          */
    /*                                                                    */
    /*  The programmer may also include the file with the original        */
    /*  prototypes (e.g., in ntport.h and ntutil.h)                       */
    /*                                                                    */
    /**********************************************************************/

    #ifndef sleep
    int sleep (int sec);
    #endif

    #ifndef TcpipInit
    int TcpipInit (void);
    #endif

    #ifndef getopt
            int getopt(int argc, char *argv[], const char *optstring);
    #endif


    /**********************************************************************/
    /*                                                                    */
    /*  Platform identification                                           */
    /*                                                                    */
    /*  SAP_SYSTEMID can be used to uniquely identify the platform, where */
    /*  SAP is running.                                                   */
    /*                                                                    */
    /*  Conventions:                                                      */
    /*    see saptypeb.h                                                  */
    /*                                                                    */
    /**********************************************************************/
    #ifdef WIN64
      #define SAP_SYSTEMID 0x231
      #ifndef SAPwith64_BIT
        #define SAPwith64_BIT
      #endif
    #else
      #define SAP_SYSTEMID 0x230
    #endif

    /**********************************************************************/
    /* SAPwithTHREADS: Supports threads                                   */
    /**********************************************************************/
    #define SAPwithTHREADS 1



  #elif defined (SAPonOS2_2x)

    /* ################################################################## */
    /* START: old 'typeos2.h'-file */
    /* ################################################################## */



    #define SAPTYPE_HF cU("PC with OS/2 (32 bit)")


    /**********************************************************************/
    /*  switches for conditional compiling                                */
    /**********************************************************************/


    /* casting when passing a 32 bit pointer to a 16 bit API */
    #define SAP16PTR  _Seg16
    #pragma stack16 (4096)


    /**********************************************************************/
    /*  Modifiers for exported Windows DLL functions                      */
    /**********************************************************************/
    #ifndef SAP_MODIFIERS
      #define SAP_MODIFIERS
      #define SAP_FAR
      #define SAP_PASCAL
      #define SAP_EXPORT
      #define SAP_LOADDS
      #define API_DF
      #define API_DF_C
    #endif /* SAP_MODIFIERS */


    /**********************************************************************/
    /*  classification of int, float and char representation              */
    /*  - correct classification is checked in abcglob.c                  */
    /*  - values: SAPwithINT_BIGENDIAN/LITTLEENDIAN                       */
    /*            SAPwithFLOAT_IEEE/370                                   */
    /*            SAPwithCHAR_ASCII/EBCDIC                                */
    /**********************************************************************/
    #define SAPwithINT_LITTLEENDIAN  1
    #define SAPwithFLOAT_IEEE        1
    #define SAPwithCHAR_ASCII        1


    /**********************************************************************/
    /*                                                                    */
    /*  Platform identification                                           */
    /*                                                                    */
    /*  SAP_SYSTEMID can be used to uniquely identify the platform, where */
    /*  SAP is running.                                                   */
    /*                                                                    */
    /*  Conventions:                                                      */
    /*    see saptypeb.h                                                  */
    /*                                                                    */
    /**********************************************************************/
    #define SAP_SYSTEMID 0x220



  #elif defined (SAPonOS400)

    /* ################################################################## */
    /* AS/400 part                                                        */
    /* ################################################################## */


    #define SAPTYPE_HF cU("IBM AS/400 with OS/400")


    /**********************************************************************/
    /*  switches for conditional compiling                                */
    /**********************************************************************/

    #define SAPwithSHM 1
    #define SAPwithTHREADS  1
    #define _MULTI_THREADED 1

    #ifdef _POSIX_SOURCE
    #undef _POSIX_SOURCE
    #include <pthread.h>
    #define _POSIX_SOURCE 1
	  #else
    #include <pthread.h>
    #endif

    /**********************************************************************/
    /*  Modifiers for exported Windows DLL functions                      */
    /**********************************************************************/
    #ifndef SAP_MODIFIERS
      #define SAP_MODIFIERS
      #define SAP_FAR
      #define SAP_PASCAL
      #define SAP_EXPORT
      #define SAP_LOADDS
      #define API_DF
      #define API_DF_C
    #endif /* SAP_MODIFIERS */

    /**********************************************************************/
    /*  classification of int, float and char representation              */
    /*  - correct classification is checked in abcglob.c                  */
    /*  - values: SAPwithINT_BIGENDIAN/LITTLEENDIAN                       */
    /*            SAPwithFLOAT_IEEE/370                                   */
    /*            SAPwithCHAR_ASCII/EBCDIC                                */
    /**********************************************************************/
    #define SAPwithINT_BIGENDIAN  1
    #define SAPwithFLOAT_IEEE     1

    /**********************************************************************/
    /* detect 64/32-bit compilation switch and set flags                  */
    /**********************************************************************/
    #if defined(_LONG_LONG)
      #ifndef SAPwith64_BIT
        #define SAPwith64_BIT
      #endif
    #endif

    /**********************************************************************/
    /*                                                                    */
    /*  Platform identification                                           */
    /*                                                                    */
    /*  SAP_SYSTEMID can be used to uniquely identify the platform, where */
    /*  SAP is running.                                                   */
    /*                                                                    */
    /*  Conventions:                                                      */
    /*    see saptypeb.h                                                  */
    /*                                                                    */
    /**********************************************************************/
    #ifdef SAPwithCHAR_EBCDIC
    #define SAP_SYSTEMID 0x241          /* increased for wcharisucs2 - AF */
    #else
    #define SAP_SYSTEMID 0x250
    #endif

    #define AS4_BYTE_ALIGN(p, type) \
    p = (type)((unsigned char*)p + ( ((unsigned long)p % 16) ? \
        (16 - ((unsigned long)p % 16)) : 0 ))



  #elif defined (SAPonPTX)

    /* ################################################################## */
    /* START: old 'typeptx.h'-file */
    /* ################################################################## */



    #define SAPTYPE_HF cU("Sequent on INTEL CPU with Dynix/ptx 4.0")
    #define SAPTYPE_HV "4.0"


    /**********************************************************************/
    /*  switches for conditional compiling                                */
    /**********************************************************************/

    #define SAPonUNIX    1

    #define SAPonSYS5    1
    #define SAPonSYS5_4  1

    #define SAPwithX     1
    #define SAPwithSHM   1


    /**********************************************************************/
    /*  Modifiers for exported Windows DLL functions                      */
    /**********************************************************************/
    #ifndef SAP_MODIFIERS
      #define SAP_MODIFIERS
      #define SAP_FAR
      #define SAP_PASCAL
      #define SAP_EXPORT
      #define SAP_LOADDS
      #define API_DF
      #define API_DF_C
    #endif /* SAP_MODIFIERS */


    /**********************************************************************/
    /*  classification of int, float and char representation              */
    /*  - correct classification is checked in abcglob.c                  */
    /*  - values: SAPwithINT_BIGENDIAN/LITTLEENDIAN                       */
    /*            SAPwithFLOAT_IEEE/370                                   */
    /*            SAPwithCHAR_ASCII/EBCDIC                                */
    /**********************************************************************/
    #define SAPwithINT_LITTLEENDIAN  1
    #define SAPwithFLOAT_IEEE        1
    #define SAPwithCHAR_ASCII        1


    /**********************************************************************/
    /*                                                                    */
    /*  Platform identification                                           */
    /*                                                                    */
    /*  SAP_SYSTEMID can be used to uniquely identify the platform, where */
    /*  SAP is running.                                                   */
    /*                                                                    */
    /*  Conventions:                                                      */
    /*    see saptypeb.h                                                  */
    /*                                                                    */
    /**********************************************************************/
    #define SAP_SYSTEMID  0x191




  #elif defined (SAPonRM600)

    /* ################################################################## */
    /* START: old 'typerm600.h'-file */
    /* ################################################################## */



    #define SAPTYPE_HF cU("RM600 (MIPS) with SINIX V5.4 in System V mode")


    /**********************************************************************/
    /*  switches for conditional compiling                                */
    /**********************************************************************/


    #define SAPonUNIX    1
    #define SAPonSYS5    1
    #define SAPonSYS5_2  1
    #define SAPonSYS5_4  1

    #define SAPonSINIX   1
    #define SAPonSINIX5_42   1

    #define SAPwithX     1
    #define SAPwithSHM   1

    #define _XPG_IV

    #ifdef _XOPEN_SOURCE_EXTENDED
        #define _XOPEN_SOURCE 1
    #endif

    #ifdef _XOPEN_SOURCE
        typedef unsigned char uchar;
        typedef unsigned char unchar;
        typedef unsigned short ushort;
        typedef unsigned int uint;
        typedef unsigned long ulong;
        typedef unsigned char u_char;
        typedef unsigned short u_short;
        typedef unsigned int u_int;
        typedef unsigned long u_long;
        typedef signed char s_char;

    /* sys/time.h */
    /* this is BSD stuff, so one should better #undef _XOPEN_SOURCE to get it !! */

    #ifndef _SYS_TIME_H
    #ifndef _SYS_TIMEZONE_RM600
    #define _SYS_TIMEZONE_RM600
    struct timezone {
          int     tz_minuteswest;
          int     tz_dsttime;
    };
    #endif
    #endif
    #endif /* _XOPEN_SOURCE */


    /**********************************************************************/
    /*  Modifiers for exported Windows DLL functions                      */
    /**********************************************************************/
    #ifndef SAP_MODIFIERS
      #define SAP_MODIFIERS
      #define SAP_FAR
      #define SAP_PASCAL
      #define SAP_EXPORT
      #define SAP_LOADDS
      #define API_DF
      #define API_DF_C
    #endif /* SAP_MODIFIERS */


    /**********************************************************************/
    /*  classification of int, float and char representation              */
    /*  - correct classification is checked in abcglob.c                  */
    /*  - values: SAPwithINT_BIGENDIAN/LITTLEENDIAN                       */
    /*            SAPwithFLOAT_IEEE/370                                   */
    /*            SAPwithCHAR_ASCII/EBCDIC                                */
    /**********************************************************************/
    #define SAPwithINT_BIGENDIAN  1
    #define SAPwithFLOAT_IEEE     1
    #define SAPwithCHAR_ASCII     1


    /**********************************************************************/
    /* detect 64/32-bit compilation model and set according flags         */
    /* see rm600 cc manpage, -K lp64 option, LP64 data model              */
    /**********************************************************************/
    #if defined(__LP64__)
      #ifndef SAPwith64_BIT
        #define SAPwith64_BIT
      #endif
      #define SAPonRM600_64BIT
    #endif

    /**********************************************************************/
    /* set compile flag for oracle 64-bit/oci headers                     */
    /**********************************************************************/
    #ifdef SAPwith64_BIT
      #define SS_64BIT_SERVER 1
    #endif

    /**********************************************************************/
    /*                                                                    */
    /*  Platform identification                                           */
    /*                                                                    */
    /*  SAP_SYSTEMID can be used to uniquely identify the platform, where */
    /*  SAP is running.                                                   */
    /*                                                                    */
    /*  Conventions:                                                      */
    /*    see saptypeb.h                                                  */
    /*                                                                    */
    /**********************************************************************/
    #ifdef SAPwith64_BIT
      #define SAP_SYSTEMID  0x143
    #else
      #define SAP_SYSTEMID  0x142
    #endif

    /**********************************************************************/
    /*  Modification for Blended Codepage on Reliant                      */
    /**********************************************************************/
    #undef isprint
    #undef isdigit
    #undef isalpha
    #undef iscntrl
    #undef isgraph
    #undef toupper
    #undef tolower
    #undef isalnum
    #undef isspace
    #undef ispunct
    #undef isascii



  #elif defined (SAPonRS6000)

    /* ################################################################## */
    /* START: old 'typers6000.h'-file */
    /* ################################################################## */



    #define SAPTYPE_HF cU("IBM RS/6000 with AIX")


    /**********************************************************************/
    /*  switches for conditional compiling                                */
    /**********************************************************************/


    #define SAPonUNIX   1
    #define SAPonSYS5   1
    #define SAPonSYS5_2 1
    #define SAPonAIX    1

    #define SAPwithX    1
    #define SAPwithSHM  1


    /**********************************************************************/
    /*  Modifiers for exported Windows DLL functions                      */
    /**********************************************************************/
    #ifndef SAP_MODIFIERS
      #define SAP_MODIFIERS
      #define SAP_FAR
      #define SAP_PASCAL
      #define SAP_EXPORT
      #define SAP_LOADDS
      #define API_DF
      #define API_DF_C
    #endif /* SAP_MODIFIERS */

    /**********************************************************************/
    /*  classification of int, float and char representation              */
    /*  - correct classification is checked in abcglob.c                  */
    /*  - values: SAPwithINT_BIGENDIAN/LITTLEENDIAN                       */
    /*            SAPwithFLOAT_IEEE/370                                   */
    /*            SAPwithCHAR_ASCII/EBCDIC                                */
    /**********************************************************************/
    #define SAPwithINT_BIGENDIAN  1
    #define SAPwithFLOAT_IEEE     1
    #define SAPwithCHAR_ASCII     1


    /**********************************************************************/
    /* detect 64/32-bit compilation model and set according flags         */
    /**********************************************************************/
    #if defined(__64BIT__)
      #ifndef SAPwith64_BIT
        #define SAPwith64_BIT
      #endif
    #endif

    /**********************************************************************/
    /* set compile flag for oracle 64-bit/oci headers                     */
    /**********************************************************************/
    #ifdef SAPwith64_BIT
      #define AIXRIOS64 1
    #endif

    /**********************************************************************/
    /*                                                                    */
    /*  Platform identification                                           */
    /*                                                                    */
    /*  SAP_SYSTEMID can be used to uniquely identify the platform, where */
    /*  SAP is running.                                                   */
    /*                                                                    */
    /*  Conventions:                                                      */
    /*    see saptypeb.h                                                  */
    /*                                                                    */
    /**********************************************************************/
    #ifdef SAPwith64_BIT
      #define SAP_SYSTEMID 0x144
    #else
      #define SAP_SYSTEMID 0x140
    #endif




  #elif (defined (SAPonMVSOE) || defined (SAPonOS390))

    /* ################################################################## */
    /* START: old 'type390.h'-file                                        */
    /* ################################################################## */

    /**********************************************************************/
    /*  switches for conditional compiling                                */
    /**********************************************************************/

    #define SAPTYPE_HF cU("IBM S/390 with OS/390 OpenEdition")
    #define SAPTYPE_HV "OS390R3"

    /**********************************************************************/
    /*  switches for conditional compiling                                */
    /**********************************************************************/

    /* this was : #define SAPonRS6000 1                  */
    /* files to be changed are: pfclock.c and sapparam.c */
    #define SAPonS390 1

    /* used in many files: */
    #define SAPonUNIX   1

    /* MVS/OE is System V */
    #define SAPonSYS5   1

    /* MVS/OE is System V_2 ???? */
    /* sapcscsa.c:  */
    /*  one of the following must be set: SYS5_2, withSHM, OS2, MPE, VMS, MVS */
    /*  but: SAPonSYS5_2 and SAPwithSHM do the same thing! */
    /* saplock.c: */
    /*  determines how semaphores are implemented */
    /* sapparam.c: */
    /*  set string constant "saponsys5_2 */
    /* sapscsa.c: */
    /*  how to implement shared memory */
    /* */
    /* we need SYSTEM5_4 signal handling and waitpid() definition */
    /* so we try defining the constant */
    #define SAPonSYS5_4 1
    /* #define SAPonSYS5_2 1 */

    /* SAPonAIX is used in many files, so leave it for the moment... */
    /* all occurrences must be checked! */
    /* (HD:) removed : #define SAPonAIX    1 */
    #define SAPonMVSOE    1
    #define SAPonOS390    1

    /* OE has X-Windows support */
    #define SAPwithX 1

    /* not used in any C/H-file! */
    #define SAPwithFIFO 1

    /* occurs in sapscsa.c and sapcscsa.c: but SAPonSYS5_2 is used there*/
    #define SAPwithSHM 1

    /* (TG:) Setting _NFILE for OE */
    /* SAP code requires that _NFILE is a constant value which is known at compile */
    /*   time.  The value must be as large as the number of open files which may   */
    /*   be opened by one SAP process.  It is for example used to loop thru all    */
    /*   open files after a fork and close them.                                   */
    #include <stdio.h>
    #undef  _NFILE
    #define _NFILE 200

    /* (TG:) Including string.h for inline placement of string functions */
    /*       to avoid calls to the library                               */
    #include <string.h>

    /* (WR:) Defining signals for OE */
    #include <signal.h>
    #ifndef NSIG             /* NSIG is used to establish a signal handler for all */
    #define NSIG 33          /*   possible signals.  32 is highest value of con-   */
    #endif                   /*   secutive signals.                                */
    #ifndef SIGIOT
    #define SIGIOT SIGABRT   /* old signal name */
    #endif

    #ifndef SIGEMT
    #define SIGEMT SIGABRT   /* Emulator Trap Instruction, said to be */
                             /* extremely rare. Presumably irrelevant */
    #endif                   /* for OE */

    /* Length of nodename from utsname (missing from utsname.h), */
    /*    needed at least in tpUNIX.h                            */
    #ifndef _SYS_NMLN
    #define _SYS_NMLN 32
    #endif

    /**********************************************************************/
    /*  Modifiers for exported Windows DLL functions                      */
    /**********************************************************************/
    #ifndef SAP_MODIFIERS
    #define SAP_MODIFIERS
    #define SAP_FAR
    #define SAP_PASCAL
    #define SAP_EXPORT
    #define SAP_LOADDS
    #define API_DF
    #define API_DF_C
    #endif /* SAP_MODIFIERS */

    /**********************************************************************/
    /*  classification of int, float and char representation              */
    /*  - correct classification is checked in abcglob.c                  */
    /*  - values: SAPwithINT_BIGENDIAN/LITTLEENDIAN                       */
    /*            SAPwithFLOAT_IEEE/370                                   */
    /*            SAPwithCHAR_ASCII/EBCDIC                                */
    /**********************************************************************/
    #define SAPwithINT_BIGENDIAN  1

    #ifdef __STRING_CODE_SET__  /* default float format: IEEE */
      #ifdef SAPwithFLOAT_370     /* float format forced to 370     */
        #ifdef SAPwithFLOAT_IEEE
          #undef SAPwithFLOAT_IEEE
        #endif
      #else                       /* float format defaulted to IEEE */
        #ifndef SAPwithFLOAT_IEEE
          #define SAPwithFLOAT_IEEE
        #endif
      #endif
    #else                       /* default float format: 370  */
      #ifdef SAPwithFLOAT_IEEE    /* float format forced to IEEE    */
        #ifdef SAPwithFLOAT_370
          #undef SAPwithFLOAT_370
        #endif
      #else                       /* float format defaulted to 370  */
        #ifndef SAPwithFLOAT_370
          #define SAPwithFLOAT_370
        #endif
      #endif
    #endif

    #ifdef __STRING_CODE_SET__
      #define SAPwithCHAR_ASCII     1
    #else
      #define SAPwithCHAR_EBCDIC    1
    #endif

    /* due to incomplete inclusion of saprfc.h in projects: */
    /* al, ixml, rsec ssf, rspo, auth, dynp                 */
    #if __STRING_CODE_SET__==ISO8859-1
    #define ItCreate                ItCreateA
    #define ItDelete                ItDeleteA
    #define ItGetLine               ItGetLineA
    #define ItPutLine               ItPutLineA
    #define ItCpyLine               ItCpyLineA
    #define ItInsLine               ItInsLineA
    #define ItAppLine               ItAppLineA
    #define ItDelLine               ItDelLineA
    #define ItGupLine               ItGupLineA
    #define ItFree                  ItFreeA
    #define ItFill                  ItFillA
    #define ItLeng                  ItLengA
    #define ItRegTable              ItRegTableA
    #define ItUserData              ItUserDataA
    #endif

    /**********************************************************************/
    /*                                                                    */
    /*  Platform identification                                           */
    /*                                                                    */
    /*  SAP_SYSTEMID can be used to uniquely identify the platform, where */
    /*  SAP is running.                                                   */
    /*                                                                    */
    /*  Conventions:                                                      */
    /*    see saptypeb.h                                                  */
    /*                                                                    */
    /**********************************************************************/
    /* was 0x140 for RS/6000  0x141 is not used for any other system right now */
    #define SAP_SYSTEMID 0x141



  #elif defined (SAPonRW320)

    /* ################################################################## */
    /* START: old 'typerw320.h'-file */
    /* ################################################################## */



    #define SAPTYPE_HF cU("RW320 (MIPS) with IRIX 4.0.5")


    /**********************************************************************/
    /*  switches for conditional compiling                                */
    /**********************************************************************/


    #define SAPonUNIX    1
    #define SAPonSYS5    1
    #define SAPonSYS5_2  1
    #define SAPonSYS5_4  1

    #define SAPonSINIX   1

    #define SAPwithX     1
    #define SAPwithSHM   1


    /**********************************************************************/
    /*  Modifiers for exported Windows DLL functions                      */
    /**********************************************************************/
    #ifndef SAP_MODIFIERS
      #define SAP_MODIFIERS
      #define SAP_FAR
      #define SAP_PASCAL
      #define SAP_EXPORT
      #define SAP_LOADDS
      #define API_DF
      #define API_DF_C
    #endif /* SAP_MODIFIERS */


    /**********************************************************************/
    /*  classification of int, float and char representation              */
    /*  - correct classification is checked in abcglob.c                  */
    /*  - values: SAPwithINT_BIGENDIAN/LITTLEENDIAN                       */
    /*            SAPwithFLOAT_IEEE/370                                   */
    /*            SAPwithCHAR_ASCII/EBCDIC                                */
    /**********************************************************************/
    #define SAPwithINT_BIGENDIAN  1
    #define SAPwithFLOAT_IEEE     1
    #define SAPwithCHAR_ASCII     1


    /**********************************************************************/
    /*                                                                    */
    /*  Platform identification                                           */
    /*                                                                    */
    /*  SAP_SYSTEMID can be used to uniquely identify the platform, where */
    /*  SAP is running.                                                   */
    /*                                                                    */
    /*  Conventions:                                                      */
    /*    see saptypeb.h                                                  */
    /*                                                                    */
    /**********************************************************************/
    #define SAP_SYSTEMID 0x142

  #elif defined (SAPonSGI)

	#define SAPTYPE_HF cU("SGI (MIPS) with IRIX 6.X")


	/**********************************************************************/
	/*  switches for conditional compiling                                */
	/**********************************************************************/

	#define SAPonSGI   1

	#define SAPonUNIX    1
	#define SAPonSYS5    1
	#define SAPonSYS5_2  1
	#define SAPonSYS5_4  1

	#define SAPwithX     1
	#define SAPwithSHM   1


	/**********************************************************************/
	/*  Modifiers for exported Windows DLL functions                      */
	/**********************************************************************/
	#ifndef SAP_MODIFIERS
	#define SAP_MODIFIERS
	#define SAP_FAR
	#define SAP_PASCAL
	#define SAP_EXPORT
	#define SAP_LOADDS
	#define API_DF
	#define API_DF_C
	#endif /* SAP_MODIFIERS */


	/**********************************************************************/
	/*  classification of int, float and char representation              */
	/*  - correct classification is checked in abcglob.c                  */
	/*  - values: SAPwithINT_BIGENDIAN/LITTLEENDIAN                       */
	/*            SAPwithFLOAT_IEEE/370                                   */
	/*            SAPwithCHAR_ASCII/EBCDIC                                */
	/**********************************************************************/
	#define SAPwithINT_BIGENDIAN  1
	#define SAPwithFLOAT_IEEE     1
	#define SAPwithCHAR_ASCII     1


	/**********************************************************************/
	/*                                                                    */
	/*	Platform identification                                           */
	/*                                                                    */
	/*  SAP_SYSTEMID can be used to uniquely identify the platform, where */
	/*  SAP is running.                                                   */
	/*                                                                    */
	/*  Conventions:                                                      */
	/*    see saptypeb.h                                                  */
	/*                                                                    */
	/**********************************************************************/
	#define SAP_SYSTEMID 0x144

	#include "nisgi.h"
	struct timezone {
	   int tz_minuteswest;
	   int tz_dsttime;
        };


  #elif defined (SAPonSUN)

    /* ################################################################## */
    /* START: old 'typesun.h'-file */
    /* ################################################################## */



    #define SAPTYPE_HF cU("SUN on SPARC CPU with Solaris 2.2")

    /* avoid name space pollution */
    #undef sun
    #undef unix
    #undef sparc

    /**********************************************************************/
    /*  switches for conditional compiling                                */
    /**********************************************************************/


    #define SAPonUNIX    1

    #define SAPonSYS5    1
    #define SAPonSYS5_4  1

    #define SAPwithX     1
    #define SAPwithSHM   1


    /**********************************************************************/
    /*  Modifiers for exported Windows DLL functions                      */
    /**********************************************************************/
    #ifndef SAP_MODIFIERS
      #define SAP_MODIFIERS
      #define SAP_FAR
      #define SAP_PASCAL
      #define SAP_EXPORT
      #define SAP_LOADDS
      #define API_DF
      #define API_DF_C
    #endif /* SAP_MODIFIERS */


    /**********************************************************************/
    /*  classification of int, float and char representation              */
    /*  - correct classification is checked in abcglob.c                  */
    /*  - values: SAPwithINT_BIGENDIAN/LITTLEENDIAN                       */
    /*            SAPwithFLOAT_IEEE/370                                   */
    /*            SAPwithCHAR_ASCII/EBCDIC                                */
    /**********************************************************************/
    #define SAPwithINT_BIGENDIAN  1
    #define SAPwithFLOAT_IEEE     1
    #define SAPwithCHAR_ASCII     1


    /**********************************************************************/
    /* detect 64/32-bit compilation model and set according flags         */
    /* --- not yet implemented ----                                       */
    /**********************************************************************/
    #if defined(__sparcv9)
      #ifndef SAPwith64_BIT
        #define SAPwith64_BIT
      #endif
    #endif

    /**********************************************************************/
    /* set compile flag for oracle 64-bit/oci headers                     */
    /**********************************************************************/
    #ifdef SAPwith64_BIT
      #define SS_64BIT_SERVER 1
    #endif

    /**********************************************************************/
    /*                                                                    */
    /*  Platform identification                                           */
    /*                                                                    */
    /*  SAP_SYSTEMID can be used to uniquely identify the platform, where */
    /*  SAP is running.                                                   */
    /*                                                                    */
    /*  Conventions:                                                      */
    /*    see saptypeb.h                                                  */
    /*                                                                    */
    /**********************************************************************/
    #ifdef SAPwith64_BIT
      #define SAP_SYSTEMID 0x172
    #else
      #define SAP_SYSTEMID 0x171
    #endif


  #elif defined (SAPonLIN)

    #if defined __i386__
        #define SAPTYPE_HF cU("Intel x86 with Linux")
        #define SAP_SYSTEMID 0x183
        #define SAPwithINT_LITTLEENDIAN  1
    #elif defined __ia64__
        #define SAPTYPE_HF cU("Intel ia64 with Linux")
        #define SAP_SYSTEMID 0x184
        #define SAPwith64_BIT
        #define SAPwithINT_LITTLEENDIAN  1
    #elif defined __s390x__
        #define SAPTYPE_HF cU("IBM zSeries with Linux")
        #define SAPwithINT_BIGENDIAN     1
        #define SAP_SYSTEMID 0x185
        #define SAPwith64_BIT
        #define OPEN_MAX 256
    #else
        #error unknown Linux platform!
    #endif


    /**********************************************************************/
    /*  switches for conditional compiling                                */
    /**********************************************************************/

    #define SAPonLINUX   1
    #define SAPonUNIX    1
    #define SAPonSYS5    1
    #define SAPonSYS5_4  1

    #define SAPwithX     1
    #define SAPwithSHM   1


    /**********************************************************************/
    /*  Modifiers for exported Windows DLL functions                      */
    /**********************************************************************/
    #ifndef SAP_MODIFIERS
    #define SAP_MODIFIERS
    #define SAP_FAR
    #define SAP_PASCAL
    #define SAP_EXPORT
    #define SAP_LOADDS
    #define API_DF
    #define API_DF_C
    #endif /* SAP_MODIFIERS */

    /**********************************************************************/
    /*  classification of int, float and char representation              */
    /*  - correct classification is checked in abcglob.c                  */
    /*  - values: SAPwithINT_BIGENDIAN/LITTLEENDIAN                       */
    /*            SAPwithFLOAT_IEEE/370                                   */
    /*            SAPwithCHAR_ASCII/EBCDIC                                */
    /**********************************************************************/
/*    #define SAPwithINT_LITTLEENDIAN  1 is defined for each platform */
    #define SAPwithFLOAT_IEEE        1
    #define SAPwithCHAR_ASCII        1


    /**********************************************************************/
    /*                                                                    */
    /*  Platform identification                                           */
    /*                                                                    */
    /*  SAP_SYSTEMID can be used to uniquely identify the platform, where */
    /*  SAP is running.                                                   */
    /*                                                                    */
    /*  Conventions:                                                      */
    /*    see saptypeb.h                                                  */
    /*                                                                    */
    /**********************************************************************/
/*    #define SAP_SYSTEMID 0x183 is defined for each platform */

    /*
     * Terrible hack to avoid clashes
     */
    #ifndef _FEATURES_H
      #ifdef _POSIX_SOURCE
        #undef _POSIX_SOURCE
      #endif
      #ifdef _XOPEN_SOURCE
        #undef _XOPEN_SOURCE
      #endif
      #ifdef _XOPEN_SOURCE_EXTENDED
        #undef _XOPEN_SOURCE_EXTENDED
      #endif
      #undef FD_SETSIZE
    #endif

    typedef double SAP_DOUBLE __attribute__ ((aligned (8)));
    #define SAP_DOUBLE_MIN  DBL_MIN
    #define SAP_DOUBLE_MAX  DBL_MAX
    #define PLATFORM_MAX_T SAP_DOUBLE
    #define SAP_DOUBLE_DEFINED

    #define _NFILE OPEN_MAX /* for sapdaem.c */
    #define TF_ACKNOW TCP_NODELAY

  #elif defined (SAPonVMS)

    /* ################################################################## */
    /* START: old 'typevms.h'-file */
    /* ################################################################## */

    #ifdef __alpha
    #define SAPTYPE_HF cU("DEC Alpha with OpenVMS")
    #else
    #define SAPTYPE_HF cU("DEC VAX with OpenVMS")
    #endif
    /*--------------------------------------------------------------------*/
    /*  Switches of conditional compiling                                 */
    /*--------------------------------------------------------------------*/
    /*  Note: Only those switches don't do any harm that are not used.    */
    /*--------------------------------------------------------------------*/

    #define SAPonOpenVMS

    #ifdef __alpha
    #define SAPTYPE_HV "6.2"
    #define SAPonAXP
    #else
    #define SAPTYPE_HV "6.2"
    #define SAPonVAX
    #endif

    #define SAPwithSockets
    #define SAPwithX         /* version 10 or 11 */
    #define SAPwithFIFO
    #define SAPwithMSG

    #define SAPwithCC
    #define SAPwithANSI_PARAMS
    #define SAPwithANSI_VARARGS 	     /* use stdarg.h */
    #define SAPwithANSI_VOID

    #define SAPwithANSI_CONST
    #define SAPwithANSI_VOLATILE


    /**********************************************************************/
    /*  Modifiers for exported Windows DLL functions                      */
    /**********************************************************************/
    #ifndef SAP_MODIFIERS
    #define SAP_MODIFIERS
    #define SAP_FAR
    #define SAP_PASCAL
    #define SAP_EXPORT
    #define SAP_LOADDS
    #define API_DF
    #define API_DF_C
    #endif /* SAP_MODIFIERS */


    /**********************************************************************/
    /*  classification of int, float and char representation              */
    /*  - correct classification is checked in abcglob.c                  */
    /*  - values: SAPwithINT_BIGENDIAN/LITTLEENDIAN                       */
    /*            SAPwithFLOAT_IEEE/370                                   */
    /*            SAPwithCHAR_ASCII/EBCDIC                                */
    /**********************************************************************/

    #define SAPwithINT_LITTLEENDIAN
    #ifdef __ALPHA
    /* on alpha: SAP uses IEEE float but oracle uses G_float */
    #define SAPwithFLOAT_IEEE
    #define ORAwithFLOAT_VMSGFLOAT
    #endif
    #ifdef __VAX
    #define SAPwithFLOAT_VMSGFLOAT
    #endif

    /**/
    /*--------------------------------------------------------------------*/
    /*  machine independent simple data types                             */
    /*--------------------------------------------------------------------*/

    typedef	short		key_t;	    /* Semaphore or shm key           */

    /*--------------------------------------------------------------------*/
    /* For ORACLE data access.                                            */

    #define TWO_BYTES_TO_USHORT(addr_twobytes) \
            (unsigned short)  \
            (((SAP_BYTE)((addr_twobytes)[0]) << 8) \
            | (SAP_BYTE)((addr_twobytes)[1]))

    /*--------------------------------------------------------------------*/
    /*  For nicer declarations                                            */
    /*--------------------------------------------------------------------*/

    #define PARAMS(pp)  pp              /* Declare procedures like:       */
    				    /* int proc1 PARAMS((char*,int)); */
    				    /* But:                           */
    				    /* This C-compiler does not like  */
    				    /* paramter lists in procedure    */
    				    /* declarations.                  */
    #define NOPARAMS (void)             /* For procedures without params. */



    /**
     ** VMS++  Porting Release 1.0   Peter Simon  , 24-MAR-1992 15:29:47.58
     **/

    #define MAXNAMLEN 40

    /*
    ** ++VMS 13-JUL-93 Christian Ihrig
    **
    ** some defines for the good old caddr_t - Problem in in.h and xlib.h
    */

    #if !defined (CADDR_T) && !defined(__CADDR_T)
    typedef char *caddr_t;
    #endif
    #ifndef CADDR_T
    #define CADDR_T
    #endif
    #ifndef __CADDR_T
    #define __CADDR_T
    #endif

    /*
    ** ++VMS 19-Mar-91 DEC Markus Schuetz
    **
    **	Macro to replace UNIX unlink() system call
    */
    #define unlink(p1)  remove((p1))

    /**
     ** VMS++  Porting Release 1.1
     ** Werner Rehm , 16-SEP-1992 17:03:43.45
     ** Makro to define strerror to vmsstrerror,
     ** because strerror(EVMSERR) return NULL -> access violation
     **/

    #define strerror vmsstrerror

    char    *vmsstrdup (char *src);
    char    *strdup (char *src);
    #define strdup	vmsstrdup

    #define accept	    vms_accept
    #define	connect	    vms_connect
    #define	listen	    vms_listen
    #define select	    vms_select
    #define send	    vms_send

    int vms_set_sendmode  ( int sd, int mode );
    int vms_get_recquota  ( int sd );
    int vms_get_sendquota ( int sd );
    int vms_get_nbflag    ( int sd );

    /***++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++***/

    /**** solange bis es im types.h drin ist... ****/
    /****         ( geklaut von HPUX )          ****/

    /* Types, macros, etc. for select() */

    #  ifndef MAXFUPLIM
    /*
     * MAXFUPLIM is the absolute limit of open files per process.  No process,
     * even super-user processes may increase u.u_maxof beyond MAXFUPLIM.
     * MAXFUPLIM means maximum files upper limit.
     * Important Note:  This definition should actually go into h/param.h, but
     * since it is needed by the select() macros which follow, it had to go here.
     * I did not put it in both files since h/param.h includes this file and that
     * would be error prone anyway.
     */
    #    define MAXFUPLIM       2048

    /*
     * These macros are used for select().  select() uses bit masks of file
     * descriptors in longs.  These macros manipulate such bit fields (the
     * file sysrem macros uses chars).  FD_SETSIZE may be defined by the user,
     * but must be >= u.u_highestfd + 1.  Since we know the absolute limit on
     * number of per process open files is 2048, we need to define FD_SETSIZE
     * to be large enough to accomodate this many file descriptors.  Unless the
     * user has this many files opened, he should redefine FD_SETSIZE to a
     * smaller number.
     */
    #    ifndef _KERNEL
    #      ifndef FD_SETSIZE
    #        define FD_SETSIZE MAXFUPLIM
    #      endif
    #    else /* not _KERNEL */
    #      define FD_SETSIZE MAXFUPLIM
    #    endif /* _KERNEL */

         typedef long fd_mask;

    #    define NFDBITS (sizeof(fd_mask) * 8)     /* 8 bits per byte */

    #    ifndef howmany
    #      define howmany(x,y)  (((x)+((y)-1))/(y))
    #    endif

         typedef struct fd_set {
           fd_mask fds_bits[howmany(FD_SETSIZE, NFDBITS)];
         } fd_set;

    #    define FD_SET(n,p)  ((p)->fds_bits[(n)/NFDBITS] |= (1 << ((n) % NFDBITS)))
    #    define FD_CLR(n,p) ((p)->fds_bits[(n)/NFDBITS] &= ~(1 << ((n) % NFDBITS)))
    #    define FD_ISSET(n,p) ((p)->fds_bits[(n)/NFDBITS] & (1 << ((n) % NFDBITS)))

    #    ifndef _KERNEL
    #        define FD_ZERO(p)     memset((char *)(p), (char) 0, sizeof(*(p)))
    #    endif /* not _KERNEL */
    #   endif /* not MAXFUPLIM */

    /***------------------------------------------------------------------------***/

    /**
     ** VMS++  Porting Release 1.1
     ** Werner Rehm ,  4-AUG-1992 09:41:45.90
     ** Makro to define P_tmpdir which is defines in <stdio.h> for UNIX
     **/

    #define  P_tmpdir "SYS$SCRATCH:"

    /**
     ** VMS++  Porting Release 1.1
     ** Christian Ihrig 25-AUG-1992
     **
     ** Macro to replace UNIX gmtime() system call with localtime(),
     ** because VMS don't supports the GMT time and so localtime()
     ** ends with the same results as gmtime() under UNIX
     **
     **/

    #define gmtime localtime

    #include <stat.h>
    #include <unixlib.h>
    #include <unixio.h>

    typedef unsigned long 	VMSPid;

    /* oft implicit function da in UNIX keine header Datei benoetigt wird */

    int sleep ( unsigned __secs);
    int gethostname ( char *__name , int __len );
    int putenv( char *__log );

    /**********************************************************************/
    /*                                                                    */
    /*  Platform identification                                           */
    /*                                                                    */
    /*  SAP_SYSTEMID can be used to uniquely identify the platform, where */
    /*  SAP is running.                                                   */
    /*                                                                    */
    /*  Conventions:                                                      */
    /*    see saptypeb.h                                                  */
    /*                                                                    */
    /**********************************************************************/

    #ifdef __alpha
    #define SAP_SYSTEMID 0x0320
    #else
    #define SAP_SYSTEMID 0x0310
    #endif



  #elif defined (SAPonWINDOWS)

    /* ################################################################## */
    /* START: old 'typewin.h'-file */
    /* ################################################################## */



    #define SAPTYPE_HF cU("PC with WINDOWS")


    /**********************************************************************/
    /*  switches for conditional compiling                                */
    /**********************************************************************/


    /* in future only standard ANSI C will be supported !!! */
    #ifndef NO_STDC
      # define __STDC__
    #endif

    #define WINDOWS                  /* for NOVELL TCPIP API */
    #define WSOCKETS_DLL             /* for MS TCPIP API */
    #define WINDLL_EXPORT FAR PASCAL


    /**********************************************************************/
    /*   Modifiers for exported Windows DLL functions                     */
    /**********************************************************************/
    #ifndef SAP_MODIFIERS
      #define SAP_MODIFIERS
      #define SAP_FAR __far
      #define SAP_PASCAL __pascal
      #define SAP_EXPORT __export

      #ifdef NO_SAP_LOADDS
        #define SAP_LOADDS
      #else
        #define SAP_LOADDS __loadds
      #endif

      #define API_DF  SAP_FAR SAP_LOADDS SAP_PASCAL
      #define API_DF_C  SAP_FAR SAP_LOADDS
    #endif /* SAP_MODIFIERS */


    /**********************************************************************/
    /*  classification of int, float and char representation              */
    /*  - correct classification is checked in abcglob.c                  */
    /*  - values: SAPwithINT_BIGENDIAN/LITTLEENDIAN                       */
    /*            SAPwithFLOAT_IEEE/370                                   */
    /*            SAPwithCHAR_ASCII/EBCDIC                                */
    /**********************************************************************/
    #define SAPwithINT_LITTLEENDIAN  1
    #define SAPwithFLOAT_IEEE        1
    #define SAPwithCHAR_ASCII        1


    /**********************************************************************/
    /*                                                                    */
    /*  Platform identification                                           */
    /*                                                                    */
    /*  SAP_SYSTEMID can be used to uniquely identify the platform, where */
    /*  SAP is running.                                                   */
    /*                                                                    */
    /*  Conventions:                                                      */
    /*    see saptypeb.h                                                  */
    /*                                                                    */
    /**********************************************************************/
    #define SAP_SYSTEMID 0x220

  #else
    #error Please set a SAPon<PLATFORM> switch for saptype.h
  #endif

#endif  /* SAPTYPE_H */

#ifdef __cplusplus
}
#endif

/**********************************************************************/
/*                                                                    */
/*  saptypeb.h:  platform independent defines                         */
/*                                                                    */
/*  If SAP_SET_PLATFORM is set:                                       */
/*    saptypeb.h is not included                                      */
/*    SAP_SET_PLATFORM will be reset                                  */
/*                                                                    */
/*  If SAP_SET_PLATFORM is not set:                                   */
/*    saptypeb.h is included                                          */
/*                                                                    */
/*  Usage:                                                            */
/*    #define SAP_SET_PLATFORM                                        */
/*    #include "saptype.h"       /o without saptypeb.h        o/      */
/*                                                                    */
/*    #include "curses.h"        /o conflicts with saptypeb.h o/      */
/*                               /o e.g. MIN, MAX             o/      */
/*                                                                    */
/*    #include "saptypeb.h"                                           */
/*                                                                    */
/**********************************************************************/
#ifndef SAP_SET_PLATFORM
    #include "saptypeb.h"

    #ifdef SAPonWINDOWS

      #ifdef WIN_FPRINTF

          #include "wnport.h"

          #undef fprintf
          #define fprintf WINfprintf

          #undef vfprintf
          #define vfprintf WINvfprintf

          #undef fwrite
          #define fwrite WINfwrite

          #undef putc
          #define putc WINputc

          #undef stderr
          #define stderr NULL

      #endif  /* WIN_FPRINTF */

    #endif /* SAPonWINDOWS */

#else

    #undef SAP_SET_PLATFORM

#endif

