home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / snip9707.zip / TOOLKIT.H < prev    next >
C/C++ Source or Header  |  1997-07-05  |  2KB  |  69 lines

  1. /* +++Date last modified: 05-Jul-1997 */
  2.  
  3. /*
  4. **  This is a copyrighted work which is functionally identical to work
  5. **  originally published in Micro Cornucopia magazine (issue #52, March-April,
  6. **  1990) and is freely licensed by the author, Walter Bright, for any use.
  7. */
  8.  
  9. /*_ toolkit.h   Tue Apr 18 1989   Modified by: Walter Bright */
  10.  
  11. #ifndef TOOLKIT_H
  12. #define TOOLKIT_H
  13.  
  14. /* Define stuff that's different between machines.
  15.  * PROTOTYPING          1 if compiler supports prototyping
  16.  * HOSTBYTESWAPPED      1 if on the host machine the bytes are
  17.  *                swapped (1 for 6809, 68000, 0 for 8088
  18.  *                and VAX).
  19.  */
  20.  
  21. #if defined(MSDOS) || defined(__MSDOS__)
  22. #define PROTOTYPING     1
  23. #define HOSTBYTESWAPPED 0
  24.  
  25. #define BITSPERBYTE 8
  26. #define SIZEOFINT   sizeof(int)
  27. #define SIZEOFLONG  sizeof(long)
  28.  
  29. #else
  30. #ifdef M_UNIX     /* SCO UNIX using Microsoft C. */
  31. #define PROTOTYPING     1
  32. #define HOSTBYTESWAPPED 0
  33. #define EXIT_SUCCESS    0
  34. #define EXIT_FAILURE    1
  35.  
  36. #define BITSPERBYTE 8
  37. #define SIZEOFINT   sizeof(int)
  38. #define SIZEOFLONG  sizeof(long)
  39. #else                   /* NOTE: host.h is *NOT* included in SNIPPETS    */
  40. #include    "host.h"    /* Compiler/environment-specific stuff goes here */
  41. #endif
  42.  
  43. #endif
  44.  
  45. /* Static definitions do not appear in the linker .MAP file. Override   */
  46. /* the definition here to make them global if necessary.          */
  47. #ifndef STATIC
  48. #define STATIC    static
  49. #endif
  50.  
  51. #define arraysize(array)      (sizeof(array) / sizeof(array[0]))
  52.  
  53. /* Macros so that we can do prototyping, but still work with non- */
  54. /* prototyping compilers:                                   */
  55.  
  56. #if PROTOTYPING
  57. #define P(s)      s
  58. #else
  59. #define P(s)      ()
  60. #endif
  61.  
  62. #ifdef DEBUG
  63. #define debug(a)  (a)
  64. #else
  65. #define debug(a)
  66. #endif
  67.  
  68. #endif /* TOOLKIT_H */
  69.