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