home *** CD-ROM | disk | FTP | other *** search
/ Media Share 9 / MEDIASHARE_09.ISO / cprog / newprt10.zip / TOOLKIT.H < prev   
C/C++ Source or Header  |  1990-01-31  |  2KB  |  93 lines

  1. /*_ toolkit.h   Tue Apr 18 1989   Modified by: Walter Bright */
  2.  
  3. #ifndef TOOLKIT_H
  4. #define TOOLKIT_H
  5.  
  6. /* Define stuff that's different between machines.
  7.  * PROTOTYPING        1 if compiler supports prototyping
  8.  * HOSTBYTESWAPPED    1 if on the host machine the bytes are
  9.  *            swapped (1 for 6809, 68000, 0 for 8088
  10.  *            and VAX).
  11.  */
  12.  
  13. #if __ZTC__
  14. #define PROTOTYPING    1
  15. #define HOSTBYTESWAPPED    0
  16. #define EXIT_SUCCESS    0
  17. #define EXIT_FAILURE    1
  18.  
  19. #define BITSPERBYTE 8
  20. #define SIZEOFINT   sizeof(int)
  21. #define SIZEOFLONG  sizeof(long)
  22.  
  23. #else
  24. #ifdef M_UNIX     /* SCO UNIX using Microshaft C. */
  25. #define PROTOTYPING    1
  26. #define HOSTBYTESWAPPED    0
  27. #define EXIT_SUCCESS    0
  28. #define EXIT_FAILURE    1
  29.  
  30. #define BITSPERBYTE 8
  31. #define SIZEOFINT   sizeof(int)
  32. #define SIZEOFLONG  sizeof(long)
  33. #else
  34. #include    "host.h"
  35. #endif
  36.  
  37. #endif
  38.  
  39. /* Static definitions do not appear in the linker .MAP file. Override    */
  40. /* the definition here to make them global if necessary.        */
  41. #ifndef STATIC
  42. #define STATIC    static
  43. #endif
  44.  
  45. #define arraysize(array)    (sizeof(array) / sizeof(array[0]))
  46.  
  47. /* Macros so that we can do prototyping, but still work with non-    */
  48. /* prototyping compilers:                        */
  49.  
  50. #if PROTOTYPING
  51. #if MSC
  52. #define _0
  53. #else
  54. #define _0            void
  55. #endif
  56. #define _1(v)            v
  57. #define _2(v1,v2)        v1,v2
  58. #define _3(v1,v2,v3)        v1,v2,v3
  59. #define _4(v1,v2,v3,v4)        v1,v2,v3,v4
  60. #define _5(v1,v2,v3,v4,v5)    v1,v2,v3,v4,v5
  61. #define _6(v1,v2,v3,v4,v5,v6)    v1,v2,v3,v4,v5,v6
  62. #define _7(v1,v2,v3,v4,v5,v6,v7) v1,v2,v3,v4,v5,v6,v7
  63. #define _8(v1,v2,v3,v4,v5,v6,v7,v8) v1,v2,v3,v4,v5,v6,v7,v8
  64. #define _9(v1,v2,v3,v4,v5,v6,v7,v8,v9) v1,v2,v3,v4,v5,v6,v7,v8,v9
  65. #define _10(v1,v2,v3,v4,v5,v6,v7,v8,v9,v10) v1,v2,v3,v4,v5,v6,v7,v8,v9,v10
  66. #else
  67. #define _0
  68. #define _1(v)
  69. #define _2(v1,v2)
  70. #define _3(v1,v2,v3)
  71. #define _4(v1,v2,v3,v4)
  72. #define _5(v1,v2,v3,v4,v5)
  73. #define _6(v1,v2,v3,v4,v5,v6)
  74. #define _7(v1,v2,v3,v4,v5,v6,v7)
  75. #define _8(v1,v2,v3,v4,v5,v6,v7,v8)
  76. #define _9(v1,v2,v3,v4,v5,v6,v7,v8,v9)
  77. #define _10(v1,v2,v3,v4,v5,v6,v7,v8,v9,v10)
  78. #endif
  79.  
  80. #if PROTOTYPING
  81. #define P(s)    s
  82. #else
  83. #define P(s)    ()
  84. #endif
  85.  
  86. #ifdef DEBUG
  87. #define debug(a)    (a)
  88. #else
  89. #define debug(a)
  90. #endif
  91.  
  92. #endif /* TOOLKIT_H */
  93.