home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / tvos200.zip / CPL / COMPILER.H < prev    next >
C/C++ Source or Header  |  1995-04-25  |  5KB  |  208 lines

  1. /*
  2.  *    compiler.h: Shared compiler includes for the appropriate OS & compiler.
  3.  *    =======================================================================
  4.  *
  5.  *    $Header: z:/apl/compiler.h_V 1.6 93/05/17 12:57:54 JAL Exp $
  6.  *
  7.  *    Revision log:
  8.  *    -------------
  9.  *    $Log:    compiler.h_V $
  10.  *    Revision 1.6  93/05/17    12:57:54  JAL
  11.  *    Added the Borland C++/2 1.0 32-bits compiler.
  12.  *
  13.  *    Revision 1.5  92/08/24    14:36:09  JAL
  14.  *    Changed heavily to support the 32-bits OS/2 compiler. Also changed the
  15.  *    support for more'n one operating system.
  16.  *
  17.  *    Revision 1.4  92/06/11    09:54:11  JAL
  18.  *    Added defines for FOPEN mode (FOPEN_xx) to support 32-bits compiler.
  19.  *
  20.  *    Revision 1.3  92/03/11    15:04:25  JAL
  21.  *    Again: added #defines for models, but now with names starting with
  22.  *    M_ to prevent trouble with the compiler's header files.
  23.  *
  24.  *    Revision 1.2  92/03/11    14:59:12  JAL
  25.  *    Added #defines for model keywords (far, near, cdecl etc).
  26.  *
  27.  *    Revision 1.1  91/10/21    14:36:53  JAL
  28.  *    Initial revision
  29.  *
  30.  *
  31.  *
  32.  */
  33. #ifndef __cpl_compiler_h
  34. #define __cpl_compiler_h
  35.  
  36.  
  37. #if defined(__ICC__)
  38. /****************************************************************************/
  39. /*                                                                            */
  40. /*    IBM C Set/2 compiler (32-bits).                                         */
  41. /*                                                                            */
  42. /****************************************************************************/
  43.  
  44. # if !defined(__32BITS__)
  45. #    define __32BITS__        1
  46. # endif
  47.  
  48. #define M_FAR
  49. #define M_NEAR
  50. #define M_HUGE
  51. #define M_CDECL
  52. #define M_PASCAL
  53. #define M_REGCALL
  54.  
  55. #define FOPEN_RT    "r"
  56. #define FOPEN_RB    "rb"
  57. #define FOPEN_WT    "w"
  58. #define FOPEN_WB    "wb"
  59.  
  60. #define VER_COMPILER    "IBM C Set++"
  61.  
  62. #include    <cpl/iccstub.h>         // Turbo C to CSET/2 file
  63.  
  64. #define CPL_DOWNCAST(type,ptr)    ( (type) (ptr) )
  65.  
  66.  
  67. #elif defined(__BORLANDC__) && defined(__MSDOS__)
  68. /****************************************************************************/
  69. /*                                                                            */
  70. /*    Borland C++ 3.1 MS/DOS header files & compiler dependent stuff...        */
  71. /*                                                                            */
  72. /****************************************************************************/
  73. #define M_FAR        far
  74. #define M_NEAR        near
  75. #define M_HUGE        huge
  76. #define M_CDECL     cdecl
  77. #define M_PASCAL    pascal
  78. #define M_REGCALL
  79.  
  80. #define FOPEN_RT    "rt"
  81. #define FOPEN_RB    "rb"
  82. #define FOPEN_WT    "wt"
  83. #define FOPEN_WB    "wb"
  84.  
  85. #define VER_COMPILER    "BC++ 3.1"
  86.  
  87. #define CPL_DOWNCAST(type,ptr)    ( (type) (ptr) )
  88.  
  89. #include    <cpl/tcstub.h>
  90.  
  91. #elif defined(__TURBOC__) && defined(__OS2__)
  92. /****************************************************************************/
  93. /*                                                                            */
  94. /*    Borland C++/2 for OS/2... 32-bits...                                    */
  95. /*                                                                            */
  96. /****************************************************************************/
  97. # if !defined(__32BITS__)
  98. #    define __32BITS__        1
  99. # endif
  100.  
  101. #define M_FAR
  102. #define M_NEAR
  103. #define M_HUGE
  104. #define M_CDECL
  105. #define M_PASCAL
  106. #define M_REGCALL
  107.  
  108. #define FOPEN_RT    "rt"
  109. #define FOPEN_RB    "rb"
  110. #define FOPEN_WT    "wt"
  111. #define FOPEN_WB    "wb"
  112.  
  113. #define VER_COMPILER    "BC++/2 1.0"
  114.  
  115. #define CPL_DOWNCAST(type,ptr)    dynamic_cast<type>(ptr)
  116.  
  117.  
  118. #include    <cpl/b2stub.h>
  119.  
  120.  
  121. #elif defined(__GNUC__) && defined(__OS2__)
  122. /****************************************************************************/
  123. /*                                                                            */
  124. /*    EMX 0.8f GNU CC 2.3.3 for Os/2.                                         */
  125. /*                                                                            */
  126. /****************************************************************************/
  127. # if !defined(__32BITS__)
  128. #    define __32BITS__    1
  129. # endif
  130.  
  131. #define M_FAR
  132. #define M_NEAR
  133. #define M_HUGE
  134. #define M_CDECL
  135. #define M_PASCAL
  136. #define M_REGCALL
  137.  
  138. #define FOPEN_RT    "rt"
  139. #define FOPEN_RB    "rb"
  140. #define FOPEN_WT    "wt"
  141. #define FOPEN_WB    "wb"
  142.  
  143. #define VER_COMPILER    "Gnu 2.3.3"
  144.  
  145. #define CPL_DOWNCAST(type,ptr)    ( (type) (ptr) )
  146.  
  147. // #include    <cpl/b2stub.h>
  148.  
  149. /****************************************************************************/
  150. /*                                                                            */
  151. /*    CODING: WATCOM 10.0a compiler for DOS, OS/2, Windows and the like        */
  152. /*                                                                            */
  153. /****************************************************************************/
  154. #elif defined(__WATCOMC__)
  155. # if defined(__OS2__)                    // OS/2 target selected?
  156. #  if defined(__FLAT__)                 // Is 32-bits OS/2?
  157. #    if !defined(__32BITS__)
  158. #     define __32BITS__    1
  159. #    endif // 32BITS
  160.  
  161. #    define M_FAR
  162. #    define M_NEAR
  163. #    define M_HUGE
  164. #    define M_CDECL
  165. #    define M_PASCAL
  166. #    define M_REGCALL
  167.  
  168. #  endif //__FLAT__
  169.  
  170. #  include    <cpl/watstub.h>
  171. # endif // __OS2__
  172.  
  173.  
  174. #define FOPEN_RT    "rt"
  175. #define FOPEN_RB    "rb"
  176. #define FOPEN_WT    "wt"
  177. #define FOPEN_WB    "wb"
  178.  
  179. #define VER_COMPILER    "WatCOM 10.0a"
  180.  
  181. #define CPL_DOWNCAST(type,ptr)    ( (type) (ptr) )
  182.  
  183.  
  184.  
  185. #else
  186. #error     "Undefined COMPILER"
  187. #endif
  188.  
  189. #endif
  190.  
  191.  
  192.  
  193. #ifdef    __OS2__
  194. # ifdef __32BITS__
  195. #    define    VER_OS        "OS/2-32"
  196. # else
  197. #    define    VER_OS        "OS/2-16"
  198. # endif
  199. #elif defined(__MSDOS__)
  200. #    define    VER_OS        "MS/DOS"
  201. #elif defined(__NT__)
  202. #    define    VER_OS        "WinNT"
  203. #else
  204. #    error    "Compiling for UNKNOWN operating system (must be OS/2 or MS/DOS)"
  205. #endif
  206.  
  207.  
  208.