home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / cslio205.zip / INCLUDE / CSCMPLR.H < prev    next >
C/C++ Source or Header  |  1997-01-21  |  6KB  |  273 lines

  1. /**********************************************************************
  2.  
  3.                        CSA Library, Free Evaluation Version 2.0.5 
  4.                                        Release: January 22th 1997 
  5.  
  6.       Defining some compiler dependend variables,
  7.       indicating compiler, memory model, platform etc..
  8.  
  9.  
  10.                                            Copyright(c) 1994-1997 
  11.                                                           ComBits 
  12.                                                   The Netherlands 
  13. ***********************************************************************
  14.  
  15.  
  16.  
  17.       _CP_001      :Borland C++.
  18.       _CP_001a     :Borland C++ for Dos
  19.       _CP_001b     :Borland C++ for OS/2
  20.       _CP_001c     :Borland C++ for Windows 16 bit.
  21.       _CP_001d     :Borland C++ for Windows 32 bit.
  22.  
  23.       _CP_002      :Microsoft Visual C++.
  24.       _CP_002a     :Microsoft Visual C++ 16 bit Windows.
  25.       _CP_002b     :Microsoft Visual C++ 32 bit Windows.
  26.       _CP_002c     :Microsoft Visual C++ 16 bit Dos.
  27.  
  28.       _CP_003      :GNU C++.
  29.       _CP_003a     :GNU C++ for Linux.
  30.  
  31.       _CP_004      :Watcom C++ 10.5
  32.       _CP_004a     :Watcom C++ 10.5 for DOS
  33.       _CP_004b     :Watcom C++ 10.5 for Windows 16 bit
  34.       _CP_004c     :Watcom C++ 10.5 for Windows 32 bit
  35.       _CP_004d     :Watcom C++ 10.5 for OS/2
  36.  
  37.  
  38.  
  39.       _CP_010      :Compiling for MS-Dos.
  40.       _CP_020      :Compiling for MS-Windows.
  41.       _CP_021      :Compiling for MS-Windows 16 bit.
  42.       _CP_022      :Compiling for MS-Windows 32 bit.
  43.       _CP_030      :Compiling for UNIX.
  44.       _CP_031      :Compiling for Linux.
  45.       _CP_040      :Compiling for OS2
  46.  
  47.               NOTE :The _CP_020 & _CP_022 flags are also set for
  48.                     NT console applications.
  49.  
  50.       _CP_100      :Flat Memory Model.
  51.  
  52.  
  53.  
  54. ************************************************************************/
  55.  
  56.  
  57.  
  58. #ifndef __CSCMPLR_H
  59. #define __CSCMPLR_H
  60.  
  61.  
  62.  
  63. ////////////////////////////////////////////////////////////////////////
  64. ///////////////////////// Figuring out the compiler type. //////////////
  65. ////////////////////////////////////////////////////////////////////////
  66.  
  67.  
  68. #ifdef  __BORLANDC__
  69. ////////////////////////// Borland C++ ///////////////////////////////////
  70.    #define  _CP_001
  71.    #define  KnownCompiler
  72.  
  73.  
  74.  #ifdef __OS2__
  75.    #define _CP_001b
  76.    #define _CP_040
  77.    #define _CP_100
  78.    #define KnownPlatform
  79.  #endif
  80.  
  81.  
  82.  #if (defined( __MSDOS__) && !defined(_Windows))
  83.    #define _CP_001a
  84.    #define _CP_010
  85.    #define KnownPlatform
  86.  #endif
  87.  
  88.  #if (defined(_Windows) && !defined(__WIN32__))
  89.    #define _CP_001c
  90.    #define _CP_020
  91.    #define _CP_021
  92.    #define KnownPlatform
  93.  #endif
  94.  
  95.  #if defined(__WIN32__)
  96.    #define _CP_001d
  97.    #define _CP_020
  98.    #define _CP_022
  99.    #define _CP_100
  100.    #define KnownPlatform
  101.  #endif
  102.  
  103.  
  104.  
  105.  
  106. #endif
  107.  
  108.  
  109.  
  110.  
  111. #ifdef _MSC_VER
  112. ////////////////////////// Microssoft C++ ////////////////////////////////
  113.    #define  _CP_002
  114.    #define  KnownCompiler
  115.  
  116. #if defined(_WIN32)
  117.    // 32 bits
  118.    #define  _CP_002b
  119.    #define  _CP_020
  120.    #define  _CP_022
  121.    #define  _CP_100
  122.    #define KnownPlatform
  123. #endif
  124.  
  125. #if defined(_WINDOWS)
  126.    // 16 bits Windows
  127.    #define  _CP_002a
  128.    #define  _CP_020
  129.    #define  _CP_021
  130.    #define KnownPlatform
  131. #endif
  132.  
  133. #if (!defined(_WINDOWS) && !defined(_WIN32))
  134.    // DOS
  135.    #define  _CP_002c
  136.    #define  _CP_010
  137.    #define KnownPlatform
  138. #endif
  139.  
  140.  
  141.  
  142. #endif
  143.  
  144.  
  145.  
  146.  
  147.  
  148.  
  149.  
  150.  
  151.  
  152.  
  153. #ifdef   __GNUC__
  154. ////////////////////////// GNU C++ ///////////////////////////////////////
  155.    #define  _CP_003
  156.    #define  KnownCompiler
  157. #ifdef __linux__
  158.    #define  _CP_003a
  159.    #define  _CP_100
  160. #endif
  161.  
  162. #endif
  163.  
  164.  
  165.  
  166.  
  167.  
  168. #ifdef   __WATCOMC__
  169. ////////////////////////// WATCOM C++ /////////////////////////////////////
  170.  #define  _CP_004
  171.  #define  KnownCompiler
  172.  
  173.  #ifdef __DOS__
  174.    #define _CP_004a
  175.    #define _CP_010
  176.    #define KnownPlatform
  177.  #endif
  178.  
  179.  #ifdef __WINDOWS__
  180.    #define _CP_004b
  181.    #define _CP_020
  182.    #define _CP_021
  183.    #define KnownPlatform
  184.  #endif
  185.  
  186.  #ifdef __NT__
  187.    #define _CP_004c
  188.    #define _CP_020
  189.    #define _CP_022
  190.    #define _CP_100
  191.  
  192.    #undef  _CP_004b
  193.    #undef  _CP_021
  194.    #define KnownPlatform
  195.  #endif
  196.  
  197.  #ifdef __OS2__
  198.    #define _CP_004d
  199.    #define _CP_040
  200.    #define _CP_100
  201.    #define KnownPlatform
  202.  #endif
  203.  
  204. #endif
  205.  
  206.  
  207.  
  208.  
  209. ///////////////////////////////////////////////////////////////////////
  210. //////////////////////// Test for a 'Known Compiler '//////////////////
  211. //////////////////////////////////////////////////////////////////////
  212.  
  213.  
  214. #ifdef KnownCompiler
  215.    #undef KnownCompiler
  216. #else
  217.    #error UNKNOWN Compiler
  218. #endif
  219.  
  220.  
  221.  
  222.  
  223.  
  224. ///////////////////////////////////////////////////////////////////////
  225. //////////////////////// Test for a 'Known Platform '//////////////////
  226. //////////////////////////////////////////////////////////////////////
  227.  
  228.  
  229. #ifdef KnownPlatform
  230.    #undef KnownPlatform
  231. #else
  232.    #error UNKNOWN Platform
  233. #endif
  234.  
  235.  
  236. ///////////////////////////////////////////////////////////////////////
  237. //////////////////////// Set OS name //////////////////////////////////
  238. ///////////////////////////////////////////////////////////////////////
  239.  
  240.  
  241.  
  242.  
  243. #ifdef  _CP_010
  244. #define _CP_PLATFORM  "DOS"
  245. #endif
  246.  
  247. #ifdef  _CP_021
  248. #define _CP_PLATFORM  "Windows (16 bit)"
  249. #endif
  250.  
  251. #ifdef  _CP_022
  252. #define _CP_PLATFORM  "NT"
  253. #endif
  254.  
  255. #ifdef  _CP_031
  256. #define _CP_PLATFORM  "Linux"
  257. #endif
  258.  
  259. #ifdef  _CP_040
  260. #define _CP_PLATFORM  "OS/2"
  261. #endif
  262.  
  263.  
  264. #ifndef _CP_PLATFORM
  265. #define _CP_PLATFORM  ""
  266. #endif
  267.  
  268.  
  269.  
  270.  
  271. #endif
  272.  
  273.