home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 13 / AACD13.ISO / AACD / Programming / MCC_NListtree / Developer / C / Examples / compiler.h next >
C/C++ Source or Header  |  2000-02-04  |  2KB  |  152 lines

  1. /*
  2. **    Usefull compiler stuff to be compatible with any compiler
  3. **    on the market.
  4. **
  5. */
  6.  
  7. #ifndef _COMPILER_H
  8. #define _COMPILER_H
  9.  
  10. /*
  11. **    Ignore this switches of SAS/Storm.
  12. */
  13. #ifdef __MAXON__
  14.  
  15. #    define __aligned
  16. #    define __asm
  17. #    define __regargs
  18. #    define __saveds
  19. #    define __stdargs
  20.  
  21. #endif /* __MAXON__ */
  22.  
  23.  
  24. /*
  25. **    Ignore this switches of SAS/Storm.
  26. */
  27. #ifdef __GNUC__
  28.  
  29. #    define __d0
  30. #    define __d1
  31. #    define __d2
  32. #    define __d3
  33. #    define __d4
  34. #    define __d5
  35. #    define __d6
  36. #    define __d7
  37. #    define __a0
  38. #    define __a1
  39. #    define __a2
  40. #    define __a3
  41. #    define __a4
  42. #    define __a5
  43. #    define __a6
  44. #    define __a7
  45.  
  46. #endif /* __GNUC__ */
  47.  
  48.  
  49.  
  50.  
  51. #ifdef __SASC
  52.  
  53. #    define REG( r )                register __ ## r
  54. #    define GNUCREG( r )
  55. #    define SAVEDS                __saveds
  56. #    define ASM                    __asm
  57. #    define REGARGS                __regargs
  58. #    define STDARGS                __stdargs
  59. #    define STACKARGS            __stdargs
  60. #    define ALIGNED                __aligned
  61. #    define FAR                    __far
  62. #    define INLINE                __inline
  63.  
  64. #else
  65. #    ifdef __MAXON__
  66.  
  67. #        define REG( r )            register __ ## r
  68. #        define GNUCREG( r )
  69. #        define SAVEDS
  70. #        define ASM
  71. #        define REGARGS
  72. #        define STDARGS
  73. #        define STACKARGS
  74. #        define ALIGNED
  75. #        define FAR
  76. #        define INLINE
  77.  
  78. #    else
  79. #    ifdef __STORM__
  80.  
  81. #        define REG( r )            register __ ## r
  82. #        define GNUCREG( r )
  83. #        define SAVEDS            __saveds
  84. #        define ASM
  85. #        define REGARGS
  86. #        define STDARGS
  87. #        define STACKARGS
  88. #        define ALIGNED
  89. #        define FAR                __far
  90. #        define INLINE
  91. #        define NO_PRAGMAS
  92. #        define USE_GLUE
  93.  
  94. #    else
  95. #    ifdef __GNUC__
  96.  
  97. #        define REG( r )
  98. #        define GNUCREG( r )        __asm( #r )
  99. #        define SAVEDS            __saveds
  100. #        define ASM
  101. #        define REGARGS            __regargs
  102. #        define STDARGS            __stdargs
  103. #        define SACKARGS            __stdargs
  104. #        define ALIGNED            __aligned
  105. #        define FAR                __far
  106. #        define INLINE
  107. #        define NO_PRAGMAS
  108. #        define USE_GLUE
  109.  
  110. #    else /* Any other compiler. */
  111.  
  112. #        define REG( r )
  113. #        define GNUCREG( r )
  114. #        define SAVEDS
  115. #        define ASM
  116. #        define REGARGS
  117. #        define STDARGS
  118. #        define SACKARGS
  119. #        define ALIGNED
  120. #        define FAR
  121. #        define INLINE
  122.  
  123. #    endif /* __GNUC__ */
  124. #    endif /* __STORM__ */
  125. #    endif /* __MAXON__ */
  126.  
  127. #endif /* __SASC */
  128.  
  129.  
  130.  
  131. /*
  132. **    Use glue code??? I.e. no direct assembly interface routines?
  133. */
  134. #ifdef USE_GLUE
  135.  
  136. #    ifdef ASM
  137. #        undef ASM
  138. #    endif /* ASM */
  139.  
  140. #    ifdef REG
  141. #        undef REG
  142. #    endif /* REG */
  143.  
  144. #    define ASM
  145. #    define REG( x )
  146.  
  147. #endif /* USE_GLUE */
  148.  
  149.  
  150. #endif /* _COMPILER_H */
  151.  
  152.