home *** CD-ROM | disk | FTP | other *** search
/ The Atari Compendium / The Atari Compendium (Toad Computers) (1994).iso / files / prgtools / mint / lib / mntsox46.zoo / patch / compiler.h next >
Encoding:
C/C++ Source or Header  |  1995-08-14  |  6.4 KB  |  244 lines

  1. /* compiler specific defines */
  2. /* this file is guaranteed to be included exactly once if you include
  3.    anything at all. all site-dependent or compiler-dependent stuff
  4.    should go here!!!
  5.  */
  6.  
  7. #ifndef _COMPILER_H
  8. #define _COMPILER_H
  9.  
  10. /* symbol to identify the library itself */
  11. #ifndef __MINT__
  12. #define __MINT__
  13. #endif
  14.  
  15. /* symbols to identify the type of compiler */
  16.  
  17. /* 6/12/94 sb -- There are now two more or less current branches of the
  18.    Sozobon compiler:  HSC and SozobonX.  We use __HSC__ and __SOZOBONX__
  19.    for these, respectively, and __SOZOBON__ to mean that one or the
  20.    other is active. */
  21.  
  22. #ifdef __SOZOBONX__    /* Sozobon eXtended version */
  23. #define __SOZOBON__ __SOZOBONX__
  24. #else
  25. # ifdef __HSC__        /* Heat-n-Serve C, v1.40 on */
  26. # define __SOZOBON__ __SOZOBONX__
  27. # else
  28. #  ifdef __SOZOBONC__    /* Heat-n-Serve C, v1.33 through 1.40 */
  29. #  define __SOZOBON__ __SOZOBONC__
  30. #  define __HSC__ __SOZOBONC__
  31. #  else
  32. #   ifdef SOZOBON
  33.   /* The "real" Sozobon, as distinct from HSC or SozobonX.  Don't want
  34.      to assume any features about it, so set version number to 0. */
  35. #   define __SOZOBON__ 0
  36. #   endif /* SOZOBON */
  37. #  endif /* __SOZOBONC__ */
  38. # endif /* __HSC__ */
  39. #endif /* __SOZOBONX__ */
  40.  
  41. #ifdef LATTICE
  42. #define __LATTICE__
  43. #endif
  44.  
  45. /* general library stuff */
  46. /* __SIZE_TYPEDEF__:     the type returned by sizeof() */
  47. /* __PTRDIFF_TYPEDEF__: the type of the difference of two pointers */
  48. /* __WCHAR_TYPEDEF__:     wide character type (i.e. type of L'x') */
  49. /* __EXITING:           the type of a function that exits */
  50. /* __NORETURN:          attribute of a function that exits (gcc >= 2.5) */
  51. /* __CDECL:             function must get parameters on stack */
  52.         /* if !__CDECL, passing in registers is OK */
  53.  
  54. /* symbols to report about compiler features */
  55. /* #define __NEED_VOID__    compiler doesn't have a void type */
  56. /* #define __MSHORT__        compiler uses 16 bit integers */
  57. /* (note that gcc and C68 define this automatically when appropriate) */
  58. /* #define __GROK_CONST__    compiler is not ANSI, but recognizes */
  59. /*                `const' and `volatile' keywords -- sb 6/12/94 */
  60.  
  61. #ifdef __GNUC__
  62. #if __GNUC__ > 1
  63. #define __SIZE_TYPEDEF__ __SIZE_TYPE__
  64. #define __PTRDIFF_TYPEDEF__ __PTRDIFF_TYPE__
  65. #ifdef __GNUG__
  66. /* In C++, wchar_t is a distinct basic type,
  67.    and we can expect __wchar_t to be defined by cc1plus.  */
  68. #define __WCHAR_TYPEDEF__ __wchar_t
  69. #else
  70. /* In C, cpp tells us which type to make an alias for.  */
  71. #define __WCHAR_TYPEDEF__ __WCHAR_TYPE__
  72. #endif
  73. #else
  74. #ifndef sun
  75. #  define __SIZE_TYPEDEF__ unsigned long
  76. #  define __PTRDIFF_TYPEDEF__ long
  77. #  define __WCHAR_TYPEDEF__ int
  78. #else
  79.    /* sun always seems to have an agenda of their own */
  80. #  include <sys/stdtypes.h>
  81. #  define __SIZE_TYPEDEF__ int          /* can you believe this!! */
  82. #  define __PTRDIFF_TYPEDEF__ int       /* or this!! */
  83. #  define __WCHAR_TYPEDEF__ unsigned short /* this seems reasonable */
  84. #  define _SIZE_T __SIZE_TYPEDEF__
  85. #  define _WCHAR_T __WCHAR_TYPEDEF__
  86. #endif
  87. #endif
  88. #if __GNUC__ > 2 || __GNUC_MINOR__ >= 5 /* false for gcc < 2.5 */
  89. #define __NORETURN __attribute__ ((noreturn))
  90. #define __EXITING void
  91. #else
  92. #define __EXITING volatile void
  93. #endif
  94. #define __VA_LIST__ void *
  95. #ifndef __NO_INLINE__
  96. # define __GNUC_INLINE__
  97. #endif
  98. #endif
  99.  
  100. #ifdef __LATTICE__
  101. #define __SIZE_TYPEDEF__ unsigned long
  102. #define __PTRDIFF_TYPEDEF__ long
  103. #define __WCHAR_TYPEDEF__ char
  104. #define __EXITING void
  105. #define __CDECL __stdargs
  106. #ifdef _SHORTINT
  107. # define __MSHORT__
  108. #endif
  109. #ifdef _UNSIGNEDCHAR
  110. # define __CHAR_UNSIGNED__
  111. #endif
  112. #endif
  113.  
  114. #ifdef __C68__
  115. #define __SIZE_TYPEDEF__ unsigned long
  116. #define __PTRDIFF_TYPEDEF__ long
  117. #define __WCHAR_TYPEDEF__ char
  118. #define __EXITING void
  119. #endif
  120.  
  121. #ifdef __SOZOBON__
  122. /*
  123.  * Temporary hacks to overcome HSC 1.33i's short symbol names.  As of 2.01i,
  124.  * this restriction is removed, but can be reinstated for compatibility
  125.  * via the -8 compiler flag.  -- sb 5/26/93
  126.  */
  127. #if !defined(__SOZOBONX__) && \
  128.     (__SOZOBON__ < 0x201u || !defined(__HSC_LONGNAMES__))
  129. #  define _mallocChunkSize _sc_mCS
  130. #  define _malloczero _sc_mz
  131. #  define _console_read_byte _sc_crb
  132. #  define _console_write_byte _sc_cwb
  133. #endif
  134.  
  135. #define __NULL (0L)
  136. #if !defined(__SOZOBONX__) && (__SOZOBON__ < 0x122u)
  137.    /* previous versions didn't grok (void *) */
  138. #  define void char
  139. #endif
  140. #define __SIZE_TYPEDEF__ unsigned int
  141. #define __PTRDIFF_TYPEDEF__ long
  142. #define __WCHAR_TYPEDEF__ char
  143. #define __EXITING void
  144. #if !defined(__SOZOBONX__) && (__SOZOBON__ < 0x201u)
  145.    /* 2.01 now #define's this */ 
  146. #  define __MSHORT__
  147. #endif
  148. #if (defined(__HSC__) && __HSC__ >= 0x201u) || defined(__FLUFF__)
  149. #  define __GROK_CONST__
  150. #endif
  151. #endif /* __SOZOBON__ */
  152.  
  153. #ifdef __TURBOC__
  154. #ifndef __STDC__
  155. #  define __STDC__ 1
  156. #endif
  157. #define __SIZE_TYPEDEF__ unsigned long
  158. #define __PTRDIFF_TYPEDEF__ long
  159. #define __WCHAR_TYPEDEF__ char
  160. #define __EXITING void
  161. #define __MSHORT__
  162. #define __VA_LIST__ void *
  163. #define __CDECL cdecl
  164. /* As long as we haven't ported gemlib to Pure C and hence have to use
  165.  * Turbo's/Pure's GEM library, define the next:
  166.  */
  167. #define __TCC_GEMLIB__
  168. #endif /* __TURBOC__ */
  169.  
  170. #if defined(__hpux) && (!defined(__GNUC__))
  171. #define __SIZE_TYPEDEF__ unsigned int
  172. #define __PTRDIFF_TYPEDEF__ int
  173. #define __WCHAR_TYPEDEF__ unsigned int
  174. #define __EXITING void
  175. #endif
  176.  
  177. /* some default declarations */
  178. /* if your compiler needs something
  179.  * different, define it above
  180.  */
  181. #ifndef __VA_LIST__
  182. #define __VA_LIST__ char *
  183. #endif
  184.  
  185. #ifndef __CDECL
  186. #define __CDECL
  187. #endif
  188.  
  189. #ifndef __NORETURN
  190. #define __NORETURN
  191. #endif
  192.  
  193. #ifndef __NULL
  194. #  ifdef __MSHORT__
  195. #    define __NULL ((void *)0)
  196. #  else
  197.      /* avoid complaints about misuse of NULL :-) */
  198. #    define __NULL (0)
  199. #  endif
  200. #endif
  201.  
  202. #ifdef __cplusplus
  203. # define __EXTERN
  204. # define __PROTO(x) x
  205. #else
  206. # ifdef __STDC__
  207. #  ifndef __NO_PROTO__
  208. #    define __PROTO(x) x
  209. #  endif
  210. #  define __EXTERN
  211. # else
  212. #  define __EXTERN extern
  213. /*
  214.  * fudge non-ANSI compilers to be like ANSI
  215.  */    
  216. #  ifndef __GROK_CONST__
  217. #   define const
  218. #   define volatile
  219. #  endif
  220.  
  221. #  ifdef __NEED_VOID__
  222. typedef char void;    /* so that (void *) is the same as (char *) */
  223.     /* also lets us know that foo() {...} and void foo() {...} are
  224.        different */
  225. #  endif
  226. # endif /* __STDC__ */
  227. #endif /* __cplusplus */
  228.  
  229. #ifndef __PROTO
  230. #define __PROTO(x) ()
  231. #endif
  232.  
  233. /* macros for POSIX support */
  234. #ifndef __hpux
  235. #define _UID_T unsigned short
  236. #define _GID_T unsigned short
  237. #define _PID_T int
  238. #endif
  239.  
  240. /* used in limits.h, stdio.h */
  241. #define    _NFILE        (32)        /* maximum number of open streams */
  242.  
  243. #endif /* _COMPILER_H */
  244.