home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 9 / 09.iso / e / e065 / 2.ddi / HOST.H < prev    next >
Encoding:
C/C++ Source or Header  |  1991-08-28  |  24.2 KB  |  1,028 lines

  1. /* host.h - Variations between host machines/compilers defined here. */
  2.  
  3. /************************************************************************
  4.  * Copyright(C) 1988-91 Neural-Ware Inc                                 *
  5.  * Penn Center West, IV-227, Pittsburgh, PA  15276                      *
  6.  *                                                                      *
  7.  * All rights reserved.  No part of this program may be reproduced,     *
  8.  * stored in a retrieval system, or tramsmitted, in any form or by any  *
  9.  * means, electronic, mechanical, photocopying, recording or otherwise  *
  10.  * without the prior written permission of the copyright owner,         *
  11.  * Neural-Ware, Inc.                                                    *
  12.  ************************************************************************
  13.  */
  14.  
  15. /* TM : 06-Sep-90:  pull together all information into single file */
  16. /* AWP, TM - add platform detection, more generic #ifdefs */
  17.  
  18. #ifndef HOST_H
  19. #define HOST_H  1
  20.  
  21. /*
  22.  * -----------------------------------------------------------------------
  23.  * SEC 1. MAP SOFTWARE/PLATFORM #IFDEFS ONTO SPECIFIC MACHINE TYPES
  24.  * -----------------------------------------------------------------------
  25.  */
  26.  
  27. #define MULTIPLAT  **error** -- multiple definitions for this platform
  28.  
  29. #if defined(_CRAY) && defined(_UNICOS)
  30. /* --------------- xxx xxx ( CRAY ) --------------- */
  31. #ifdef platform
  32. MULTIPLAT
  33. #endif
  34. #define platform
  35. #ifndef CRAY
  36. #define CRAY 1
  37. #endif
  38. #endif
  39.  
  40. #if defined(mips) && defined(nec) && defined(nec_e48m220) \
  41.     && defined(nec_ews) && defined(nec_ews_risc1) && defined(nec_ews_svr4) \
  42.     && defined(r3000) && defined(unix)
  43. /* --------------- xxx xxx ( EWS ) --------------- */
  44. #ifdef platform
  45. MULTIPLAT
  46. #endif
  47. #define platform
  48. #ifndef EWS
  49. #define EWS 1
  50. #endif
  51. #endif
  52.  
  53. #if defined(bsd4_2) && defined(ultrix) && defined(unix) && defined(vax)
  54. /* --------------- xxx xxx ( VAXULT ) --------------- */
  55. #ifdef platform
  56. MULTIPLAT
  57. #endif
  58. #define platform
  59. #ifndef VAXULT
  60. #define VAXULT 1
  61. #endif
  62. #endif
  63.  
  64. #if defined(sparc) && defined(sun) && defined(unix)
  65. /* --------------- xxx xxx ( SUN4 ) --------------- */
  66. /* oddly enough, while the cc defines sun4 in this case, 
  67.    cpp does not. */
  68. #ifdef platform
  69. MULTIPLAT
  70. #endif
  71. #define platform
  72. #ifndef SUN4
  73. #define SUN4 1
  74. #endif
  75. #endif
  76.  
  77. #if defined(mc68000) && defined(mc68020) && defined(sun) && defined(sun3) \
  78. && defined(unix)
  79. /* --------------- xxx xxx ( SUN3 ) --------------- */
  80. #ifdef platform
  81. MULTIPLAT
  82. #endif
  83. #define platform
  84. #ifndef SUN3
  85. #define SUN3 1
  86. #endif
  87. #endif
  88.  
  89. #if defined(i386) && defined(sun) && defined(sun386) && defined(unix)
  90. /* --------------- xxx xxx (SUN386) --------------- */
  91. #ifdef platform
  92. MULTIPLAT
  93. #endif
  94. #define platform
  95. #ifndef SUN386
  96. #define SUN386 1
  97. #endif
  98. #endif
  99.  
  100. #if defined(SUN3) || defined (SUN386) || defined (SUN4)
  101. /* force SUN definition */
  102. #define SUN 1
  103. #endif
  104.  
  105. /*
  106.  * -----------------------------------------------------------------------
  107.  * SEC 2. Set up defaults
  108.  * -----------------------------------------------------------------------
  109.  */
  110.  
  111. /* undef INT_EQ_SHORT, INT_EQ_LONG by default; 
  112.    one must be defined, depending upon the compiler */
  113.  
  114. #undef  INT_EQ_SHORT
  115. #undef  INT_EQ_LONG
  116.  
  117. /* some compilers do not permit sizeof(int) to be used in a macro; if
  118.    yours does, define SIZEOF_MACRO_OK */
  119.  
  120. #undef SIZEOF_MACRO_OK
  121.  
  122. #if !defined(_STDIO_H)
  123. #include <stdio.h>
  124. #endif
  125. #if defined(SKY) && !defined(fileno)
  126. /* riddle this: SKY's stdio.h will not define fileno unless _K_AND_R
  127.    is set or _MSDOS and __HIGHC__ are set. */
  128. #define fileno(__stream)  ((__stream)->_file) 
  129. #endif
  130. /*
  131.  * -----------------------------------------------------------------------
  132.  * SEC 3. For each "platform" specify ...
  133.  * The following symbols should be defined as 1 if applicable;
  134.  * undefined otherwise
  135.  *
  136.  * PROTOTYPING : supports function prototyping (or tolerates the syntax)
  137.  * ANSI_HEADER : supports new style function header
  138.  *
  139.  * ELLIPSIS : should be defined as "..." or nothing, depending upon
  140.  * what should be in the last argument of a prototype to indicate
  141.  * that the number of args is variable
  142.  
  143.  * IBM_TYPE : this product is being built for some sort of IBM AT
  144.  * variant - possibilities include standard IBM, NEC, and  FUJITSU
  145.  *
  146.  * one of the xxx_KEYS options must be selected, except for X versions
  147.  *
  148.  * IBM_KEYS 
  149.  * NEC_KEYS
  150.  * FUJITSU_KEYS
  151.  * SUN_KEYS
  152.  * -----------------------------------------------------------------------
  153.  */
  154. /* */
  155. #if (!defined(HOST_IS) && defined(__ZTC__))
  156. #define HOST_IS "IBM AT,MS-DOS,ZORTECH C"
  157. #define IBM_TYPE 1
  158. #define MSDOS 1   /* operating system (predefined by  */
  159.         /* Zortech preprocessor)    */
  160. #ifndef DLC
  161. #define DLC 1   /* compiler - for historical reasons */
  162. #endif
  163.  
  164. #define PROTOTYPING 1 /* compiler supports function prototyping */
  165. #define ANSI_HEADER 1
  166. #define ELLIPSIS  ...
  167.  
  168. #define INT_EQ_SHORT  1
  169. #define SIZEOF_MACRO_OK 1
  170.  
  171. #endif /* __ZTC */
  172. /* */
  173. #if (!defined(HOST_IS) && defined(__TURBOC__))
  174. #define HOST_IS "IBM AT,MS-DOS,TURBO C"
  175. #define IBM_TYPE 1
  176. #define MSDOS 1   /* operating system (predefined by  */
  177.         /* Zortech preprocessor)    */
  178.  
  179. #define PROTOTYPING 1 /* compiler supports function prototyping */
  180. #define ANSI_HEADER 1
  181. #define ELLIPSIS  ...
  182.  
  183. #define INT_EQ_SHORT  1
  184. #define SIZEOF_MACRO_OK 1
  185.  
  186. #endif /* __TURBOC__ */
  187. /* */
  188.  
  189. /* M_I86 and MSDOS are predefined by Microsoft C compiler */
  190.  
  191. #if (!defined(HOST_IS) && defined(M_I86))
  192. #define HOST_IS "IBM 80x86,MS-DOS,MSC 6.0"
  193.  
  194. #define IBM_TYPE  1
  195. #define MSC   6     /* set MSC to the version */
  196.  
  197. #define PROTOTYPING 1 /* compiler supports function prototyping */
  198.  
  199. #define ANSI_HEADER 1
  200. #define ELLIPSIS  ...
  201.  
  202. #define INT_EQ_SHORT  1
  203.  
  204. #endif /* M_I86 */
  205.  
  206. /* */
  207. /* IBM AT, MS-DOS, Turbo C */
  208. #if (!defined(HOST_IS) && defined(__TURBOC__))
  209. #define HOST_IS "IBM AT,MS-DOS,TURBO C"
  210. #define IBM_TYPE  1
  211. #define MSDOS 1   /* operating system     */
  212.  
  213. #define PROTOTYPING 1 /* compiler supports function prototyping */
  214. #define ANSI_HEADER 1
  215. #define ELLIPSIS  ...
  216.  
  217. #define INT_EQ_SHORT  1
  218. #define SIZEOF_MACRO_OK 1
  219.  
  220. /* Default 0 pointer type */
  221. #ifndef NULL
  222. #if LPTR
  223. #define NULL  (0L)
  224. #else
  225. #define NULL  0
  226. #endif
  227. #endif
  228.  
  229. #endif /* __TURBOC__ */
  230.  
  231. /* */
  232. #if defined(IBP)              
  233. /* This must come after the __ZTC__, */
  234.  
  235. #define assert(e) ((e) || (_assert("e",__FILE__,__LINE__),1))
  236. extern void _assert(char *, char *, unsigned);
  237.  
  238. #define fprintf ndp_fprintf
  239. #define vfprintf ndp_vfprintf
  240. #define fputs ndp_fputs
  241. #define fputc ndp_fputc
  242. int ndp_vfprintf(FILE *stream, const char *format, va_list arg);
  243. int ndp_fprintf(FILE *stream, const char *format, ...);
  244. int ndp_fputs(const char *s, FILE *stream);
  245. int ndp_fputc(int c, FILE *stream);
  246.  
  247. #ifndef M_I86
  248. #ifndef __TURBOC__
  249. #ifndef __ZTC__   /* this stuff runs under protected mode */
  250. #define HOST_IS "IBM 386,MS-DOS,NDP C"
  251. #define IBM_TYPE  1
  252.  
  253. #ifndef IBM
  254. #define IBM     1
  255. #endif
  256.  
  257. #ifndef MSDOS
  258. #define MSDOS 1 /* operating system  - defined as arg to make */
  259. #endif
  260.  
  261. #define NDP 1 /* compiler   */
  262.  
  263. #define stdprn    stderr
  264.  
  265. #define PROTOTYPING 1
  266. #define ANSI_HEADER 1
  267. #define ELLIPSIS  ...
  268.  
  269. #define INT_EQ_LONG   1
  270.  
  271. /* Default 0 pointer type */
  272. #ifndef NULL
  273. #define NULL  (0L)
  274. #endif
  275.  
  276. /* Unsupported type syntax */
  277. #define signed
  278. #define volatile
  279. #define far
  280.  
  281. #else /* __ZTC__ */
  282. #define SERVER    1
  283. #endif /* __ZTC__ */
  284. #else /* __TURBOC__ */
  285. #define SERVER    1
  286. #endif /* __TURBOC__ */
  287. #else /* M_I86 */
  288. #define SERVER    1
  289. #endif /* M_I86 */
  290. #endif /* IBP */
  291.  
  292. /* */
  293. /* The I860 set may be called when HOST_IS has already been defined */
  294. /* This must come after the M_I86 stuff */
  295. #if defined(M860) || defined(A860) || defined(W860)
  296. #define TWO_MACHINE_MODEL   1
  297. #define I860     1
  298. #ifndef M_I86
  299. #define WORKER   1
  300. #ifdef M860
  301. #define HOST_IS "I860, MS-DOS, GreenHills C"
  302. #else
  303. #ifdef A860
  304. #define HOST_IS "I860, MS-DOS, MetaWare C"
  305. #define assert(e) ((e) || (_assert("e",__FILE__,__LINE__),1))
  306. extern void _assert(char *, char *, unsigned);
  307. #else
  308. /* W860 */
  309. #define HOST_IS "I860, MS-DOS, ???????? C"
  310. #endif
  311. #endif
  312. #define IBM_TYPE  1
  313.  
  314. #ifndef IBM
  315. #define IBM     1
  316. #endif
  317.  
  318. #ifndef MSDOS
  319. #define MSDOS 1 /* operating system  - defined as arg to make */
  320. #endif
  321.  
  322. #define stdprn    stderr
  323. #define NDP 1 /* compiler   */
  324.  
  325. #define PROTOTYPING 1
  326. #define ANSI_HEADER 1
  327. #define ELLIPSIS  ...
  328.  
  329. #define INT_EQ_LONG   1
  330.  
  331. /* Default 0 pointer type */
  332. #ifndef NULL
  333. #define NULL  (0L)
  334. #endif
  335.  
  336. /* Unsupported type syntax */
  337. #define signed
  338. #define volatile
  339. #define far
  340.  
  341. #else /* M_I86 */
  342. #define SERVER    1
  343. #endif /* M_I86 */
  344. #endif /* I860 set */
  345.  
  346. /* */
  347. #if (!defined(HOST_IS) && defined(NEXT))
  348. #define HOST_IS "NeXT, Mach, GNU C"
  349.  
  350. /* machine:   Symbol NeXT   is defined by GNU C compiler  */
  351. /* operating system:  Symbol __MACH__ is defined by GNU C compiler  */
  352. /* compiler:    Symbol __GNUC__ is defined when compiling ".c", */
  353. /*      ".s", or ".m" files       */
  354. /*      Symbol __OBJC__ is defined when compiling   */
  355. /*      Objective C ".m" files      */
  356.  
  357. #ifndef NEXTSTD_H
  358. #include "appkit/nextstd.h"
  359.         /* brings in math.h, stdio.h, and others */
  360.         /* nextstd.h is included by appkit.h if */
  361.         /* NEXTSTD_H is not defined */
  362. #endif
  363.  
  364. #define UNIX 1
  365.  
  366. #define PROTOTYPING 1 /* GNU C compiler supports prototyping */
  367. #define ANSI_HEADER 1
  368. #define ELLIPSIS
  369.  
  370. #define INT_EQ_LONG 1
  371.  
  372. /* Default 0 pointer type */
  373. #ifndef NULL
  374. #define NULL  (0)
  375. #endif
  376.  
  377. typedef void *windowhandle_t; /* whenever used should be cast to id !! */
  378.  
  379. typedef struct
  380. {
  381.   float red;
  382.   float green;
  383.   float blue;
  384. }RGBColor;      /* define an RGB color structure */
  385.  
  386. #endif /* NEXT */
  387. /* */
  388. #if (!defined(HOST_IS) && defined(RS6))
  389. #define HOST_IS "RS-6000,AIX"
  390.  
  391. #ifndef AIXOS
  392. #define AIXOS   1 /* AIX operating system */
  393. #endif
  394. #define UNIX 1
  395. #define DGXWIN    1 /* X-windows environment */
  396.  
  397. #define PROTOTYPING 1
  398. #define ANSI_HEADER 1
  399. #define ELLIPSIS  ...
  400.  
  401. #define INT_EQ_LONG 1
  402.  
  403. #undef signed   /* chars are unsigned */
  404. #define const
  405. #define volatile
  406. #define cdecl
  407.  
  408. #endif /* RS6 */
  409.  
  410. /* */
  411. #if (!defined(HOST_IS) && defined(VAXULT))
  412. #define HOST_IS    "VAX,ULTRIX"
  413.  
  414. #ifndef    ULTRIX
  415. #define    ULTRIX 1        /* DEC Ultrix operating system */
  416. #endif
  417. #define UNIX 1
  418. #define    DGXWIN        1    /* X-windows environment */
  419.  
  420. #undef ANSI_HEADER
  421. #undef PROTOTYPING
  422. #define    ELLIPSIS    ...
  423.  
  424. #define INT_EQ_LONG 1
  425.  
  426. #if 0
  427. #undef signed        /* chars are unsigned    */
  428. #else
  429. #define signed
  430. #endif
  431. #define const
  432. #define volatile
  433. #define    cdecl
  434.  
  435. #endif /* VAXULT */
  436. /* */
  437. #if (!defined(HOST_IS) && defined(EWS))
  438. #define HOST_IS "EWS/SVR4"
  439.  
  440. #ifndef SYSV
  441. #define SYSV 1                /* System 5 */
  442. #endif
  443.  
  444. #ifndef SVR4
  445. #define SVR4 1                /* System 5 release 4 */
  446. #endif
  447.  
  448. #define UNIX 1
  449.  
  450. #define DGXWIN          1       /* X-windows environment */
  451.  
  452. #undef  PROTOTYPING
  453. #undef  ANSI_HEADER     1
  454.  
  455. #define ELLIPSIS        ...
  456.  
  457. #define INT_EQ_LONG 1
  458.  
  459. #undef signed           /* chars are unsigned   */
  460. #define const
  461. #define volatile
  462. #define cdecl
  463.  
  464. #endif /* EWS */
  465. /* */
  466. #if (!defined(HOST_IS) && defined(CRAY))
  467. #define HOST_IS "CRAY/UNICOS"
  468.  
  469. #ifndef UNICOS
  470. #define UNICOS 1
  471. #endif
  472.  
  473. #define UNIX 1
  474.  
  475. #define DGXWIN          1       /* X-windows environment */
  476.  
  477. #undef  PROTOTYPING
  478. #undef  ANSI_HEADER     1
  479.  
  480. #define ELLIPSIS        ...
  481.  
  482. /* Actually, an INT  is 64 bit */
  483. #define INT_EQ_LONG 1
  484.  
  485. #undef signed           /* chars are unsigned   */
  486. #define const
  487. #define volatile
  488. #define cdecl
  489.  
  490. #endif /* CRAY */
  491. /* */
  492. #if (!defined(HOST_IS) && defined(SKY))
  493. #define HOST_IS "SKY/SUN4/SUNOS"
  494.  
  495. #define UNIX 1
  496. #define DGXWIN          1       /* X-windows environment */
  497.  
  498. #define  PROTOTYPING    1
  499. #define  ANSI_HEADER    1
  500. #define ELLIPSIS        ...
  501.  
  502. #define INT_EQ_LONG 1
  503.  
  504. #if 0
  505. #undef signed
  506. #endif
  507. #define const
  508. #define volatile
  509. #define cdecl
  510.  
  511. #endif /* SKY */
  512. /* */
  513. #if (!defined(HOST_IS) && (defined(SUN)))
  514. /*if (!defined(HOST_IS) && (defined(SUN))) */
  515. #define HOST_IS "Sun,BSD Unix,PCC"
  516.  
  517. #define BSDC  1   /* compiler       */
  518.  
  519. #if defined(SUN4SV) || defined(SUN3) || defined(SUN386)
  520. #define SUN_KEYS  1 /* keyboard       */
  521. #define DGSUN   1 /* DG routines for SUN */
  522. typedef char *windowhandle_t;
  523. #else
  524. #define DGXWIN 1
  525. #endif
  526. #define UNIX    1 /* UNIX operating system for special things */
  527.  
  528. #ifndef SUNOS_3
  529. #ifndef SUNOS_4
  530. #define SUNOS_4   1 /* default to SUN OS/4 */
  531. #endif
  532. #endif
  533.  
  534. #ifdef __TRANSPUTER__
  535. #define PROTOTYPING 1
  536. #define ANSI_HEADER 1
  537. #define ELLIPSIS ...
  538. #else
  539. #undef PROTOTYPING
  540. #undef ANSI_HEADER
  541. #define ELLIPSIS
  542. #define void int  /* Unix C doesn't handle void right */
  543. #endif
  544.  
  545. #define INT_EQ_LONG 1   /* is this true for all SUNs? */
  546.  
  547. #define signed    /* chars are signed */
  548. #define const
  549. #define volatile
  550.  
  551. /* Default 0 pointer type */
  552. #ifndef NULL
  553. #define NULL  0
  554. #endif
  555.  
  556. /* BSD still erroneously uses index() and rindex()  */
  557. #define strchr  index
  558. #define strrchr rindex
  559.  
  560. #endif /* SUN */
  561. /* */
  562. #if (!defined(HOST_IS) && (defined(MEIKO)))
  563.  
  564. #define HOST_IS "MEIKO,Sun host"
  565.  
  566. #define BSDC  1   /* compiler       */
  567.  
  568. #define DGXWIN 1
  569.  
  570. #define UNIX    1 /* UNIX operating system for special things */
  571.  
  572. #define PROTOTYPING 1
  573. #define ANSI_HEADER 1
  574. #define ELLIPSIS ...
  575.  
  576. #define INT_EQ_LONG 1
  577.  
  578. #define signed    /* chars are signed */
  579. #define const
  580. #define volatile
  581.  
  582. /* BSD still erroneously uses index() and rindex()  */
  583. #define strchr  index
  584. #define strrchr rindex
  585.  
  586. #endif /* MEIKO */
  587. /* */
  588. #if !defined(HOST_IS) && defined(XTM)
  589. #undef XTM
  590. #define XTM 1   /* machine        */
  591. #define UNIX  1   /* a misnomer on the XTM    */
  592. #define IBM_KEYS 1
  593.  
  594. #define HOST_IS "XTM, QIX"
  595.  
  596. #ifndef nw2pt /* is this correct ? should be in n2host.h, I think. */
  597. #define TRANS 1
  598. #endif
  599.  
  600. #define PROTOTYPING 1
  601. #define ANSI_HEADER 1
  602. #define ELLIPSIS ...
  603.  
  604. #define DGXTM 1
  605.  
  606. #define INT_EQ_LONG 1
  607.  
  608. /* Default 0 pointer type */
  609. #ifndef NULL
  610. #define NULL  0
  611. #endif
  612.  
  613. /* For windowing systems, we need a handle type for windows */
  614.  
  615. typedef char *windowhandle_t;
  616.  
  617. #endif /* XTM */
  618.  
  619. /* */
  620. #if !defined(HOST_IS) && (defined(MAC) || defined(THINK_C))
  621. #define HOST_IS "Apple Macintosh"
  622.  
  623. #ifndef MAC
  624. #define MAC 1
  625. #endif
  626.  
  627. #define MACOS   1
  628. #define DGMAC   1
  629.  
  630. #define ANSI_HEADER 1
  631. #if defined(MPW3) || defined(THINK_C)
  632. #define PROTOTYPING 1
  633. #define ELLIPSIS  ...
  634. #else
  635. #undef PROTOTYPING
  636. #define ELLIPSIS
  637. #endif  /* mpw3 */
  638.  
  639. #define signed    /* chars are signed */
  640. #define const
  641. #define volatile
  642.  
  643. #define INT_EQ_LONG 1
  644.  
  645. /* Default 0 pointer type */
  646. #ifndef NULL
  647. #define NULL  0L
  648. #endif
  649. #ifndef PROPRIETARY
  650. #include  "mac.h" /* Macintosh - specific stuff */
  651. #endif
  652. #endif /* MAC */
  653.  
  654. /* */
  655. #ifndef HOST_IS
  656.   error! error! error!
  657. #endif
  658.  
  659. #ifndef PROPRIETARY
  660. #ifdef IBM_TYPE
  661. #ifdef NEC
  662. #define NEC_KEYS    1 /* keyboard classification    */
  663. #define NEC_BIOS    1 /* bios classification    */
  664. #define IBM_SOUND   1 /* sound classification   */
  665. #define IBM_GRAPHICS  1 /* screen classification    */
  666. #define DGNEC            1   /* graphics library         */
  667. #else
  668. #ifdef FUJITSU
  669. #define FUJITSU_KEYS    1 /* keyboard classification    */
  670. #define FUJITSU_BIOS    1 /* bios classification    */
  671. #define FUJITSU_SOUND   1 /* sound classification   */
  672. #define FUJITSU_GRAPHICS  1 /* screen classification    */
  673. #define DGFUJ               1   /* graphics library         */
  674. #else
  675. #define IBM_KEYS  1 /* keyboard classification    */
  676. #define IBM_BIOS  1 /* bios classification    */
  677. #define IBM_SOUND 1 /* sound classification   */
  678. #define IBM_GRAPHICS  1 /* screen classification    */
  679. #define DGPC            1   /* graphics library         */
  680. #endif /* FUJITSU */
  681. #endif /* NEC */
  682. #endif /* IBM_TYPE */
  683. #endif /* PROPRIETARY */
  684. /*
  685.  * -----------------------------------------------------------------------
  686.  * SEC 4. Universal definitions which apply to everybody 
  687.  * -----------------------------------------------------------------------
  688.  */
  689.  
  690. #ifdef PROTOTYPING
  691. #define ARGLIST(a) a
  692. #define _A0 void
  693. #else
  694. #define ARGLIST(a) ()
  695. #define _A0
  696. #endif
  697.  
  698. #define BITSPERBYTE 8
  699.  
  700. typedef long           SL;   /* signed long */
  701. #define xdr_sl    xdr_long
  702.  
  703. typedef unsigned long  UL;   /* unsigned long */
  704. #define xdr_ul    xdr_u_long
  705.  
  706. typedef short          SW;   /* signed word */
  707. #define xdr_sw    xdr_short
  708.  
  709. typedef unsigned short UW;   /* unsigned word */
  710. #define xdr_uw    xdr_u_short
  711.  
  712. typedef char           XB;   /* unknown byte type */
  713. #define xdr_xb    xdr_char
  714.  
  715. typedef unsigned char  UB;   /* unsigned byte */
  716. #define xdr_ub    xdr_u_char
  717.  
  718. typedef int            NINT;   /* native integer */
  719. #define xdr_nint  xdr_int
  720.  
  721. typedef int            UNINT;    /* unsigned native integer */
  722.  
  723. typedef double         REAL;   /* floating point number */
  724. #define xdr_real  xdr_double
  725.  
  726. typedef float          SREAL;    /* short real */
  727. #define xdr_sreal xdr_float
  728.  
  729. #ifndef NW2tm /* conflict with cstools/build.h */
  730. typedef char    TEXT;   /* text string */
  731. #endif
  732.  
  733. #define VOID    void
  734. #define FAST    register  /* fast definitions */
  735. #define IMPORT  extern    /* external reference */
  736.  
  737. #define NORMTERM  0 /* Normal exit condition */
  738. #define ERRTERM   1 /*  error exit condition */
  739.  
  740. #define EXPORT        /* declare an external */
  741. #define LOCAL   static    /* local variables */
  742.  
  743. #define ASof(x)   (sizeof((x))/sizeof(x[0]))
  744.  
  745. /*
  746.  * -----------------------------------------------------------------------
  747.  * SEC 5. definitions which vary depending upon compiler or platform
  748.  * -----------------------------------------------------------------------
  749.  */
  750.  
  751. #ifdef SUN
  752. typedef char  MVOID;
  753. #else
  754. #define MVOID   void
  755. #endif
  756.  
  757. #ifdef MAC
  758. typedef short bool;
  759. #else
  760. typedef int bool;
  761. #endif
  762.  
  763. #ifdef INT_EQ_SHORT
  764. #define MAXINT  0x7FFF
  765. #define MININT  0x8000
  766. #define INT_16  int
  767. #define INT_32  long
  768. #define xdr_int32 xdr_long
  769. #endif
  770.  
  771. #ifdef INT_EQ_LONG
  772. #define MAXINT  0x7FFFFFFF
  773. #define MININT  0x80000000
  774. #define INT_16  short
  775. #define INT_32  int
  776. #define xdr_int32 xdr_int
  777. #endif
  778.  
  779. #ifdef SIZEOF_MACRO_OK
  780.  
  781. #define SIZEOFINT sizeof(int)
  782. #define SIZEOFLONG  sizeof(long)
  783.  
  784. #else /* preprocessor chokes on sizeof(int) in a MACRO */
  785.  
  786. #define SIZEOFSHORT 2 
  787. #define SIZEOFLONG  4
  788.  
  789. #ifdef INT_EQ_LONG
  790. #define SIZEOFINT SIZEOFLONG
  791. #else
  792. #define SIZEOFINT SIZEOFSHORT
  793. #endif /* not INT_EQ_LONG */
  794.  
  795. #endif /* not SIZEOF_MACRO_OK */
  796.  
  797. #define NRZRO         (.000001) /* close enough to zero */
  798.  
  799. #ifdef MSDOS
  800. #define FNLEN 8     /* max length for a file name */
  801. #define FN_DISP_LEN FNLEN               /* The display portion of file */
  802. #define FNXLEN  12      /* extended length */
  803. #endif /* MSDOS */
  804.  
  805. #if defined(UNIX)
  806. #define FNLEN 40      /* max length for a file name */
  807. #define FN_DISP_LEN 8                   /* The display portion of file */
  808. #define FNXLEN  120     /* extended length */
  809. #endif /* SUN */
  810.  
  811. #ifdef MAC
  812. #define FNLEN 27      /* max length for a file name */
  813. #define FN_DISP_LEN 8           /* The display portion of file */
  814. #define FNXLEN  31      /* extended length */
  815. #endif /* MAC */
  816.  
  817. #define L4A(x)  (((x)+3)&(-4))    /* always 4-byte alignment */
  818.  
  819. #define FNALC L4A(FNLEN+1)    /* space to allocate */
  820. #define FNXALC  L4A(FNXLEN+1)   /* space to allocate */
  821.  
  822. /* remove unused macros */
  823.  
  824. #undef INT_EQ_LONG
  825. #undef INT_EQ_SHORT
  826.  
  827. /* A story: ( TM, 1/23/91 )
  828.    According to the Harbison-Steele reference, ANSI C permits void 
  829.    in a function prototype, but not in a function definition, to 
  830.    indicate that the function accepts no arguments. 
  831.  
  832.    Some compilers, otherwise ANSI compliant, require that the definition
  833.    use "void" to match the prototype. To solve this sticky problem, 
  834.    use NO_ARGS in function definitions only.
  835. */
  836.  
  837. #if defined(__TRANSPUTER__) || defined(M_I86) || defined(RS6)
  838. #define NO_ARGS void
  839. #else
  840. #define NO_ARGS
  841. #endif
  842.  
  843. /* Older Unix machines use varargs.h to support a portable method for
  844.    handling multiple arguments. Newer compilers supply ANSI standard
  845.    stdarg.h */
  846.  
  847. #undef USE_VARARGS
  848. #if defined(SUN) || defined(EWS) || defined(CRAY)
  849. /* force VARARGS */
  850. #define USE_VARARGS 1
  851. #endif
  852.  
  853. #ifdef USE_VARARGS
  854. #include <varargs.h>
  855. #define VA_START(argp, last_arg) va_start(argp)
  856. #define VA_ALIST ,va_alist
  857. #else
  858. #include <stdarg.h>
  859. #define VA_START(argp, last_arg) va_start(argp, last_arg)
  860. #define va_dcl
  861. #define VA_ALIST
  862. #endif
  863.  
  864. #if defined(unix) && !defined(I860) && !defined(EWS) && !defined(CRAY)
  865. #define BSDUNIX 1
  866. #endif
  867.  
  868. #ifdef DGXWIN
  869. #include <X11/Intrinsic.h>
  870. #include <X11/keysym.h>
  871. #define FLIP_Y( value ) ((dg_displaybox[3] - (value)))
  872. typedef Widget  windowhandle_t;
  873. #endif
  874.  
  875. /* MSDOS compiler support for far pointers */
  876.  
  877. #if defined(__ZTC__)
  878. #define ZFAR far
  879. #define FAR far
  880. #else
  881. #define ZFAR
  882. #if defined(_MSC_VER)
  883. #define FAR _far
  884. #else
  885. #define FAR
  886. #endif  /* not MSC */
  887. #endif /* not ZTC */
  888.  
  889. #define VOIDF VOID ZFAR
  890.  
  891. /* some compilers require (VOID *) cast */
  892.  
  893. #if defined(SUN) || defined(XTM) || defined(TRANS_PHYS) || defined(VAXULT)
  894. #define    VP    (VOID *)    /* may cast vars as "(void*)ptr" */
  895. #else
  896. #define    VP
  897. #endif
  898.  
  899. /* process control, initiation and termination */
  900.  
  901. #ifndef XTM
  902. #define USAGE_STRC      1       /* Usage structure passed to wait4 function */
  903. #endif
  904.  
  905. /* Note: SUNOS_4 has a wait4( ); following are redefinitions for other
  906.    systems to improve readability */
  907.  
  908. #if defined(RS6) || defined(SYSV)
  909. #define wait4(pid,sp,opt,use) waitpid(pid,sp,opt)
  910. #undef  USAGE_STRC
  911. #else
  912. #if defined(SUNOS_3) || defined(NEXT) || defined(VAXULT)
  913. #define wait4(pid,sp,opt,use) wait3(sp,opt,use)
  914. #endif
  915. #endif
  916.  
  917. #if defined(RS6) || defined(NEXT) || defined(SYSV)
  918. #define vfork fork
  919. #endif
  920.  
  921. /*
  922.  * Inclusions (INCxxxxx)
  923.  */
  924.  
  925. /* --- strings.h or alternates --- */
  926.  
  927. #if defined(BSDUNIX) && !defined(SKY)    /* INCSTRINGS */
  928. #define INCSTRINGS            /* use <strings.h> (else <string.h>) */
  929. #endif                    /* note: VAX/VMS allows either! */
  930.  
  931. /* --- sys/types.h or alternates --- */
  932.  
  933. #if defined(UNIX) || defined(NEXT) || defined(MSC) || defined(__ZTC__) || \
  934.      defined(IBP) || defined(__TURBOC__) || defined(SKY)
  935. #define INCSYSTYPES            /* use <sys/types.h> (most common) */
  936. #elif defined(M860)
  937. #define INCMYRIADTYPES            /* use <myriad.h>, not <sys/types> */
  938. #elif !defined(THINK_C)            /* (use nothing) */
  939. #define INCTYPES            /* fallthru: use <types.h> */
  940. #endif
  941.  
  942. /* --- sys/file.h or alternates --- */
  943.  
  944. #if !defined(VAXULT) && !defined(MSDOS)    /* (BSDUNIX. NEXT? RS6? XTM? ...?) */
  945. #define INCSYSFILE            /* INCSYSFILE */
  946. #else                    /* use <sys/file.h> (most common) */
  947. #define INCFILE
  948. #endif                    /* else use <file.h> */
  949.  
  950. /* --- sys/vm.h or alternates --- */
  951.  
  952. #if defined(VAXULT) || defined(EWS)    /* INCSYSVM */
  953. #define INCSYSVM            /* use <sys/vm.h> (rare?) */
  954. #else
  955. #define INCVM                /* else use <vm.h> */
  956. #endif
  957.  
  958. /*
  959.  * External References (EXTxxxxx)
  960.  */
  961.  
  962. /* EXTMEMMOVE ------------------------- */
  963. #if defined(BSDUNIX) && !defined(VAXULT)
  964. #define EXTMEMMOVE            /* extern memmove() */
  965. #endif
  966.  
  967. /* EXTSTDERR ------------------------- */
  968. /* seems to be everyone but MS-DOS */
  969. #if defined(MAC) || defined(UNIX) || defined(NEXT) || \
  970.     defined(IBP) || defined(I860)
  971. #define EXTSTDERR 1            /* use "stderr" else "stdprn" */
  972. #endif
  973.  
  974. /*
  975.  * Macro Activiation (MACxxxxx)
  976.  */
  977.  
  978. /* ( CPP can't handle arithmetic - see nw2/n2menu.c ) */
  979. #if defined(UNIX)
  980. #define MACNOARITH
  981. #endif
  982.  
  983. /*
  984.  * Code Segment Activiation (SRCxxxxx)
  985.  */
  986.  
  987. #if !defined(VAXVMS) && !defined(VAXULT)
  988. #define SRCCASTLONG            /* SRCCASTLONG */
  989. #endif                    /* supports: "*(long*)(ch) = -1" */
  990.  
  991. #if defined(MSDOS) && !defined(IBP)
  992. #define SRCVM                /* SRCVM */
  993. #endif                    /* enable body of "src/tk/if/vm.c" */
  994.  
  995. /*
  996.  * Function and Procedure Activiation (FUNxxxxx)
  997.  */
  998.  
  999. /* String Duplication */
  1000.  
  1001. #if defined(RS6)
  1002. #define ZREFSTRDUP 1
  1003. #endif
  1004.  
  1005. #if defined(MAC) || defined(XTM) || defined(VAXULT) || defined(SKY)
  1006. #define FUNSTRDUP 1
  1007. #endif
  1008.  
  1009. #if defined(FUNSTRDUP) || defined(ZDEFSTRING)
  1010. char *strdup ARGLIST(( char * )); /* this is supposed to be in string.h but it's not */
  1011. #endif
  1012.  
  1013. /*
  1014.  .
  1015.  ....... empty for now .......
  1016.  .
  1017. */
  1018.  
  1019. /*
  1020.  * General (Misc) Use (USExxxxx)
  1021.  */
  1022.  
  1023. /* ------------------------------------ */
  1024.  
  1025. /* ANY other wierdnesses looking for a home... */
  1026.  
  1027. #endif /* HOST_H */
  1028.