home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c221 / 6.ddi / MWHC.006 / V0 < prev    next >
Encoding:
Text File  |  1992-06-08  |  10.7 KB  |  400 lines

  1. #ifndef __RWCOMPILER_H__
  2. #define __RWCOMPILER_H__
  3. pragma push_align_members(64);
  4.  
  5. /*
  6.  * Compiler and system related foibles and directives
  7.  *
  8.  * $Header:   E:/vcs/rw/compiler.h_v   1.10   24 Mar 1992 19:43:08   KEFFER  $
  9.  *
  10.  ****************************************************************************
  11.  *
  12.  * Rogue Wave 
  13.  * P.O. Box 2328
  14.  * Corvallis, OR 97339
  15.  * Voice: (503) 754-3010    FAX: (503) 757-6650
  16.  *
  17.  * Copyright (C) 1989, 1990, 1991. This software is subject to copyright 
  18.  * protection under the laws of the United States and other countries.
  19.  *
  20.  ***************************************************************************
  21.  *
  22.  * This file depends on a manifest constant having been defined
  23.  * for your compiler.  Most compilers have one built in.  
  24.  * For others, you will have to supply one by using a -D flag:
  25.  *
  26.  *   AT&T Version 1.2:            -D__ATT1__
  27.  *   AT&T Version 2.X:            -D__ATT2__
  28.  *   AT&T Version 3.X:            -D__ATT3__
  29.  *   Glockenspiel:            -D__GLOCK__
  30.  *   Oregon (early versions only):    -D__OREGON__
  31.  *
  32.  */
  33.  
  34. /*********************************************************************
  35.  
  36.         U S E R   T U N A B L E   S E C T I O N 
  37.  
  38.  *********************************************************************/
  39.  
  40. /****
  41.  ****  This section has various parameters that you might 
  42.  ****  have to set depending on your compiler and operating system.
  43.  ****/
  44.  
  45. /*
  46.  * Uncomment the following if your "C" (not C++) compiler understands 
  47.  * K&R style prototypes only.  The most common situation is Unix machines
  48.  * using non-ANSI "C" compilers.
  49.  */
  50.  
  51. /* #define KR_ONLY 1 */
  52.  
  53.  
  54. /*
  55.  * Uncomment the following if your compiler does not have ANSI compliant
  56.  * header files.  In particular, you will have to do this if the prototype
  57.  * for function memcpy() is found in <memory.h> on your machine, rather
  58.  * than <string.h> (which is required by ANSI).
  59.  */
  60.  
  61. /* #define NON_ANSI_HEADERS 1 */
  62.  
  63.  
  64.  
  65. /*
  66.  * You may have to uncomment one of the following.  Most modern
  67.  * "merged" versions of Unix are not very fussy about System V versus 
  68.  * Berkeley style functions and so you may not have to do anything.
  69.  */
  70.  
  71. /* #define SYSV 1 */        /* For System V Unix */
  72. /* #define BSD 1 */        /* For Berkeley Unix */
  73. /* #define __MSDOS__ 1 */    /* For MS-DOS (You will probably have to do nothing --- most compilers already define this) */
  74.  
  75.  
  76. /*
  77.  * Uncomment the following if your compiler has trouble with
  78.  * base class access adjustments using the "::baseFunctionName;" 
  79.  * construct (early versions of cfront ca. Summer '89):
  80.  */
  81.  
  82. /* #define NO_ACCESS_ADJUSTMENT 1 */
  83.  
  84.  
  85. /*
  86.  * Uncomment the following if your compiler is using Microsoft C
  87.  * as a backend (e.g., Glockenspiel under MS-DOS).
  88.  */
  89.  
  90. /* #define MSC_BACKEND 1 */
  91.  
  92.  
  93. /*
  94.  * Uncomment the following if your compiler is V2.1 compiliant.
  95.  * For most compilers, it is not necessary to do anything --- this can be
  96.  * auto-detected.
  97.  */
  98.  
  99. /* #define CPPV21  1 */
  100.  
  101.  
  102.  
  103. /*
  104.  * Uncomment the following if your compiler supports inlined 80x86 assembly.
  105.  * For most compilers it is not necessary to do anything --- this can be
  106.  * auto-detected.
  107.  */
  108.  
  109. /* #define INLINE86_ASSEMBLY 1 */
  110.  
  111. /*************************************************************************
  112. **************************************************************************
  113. **                                    **
  114. **        From here on, it's pretty much boilerplate        **
  115. **        and rarely requires any tuning.                **
  116. **                                    **
  117. **************************************************************************
  118. **************************************************************************/
  119.  
  120.  
  121. /************************ Cfront derivatives ******************************/
  122.  
  123. /* Any of these defines a cfront style compiler: */
  124. #if defined(__ATT1__) || defined(__ATT2__) || defined(__ATT3__)
  125.  
  126. #  define __ATT__ 1
  127.  
  128. #  if defined(__ATT3__)
  129. #    define HAS_TEMPLATES 1
  130. #    define GROKS_TEMPLATE_TYPEDEF 1
  131. #  endif
  132.  
  133. #endif
  134.  
  135. /****************** Various Glockenspiel foibles. ***********************/
  136.  
  137. #if defined(__GLOCK__)
  138.  
  139. #  if !defined(__ATT__)
  140.      /* If we haven't been told differently,
  141.         assume Glock folks have a V2.X cfront compiler */
  142. #    define __ATT2__ 1
  143. #    define __ATT__ 1
  144. #  endif
  145.  
  146.   /*
  147.    * We assume that if the Glock folks are running under MS-DOS,
  148.    * then they're using Microsoft C as the backend:
  149.    */
  150. #  if defined(__MSDOS__) && !defined(MSC_BACKEND)
  151. #    define MSC_BACKEND 1
  152. #  endif
  153.  
  154.    /* Glock has bug in base class access adjustments: */
  155. #  ifndef NO_ACCESS_ADJUSTMENT
  156. #    define NO_ACCESS_ADJUSTMENT 1
  157. #  endif
  158.  
  159.    /* Glock emits "const structs", then attempts to assign to them: */
  160. #  define CONST_EMIT_BUG 1
  161.  
  162.    /*
  163.     * Glockenspiel was too lazy to provide type-safe linkage include
  164.     * files, preferring to use the backend C compiler include files.
  165.     * These require a "C" wrapper:
  166.     */
  167. #  ifdef __cplusplus
  168. #    define STARTWRAP    extern "C" {
  169. #    define ENDWRAP    }
  170. #  endif
  171.  
  172. #else    /* Not Glock */
  173.  
  174. #  define STARTWRAP
  175. #  define ENDWRAP
  176.  
  177. #endif
  178.  
  179. /********************** Various Zortech foibles **************************/
  180.  
  181. #if defined(__ZTC__)
  182.  
  183.    /* Define __MSDOS__ for Zortech. */
  184. #  if !defined(__MSDOS__)
  185. #    define __MSDOS__ 1
  186. #  endif
  187.  
  188.    /* Zortech has a type conversion bug: */
  189. #  define ZTC_TYPE_CONVERSION_BUG 1
  190.  
  191.    /* Zortech takes "constness" too literally: */
  192. #  define PARANOID_CONST_BUG 1
  193.  
  194. #endif
  195.  
  196. /********************** Borland's Turbo C++ **************************/
  197.  
  198. #if defined(__TURBOC__)
  199.  
  200.    /*
  201.     * Turbo and Borland won't inline code that contains
  202.     * "while" or "for" loops or that generates temporaries
  203.     * requiring destructors:
  204.     */
  205. #  define NO_INLINED_WHILES        1
  206. #  define NO_INLINED_FORS        1
  207. #  define NO_INLINED_TEMP_DESTRUCTORS    1
  208.  
  209.    /* The Borland compilers left out this definition: */
  210. #  define name2 _Paste2
  211.  
  212.    /* Turbo C++ V1.00 forgets the segment address when passing
  213.       a class as a far reference if the class has not been defined. */
  214. #  if __TURBOC__ <= 0x0295
  215. #    define UNDEFINED_REFERENCE_BUG    1
  216. #  endif
  217.  
  218. #  if __TURBOC__ >=0x200
  219.  
  220.      /*
  221.       * Borland C++ and later Turbo C++ have inlined assembly.  So do
  222.       * earlier Turbo C++ *professional* versions.
  223.       * In this case, you should uncomment the
  224.       * #define INLINE86_ASSEMBLY directive near the top of this file.
  225.       * No harm done if you don't: things will just be slower.
  226.       */
  227. #    define INLINE86_ASSEMBLY 1
  228.  
  229.      /*
  230.       * Borland C++ Version 2.0:
  231.       * Calls destructor of temporaries in inlines of inlines incorrectly.
  232.       * Increments pointer to structs incorrectly.
  233.       * Passes the wrong size to an overloaded delete
  234.       */
  235. #    if __TURBOC__ < 0x300
  236. #      define BCC_INLINE_DESTRUCTOR_BUG 1
  237. #      define BCC_STRUCT_POINTER_BUG    1
  238. #      define TCC_DELETE_SIZE_BUG    1
  239. #    endif    /* end Borland C++ V2.0 */
  240.  
  241.      /*
  242.       * Borland C++ V3.0 and Turbo C++ V3.0
  243.       * Uses V2.1 style scoping and templates.
  244.       */
  245. #    if __TURBOC__ >= 0x400
  246. #      if !defined(CPPV21)
  247. #        define CPPV21 1
  248. #      endif
  249. #      define HAS_TEMPLATES 1
  250. #    endif    /* end Borland C++ V3.0 */
  251.  
  252. #  endif    /* end post Turbo C++ V1.01 section */
  253.  
  254. #endif    /* __TURBOC__ */
  255.  
  256. /************************ Microsoft C/C++ *****************************/
  257.  
  258. #if defined(_MSC_VER) 
  259. #  if !defined(MSC_BACKEND)
  260. #    define MSC_BACKEND 1
  261. #  endif
  262. #  if !defined(CPPV21)
  263. #    define CPPV21 1
  264. #  endif
  265. #endif
  266.  
  267. /********************** Oregon Software C++ ***************************/
  268.  
  269. #if defined(_OREGON_) && !defined(__OREGON__)
  270.    /* Early version of Oregon use single underscore: */
  271. #  define __OREGON__ _OREGON_
  272. #endif
  273.  
  274. /************************* Saber C++ **********************************/
  275.  
  276. #if defined(__SABER_CXX__) && !defined(NO_ACCESS_ADJUSTMENT)
  277. #  define NO_ACCESS_ADJUSTMENT 1
  278. #endif
  279.  
  280. /********************** MetaWare High C/C++ *********************************/
  281.  
  282. #ifdef __HIGHC__
  283. #  ifndef CPPV21
  284. #    define CPPV21 1
  285. #  endif
  286. #endif
  287.  
  288. /********************** Miscellaneous *********************************/
  289.  
  290. #if defined(MSDOS) && !defined(__MSDOS__)
  291. #  define __MSDOS__ 1
  292. #endif
  293.  
  294. #if defined(sun) && !defined(BSD)
  295. #  define BSD 1
  296. #endif
  297.  
  298. #if (defined(SYSV) || defined(BSD)) && !defined(unix)
  299. #  define unix 1
  300. #endif
  301.  
  302. #ifdef CPPV21
  303. #  define SCOPE_NESTED_ENUMS 1
  304. #  define RWSCOPE(a) a::
  305. #else
  306. #  define RWSCOPE(a)
  307. #endif
  308.  
  309. /* No Pi for these compilers: */
  310. #if defined(MSC_BACKEND) || defined(__OREGON__)
  311. #  ifndef M_PI
  312. #    define M_PI 3.14159265358979323846
  313. #  endif
  314. #endif
  315.  
  316. /*
  317.  * These compilers allow a reference to be recast to something 
  318.  * else.
  319.  */
  320. #if defined(__TURBOC__) || defined(__ZTC__)
  321. #  define HAS_CAST_TO_REFERENCE 1
  322. #endif
  323.  
  324. #ifndef NON_ANSI_HEADERS
  325.    /* Thanks to Mike Lueke of TauMetric for this elegant test... */
  326. #  include <limits.h>
  327. #  if (CHAR_MIN==0) && !(__HIGHC__)
  328.       /* A formal argument of type "char" will exactly match
  329.          a formal argument of type "unsigned char". */
  330. #    define CHAR_MATCHES_UCHAR 1
  331. #  endif
  332. #endif
  333.  
  334. /*
  335.  * All compilers except Zortech allow overloading on the "const" modifier.
  336.  * Zortech V3.0 does, but it still doesn't work for the most common case: operator().
  337.  */
  338. #ifndef __ZTC__
  339. #  define CONST_OVERLOADS 1
  340. #endif
  341.  
  342. /*
  343.  * All compilers except early Zortech have iostreams:
  344.  */
  345. #if !defined(__ZTC__) || (__ZTC__ >= 0x300)
  346. #  define HAS_IOSTREAMS    1
  347. #endif
  348.  
  349. /*
  350.  * All known compilers have old-style streams:
  351.  */
  352. #define HAS_STREAMS    1
  353.  
  354. /*
  355.  * Most (but not all) non-unix systems convert new line to carriage
  356.  * return / line feed on output:
  357.  */
  358. #if !defined(unix)
  359. #  define CRLF_CONVENTION 1
  360. #endif
  361.  
  362. /* These compilers have useful speedup functions: */
  363. #if defined(__TURBOC__) || defined(__ZTC__) || defined(MSC_BACKEND)
  364. #  define HAS_STRICMP   1    /* stricmp(): case-insensitive search */
  365. #  define HAS_STRNICMP    1    /* strnicmp(): case-insensitive limited search */
  366. #  define HAS_MEMMOVE    1    /* memmove(): potentially overlapping copy */
  367. #endif
  368.  
  369. /*
  370.  * $Log:   E:/vcs/rw/compiler.h_v  $
  371.  * 
  372.  *    Rev 1.10   24 Mar 1992 19:43:08   KEFFER
  373.  * Ported to MetaWare High C.
  374.  * 
  375.  *    Rev 1.9   18 Mar 1992 11:27:38   KEFFER
  376.  * Ported to Turbo C++ V3.0
  377.  * 
  378.  *    Rev 1.8   17 Mar 1992 11:36:00   KEFFER
  379.  * MS-DOS hacks now done in defs.h.
  380.  * 
  381.  *    Rev 1.7   21 Feb 1992 12:30:08   KEFFER
  382.  * Added support for Microsoft C/C++ V7.0
  383.  * 
  384.  *    Rev 1.6   13 Nov 1991 11:08:48   keffer
  385.  * DLL directives now put in a separate header file.
  386.  * 
  387.  *    Rev 1.5   17 Oct 1991 09:13:00   keffer
  388.  * Changed include path to <rw/xxx.h>
  389.  * 
  390.  *    Rev 1.3   24 Sep 1991 18:57:24   keffer
  391.  * Updated for Zortech V3.0
  392.  * 
  393.  *    Rev 1.2   02 Sep 1991 11:54:42   keffer
  394.  * Added INLINE86_ASSEMBLY directive
  395.  * 
  396.  */
  397.  
  398. pragma pop_align_members();
  399. #endif /* __RWCOMPILER_H__ */
  400.