home *** CD-ROM | disk | FTP | other *** search
/ Monster Media 1994 #1 / monster.zip / monster / PROG_C / SNPD9404.ZIP / TOOLKIT.H < prev    next >
C/C++ Source or Header  |  1994-04-03  |  2KB  |  67 lines

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