home *** CD-ROM | disk | FTP | other *** search
/ PC Plus SuperCD (UK) 2000 May / PCP163A.iso / Runimage / Cbuilder4 / Include / STDCOMP.H < prev    next >
Encoding:
C/C++ Source or Header  |  1999-01-26  |  40.7 KB  |  1,421 lines

  1. #ifndef __STD_RWCOMPILER_H__
  2. #define __STD_RWCOMPILER_H__ 1
  3.  
  4. #ifndef __cplusplus
  5. #error Must use C++ for STDCOMP.H
  6. #endif
  7.  
  8. /***************************************************************************
  9.  *
  10.  * Compiler and system related foibles and directives
  11.  *
  12.  ***************************************************************************
  13.  *
  14.  * (c) Copyright 1994, 1998 Rogue Wave Software, Inc.
  15.  * ALL RIGHTS RESERVED
  16.  *
  17.  * The software and information contained herein are proprietary to, and
  18.  * comprise valuable trade secrets of, Rogue Wave Software, Inc., which
  19.  * intends to preserve as trade secrets such software and information.
  20.  * This software is furnished pursuant to a written license agreement and
  21.  * may be used, copied, transmitted, and stored only in accordance with
  22.  * the terms of such license and with the inclusion of the above copyright
  23.  * notice.  This software and information or any other copies thereof may
  24.  * not be provided or otherwise made available to any other person.
  25.  *
  26.  * Notwithstanding any other lease or license that may pertain to, or
  27.  * accompany the delivery of, this computer software and information, the
  28.  * rights of the Government regarding its use, reproduction and disclosure
  29.  * are as set forth in Section 52.227-19 of the FARS Computer
  30.  * Software-Restricted Rights clause.
  31.  * 
  32.  * Use, duplication, or disclosure by the Government is subject to
  33.  * restrictions as set forth in subparagraph (c)(1)(ii) of the Rights in
  34.  * Technical Data and Computer Software clause at DFARS 252.227-7013.
  35.  * Contractor/Manufacturer is Rogue Wave Software, Inc.,
  36.  * P.O. Box 2328, Corvallis, Oregon 97339.
  37.  *
  38.  * This computer software and information is distributed with "restricted
  39.  * rights."  Use, duplication or disclosure is subject to restrictions as
  40.  * set forth in NASA FAR SUP 18-52.227-79 (April 1985) "Commercial
  41.  * Computer Software-Restricted Rights (April 1985)."  If the Clause at
  42.  * 18-52.227-74 "Rights in Data General" is specified in the contract,
  43.  * then the "Alternate III" clause applies.
  44.  *
  45.  **************************************************************************/
  46.  
  47. /****************************************************************
  48.  ****************************************************************
  49.  *                                *
  50.  *        U S E R   T U N A B L E   S E C T I O N        *
  51.  *                                *
  52.  ****************************************************************
  53.  ****************************************************************/
  54. // Library version number
  55. //
  56. #define _RWSTD_VER 0x020100
  57. //                   AABBCC
  58. //                    | | |
  59. //                    | | +-- CC = Maintenance number
  60. //                    | +---- BB = Minor Release number
  61. //                    +------ AA = Major Release number
  62. //
  63. // Note that former version numbers were of the form: 0xAABC
  64. // i.e., they showed only one digit each for Minor and Maintenance.
  65. // e.g.  "0x0203" would be "0x020003" in the new, extended scheme.
  66.  
  67. /*
  68.  * This section has various preprocessor constants that can
  69.  * be set to reflect the properties of your compiler.  For most
  70.  * compilers (particularly, MS-DOS compilers) there is no need
  71.  * to do anything --- most settings can be autodetected.
  72.  *
  73.  * For many Unix compilers you may have to tune the settings below.
  74.  * This is most easily done by running the "config" shell script
  75.  * which will try various test programs to discover the properties
  76.  * of your compiler.
  77.  *
  78.  *       THIS IS FAR EASIER THAN SETTING THESE BY HAND!
  79.  */
  80.  
  81. /*
  82.  *                   AT&T "CFRONT" USERS
  83.  */
  84. /* 
  85.  * Most compilers have a built in "manifest constant".
  86.  * For the following compilers you must supply one by uncommenting
  87.  * an appropriate line:
  88.  *
  89.  *   AT&T cfront V2.X:       __ATT2__
  90.  *   AT&T cfront V3.0:       __ATT3__
  91.  */
  92.  
  93. /* #define __ATT2__ 1 */
  94. /* #define __ATT3__ 1 */
  95.  
  96. /**
  97.  **                     *** ALL USERS ***
  98.  **/
  99. #define _RWSTD_NOMSG    0x00
  100. #define _RWSTD_CATGETS  0x01
  101. #define _RWSTD_GETTEXT  0x02
  102. #define _RWSTD_DGETTEXT 0x03
  103.  
  104. /*
  105.  * Set _RWSTD_MESSAGE to the type of messaging facility you want:
  106.  *   _RWSTD_NOMSG     No messaging facility
  107.  *   _RWSTD_CATGETS  Use catgets()
  108.  *   _RWSTD_GETTEXT  Use gettext()
  109.  *   _RWSTD_DGETTEXT Use dgettext()
  110.  */
  111.  
  112. #define _RWSTD_MESSAGE _RWSTD_NOMSG
  113. #if !defined( __TURBOC__) && !defined(_MSC_VER) && !defined(_OS2)
  114.  
  115. /******************** OPTIONAL LIBRARY FEATURES********************/
  116. /*  turned off by default                                         */
  117.  
  118. /* Uncomment the following if you wish for bounds checking to be  
  119.  * performed for operator[] for deque and vector
  120.  */
  121.  
  122. /* #define _RWSTD_BOUNDS_CHECKING 1 */
  123.  
  124. /* Uncomment the following if you wish to use localized error messages
  125.  */
  126.  
  127. /* #define _RWSTD_LOCALIZED_ERRORS 1 */
  128. /******************** COMPILER WORD SIZES, ETC ********************/
  129.  
  130. /*
  131.  * Uncomment the following and set to the number of decimal digits
  132.  * of precision for type double.
  133.  * If you do nothing, the default will be 16.
  134.  */
  135.  
  136. /* #define _RWSTD_DEFAULT_PRECISION 16 */
  137. /*************** COMPILER QUIRKS AND LIMITATIONS ******************/
  138.  
  139. /*
  140.  * Uncomment the following if your compiler does not support
  141.  * exceptions.
  142.  */
  143.  
  144. /* #define _RWSTD_NO_EXCEPTIONS 1 */
  145.  
  146. /*
  147.  * Uncomment the following if your compiler does not support
  148.  * exceptions specifications.
  149.  */
  150.  
  151. /* #define _RWSTD_NO_EX_SPEC 1 */
  152. /*
  153.  * Uncomment the following if your compiler does not support
  154.  * throwing of exceptions from a shared library.
  155.  */
  156.  
  157. /* #define _RWSTD_NO_THROW_WITH_SHARED 1 */
  158.  
  159. /*************************** TEMPLATES **********************************/
  160.  
  161. /*
  162.  * Uncomment the following if your compiler does not instantiates only those
  163.  * functions, member functions, classes or member classes that are
  164.  * required; i.e. your compiler instantiates things that your program
  165.  * doesn't actually use.
  166.  */
  167.  
  168. /* #define _RWSTD_NO_STRICT_TEMPLATE_INSTANTIATE 1 */
  169.  
  170. /*
  171.  * Uncomment the following if your compiler does not allow an unused
  172.  * T *operator-> in a template<class T> when T is of non-class type.
  173.  */
  174.  
  175. /* #define _RWSTD_NO_NONCLASS_ARROW_RETURN 1 */
  176.  
  177. /*
  178.  * Uncomment the following if your compiler does not support the new syntax
  179.  * for functions that are templatized only on the return type, e.g.
  180.  *     template<class T> T func (void);  // Declare the function template
  181.  *     int my_int = func<int>();         // Call the function
  182.  */
  183.  
  184. /* #define _RWSTD_NO_TEMPLATE_ON_RETURN_TYPE 1 */
  185.  
  186. /*
  187.  * Uncomment the following if your compiler does template
  188.  * instantiation at compile time.
  189.  */
  190.  
  191. /* #define _RWSTD_COMPILE_INSTANTIATE 1 */
  192. /*************************** STRINGS ****************************/
  193.  
  194. /*
  195.  * Uncomment the following if your sprintf() does not
  196.  * return the size of the buffer as an int, as ANSI C requires.
  197.  */
  198.  
  199. /* #define _RWSTD_NO_ANSI_SPRINTF 1 */
  200. /*
  201.  * Uncomment the following if your compiler does not have the
  202.  * ANSI C function memmove().
  203.  */
  204.  
  205. /* #define _RWSTD_NO_MEMMOVE 1 */
  206.  
  207. /*
  208.  * Uncomment the following if your compiler's stdio.h does not define
  209.  * an fpos_t type.
  210.  */
  211.  
  212. /* #define _RWSTD_NO_FPOS_T 1 */
  213.  
  214. /*
  215.  * Uncomment the following if your compiler's stdlib.h does not provide
  216.  * an ldiv function.
  217.  */
  218.  
  219. /* #define _RWSTD_NO_LDIV 1 */
  220.  
  221. /*
  222.  * Uncomment the following if your compiler's <typeinfo> header does not
  223.  * define a bad_cast exception type.
  224.  */
  225.  
  226. /* #define _RWSTD_NO_BAD_CAST 1 */
  227.  
  228. /****************** INTERNATIONALIZATION ************************/
  229.  
  230. /*
  231.  * Uncomment the following if your compiler does not support
  232.  * wide characters strings (e.g., functions wslen(), etc.).
  233.  */
  234.  
  235. /* #define _RWSTD_NO_WSTR 1 */
  236.  
  237. /*
  238.  * Uncomment the following your compiler does not define type wint_t
  239.  * in either wchar.h or wctype.h.
  240.  */
  241.  
  242. /* #define _RWSTD_NO_WINT_TYPE 1 */
  243.  
  244. /*
  245.  * Uncomment the following if your compiler does not provide wide
  246.  * character functions swscanf and swprintf.
  247.  */
  248.  
  249. /* #define _RWSTD_NO_SWPRINTF 1 */
  250.  
  251. /*
  252.  * Uncomment the following if your compiler cannot distinguish wchar_t from
  253.  * other integer types in template argument lists.
  254.  */
  255.  
  256. /* #define _RWSTD_NO_OVERLOAD_WCHAR 1 */
  257. /*
  258.  * Uncomment the following if your compiler does not support
  259.  * the ANSI C locale facility fully, or if it does not support
  260.  * it at all (in particular, uncomment if setlocale(), strxform(),
  261.  * or strcoll() are not present or don't work).
  262.  */
  263.  
  264. /* #define _RWSTD_NO_LOCALE 1 */
  265.  
  266.  
  267. /*
  268.  * Uncomment the following if your compiler does not have
  269.  * the %C directive to strftime().
  270.  */
  271.  
  272. /* #define _RWSTD_NO_STRFTIME_CAPC 1 */
  273. /************************** TIME ********************************/
  274.  
  275. /*
  276.  * Uncomment the following if your compiler does not have global
  277.  * variables "_daylight", "_timezone", and "_tzname", or corresponding
  278.  * variables without a leading underscore (generally
  279.  * this is true only for pure Berkeley systems).
  280.  */
  281.  
  282. /* #define _RWSTD_NO_GLOBAL_TZ 1 */
  283. /*
  284.  * Uncomment the following if your system supplies a global variable
  285.  * named "daylight" instead of the nominally more correct "_daylight".
  286.  */
  287.  
  288. /* #define _RWSTD_NO_LEADING_UNDERSCORE 1 */
  289. /*
  290.  * If your system does not have global variables "daylight" and
  291.  * "timezone" (see directive immediately above) and does not have
  292.  * the Berkeley function gettimeofday() either, then uncomment
  293.  * the following:
  294.  */
  295.  
  296. /* #define _RWSTD_NO_GETTIMEOFDAY 1 */
  297. /*
  298.  * If the struct tm defined in your <time.h> has extra member data
  299.  * "tm_zone" and "tm_gmtoff" (this is true for SunOs 4.X), then you
  300.  * should uncomment the following:
  301.  */
  302.  
  303. /* #define _RWSTD_STRUCT_TM_TZ 1 */
  304. /* Uncomment the following if you have a Solaris platform that
  305.  * supports threads.  (We choose this if you have it, in
  306.  * preference to other thread packages. You may prefer a
  307.  * different package.)
  308.  */
  309.  
  310. /* #define _RWSTD_SOLARIS_THREADS 1 */
  311.  
  312. /* Uncomment the following if you have a threads package which
  313.  * meets an early Posix draft, and you don't have Solaris threads.
  314.  */
  315.  
  316. /* #define _RWSTD_POSIX_THREADS 1 */
  317.  
  318. /* As above, if you have threads which meet
  319.  * the Posix Draft 10 threads description. If you define this,
  320.  * then you must also define RW_POSIX_THREADS
  321.  */
  322.  
  323. /* #define _RWSTD_POSIX_D10_THREADS 1 */
  324.  
  325. /* Uncomment the following if pthread_mutexattr_default is
  326.  * provided by your threads package. The posix standard (draft 10)
  327.  * does not require a pthreads package to provide this value.
  328.  */
  329.  
  330. /* #define _RWSTD_MUTEXATTR_DEFAULT 1 */
  331.  
  332. /* Uncomment the following if you have no threads, or your package doesn't
  333.  * meet our expectations for header and function names.
  334.  */
  335.  
  336. /* #define _RWSTD_NO_THREADS 1 */
  337. /************************** STANDARD LIBRARY ****************************/
  338.  
  339. /*
  340.  * Uncomment the following if your compiler does not support the bool type.
  341.  * This means that bool is not a unique type.
  342.  */
  343.  
  344. /* #define _RWSTD_NO_BOOL 1 */
  345.  
  346. /*
  347.  * Uncomment the following if your compiler does not support simple
  348.  * default templates. e.g:
  349.  * template<class T = int> ...
  350.  */
  351.  
  352. /* #define _RWSTD_NO_SIMPLE_DEFAULT_TEMPLATES 1 */
  353.  
  354. /*
  355.  * Uncomment the following if your compiler does not support complex
  356.  * default templates. e.g:
  357.  * template<class T = foo<T> > ...
  358.  */
  359.  
  360. /* #define _RWSTD_NO_COMPLEX_DEFAULT_TEMPLATES 1 */
  361.  
  362. /*
  363.  * Uncomment the following if your compiler doesn't support ~T() 
  364.  * where T is a builtin.
  365.  */
  366.  
  367. /* #define _RWSTD_NO_DESTROY_BUILTIN 1 */
  368.  
  369. /*
  370.  * Uncomment the following if your compiler doesn't support ~T()
  371.  * where T is a non-builtin.
  372.  */
  373.  
  374. /* #define _RWSTD_NO_DESTROY_NONBUILTIN 1 */
  375.  
  376. /*
  377.  * If your compiler does not support complicated exceptions, such as
  378.  * throwing a domain_error exception, then uncomment the following:
  379.  */
  380.  
  381. /* #define _RWSTD_NO_COMPLICATED_EXCEPTIONS 1 */
  382.  
  383. /*
  384.  * Uncomment the following if your compiler cannot handle nested
  385.  * templates, or if you have to define the body of a class within
  386.  * the template (mostly sun compilers!)
  387.  */
  388.  
  389. /* #define _RWSTD_NO_NESTING_TEMPLATES 1 */
  390.  
  391. /*
  392.  * If your compiler does not support long double operators in iostreams, then
  393.  * uncomment the following:
  394.  */
  395.  
  396. /* #define _RWSTD_NO_STREAM_LONG_DOUBLE 1 */
  397.  
  398. /*
  399.  * Uncomment the following if your compiler does not support the
  400.  * _MUTABLE keyword
  401.  */
  402.  
  403. /* #define _RWSTD_NO_MUTABLE 1 */
  404.  
  405. /*
  406.  * If your compiler does not support namespaces, uncomment the following
  407.  */
  408.  
  409. /* #define _RWSTD_NO_NAMESPACE 1 */
  410.  
  411. /*
  412.  * Uncomment the following if your compiler does not support
  413.  * member template functions:
  414.  * template<class T> class C {
  415.  *  template<class F> void foo();
  416.  * };
  417.  */
  418.  
  419. /* #define _RWSTD_NO_MEMBER_TEMPLATES 1 */
  420. /*
  421.  * Uncomment the following if your compiler does not support
  422.  * member template classes:
  423.  * class C {
  424.  *  template <class F> class N {};
  425.  * };
  426.  */
  427.  
  428. /* #define _RWSTD_NO_MEM_CLASS_TEMPLATES 1 */
  429.  
  430. /*
  431.  * Uncomment the following if your compiler does not support declaring a
  432.  * template function to be a friend:
  433.  *   class C {
  434.  *     template <class T> friend void foo (T);
  435.  *   };
  436.  */
  437.  
  438. /* #define _RWSTD_NO_FRIEND_TEMPLATES 1 */
  439.  
  440. /*
  441.  * If nontype-args are not allowed in function declarations, then uncomment
  442.  * the following.  template<int i> void foo(char f[10][i])
  443.  */
  444.  
  445. /* #define _RWSTD_NO_NONTYPE_ARGS 1 */
  446.  
  447. /*
  448.  * If simple static initialization of const member variables is not allowed,
  449.  * uncomment the following
  450.  */
  451.  
  452. /* #define _RWSTD_NO_STI_SIMPLE 1 */
  453.  
  454. /*
  455.  * If simple static initialization of const member variables in a
  456.  * template is not allowed, then uncomment the following
  457.  */
  458.  
  459. /* #define _RWSTD_NO_STI_TEMPLATE 1 */
  460.  
  461. /*
  462.  * If FLT_ROUNDS is a constant and not a variable,
  463.  * uncomment the following
  464.  */
  465.  
  466. /* #define _RWSTD_FLT_ROUNDS_IS_CONSTANT 1 */
  467.  
  468. /*
  469.  * If nested static template variables cannot be defined outside the
  470.  * class, uncomment this.
  471. */
  472.  
  473. /* #define _RWSTD_NO_STATIC_DEF 1 */
  474.  
  475. /*
  476.  * If static template variable definitions do not require initializers,
  477.  * uncomment this.
  478.  */
  479.  
  480. /* #define _RWSTD_NO_STATIC_DEF2 1 */
  481. /*
  482.  * If templatized static data members do not work correctly, uncomment this.
  483.  */
  484.  
  485. /* #define _RWSTD_NO_STATIC_DEF3 1 */
  486. /*
  487.  * Are long mangled names handled correctly by your compiler/linker?
  488.  * If not, uncomment the following
  489.  */
  490.  
  491. /* #define _RWSTD_NO_LONG_NAME 1 */
  492.  
  493. /*
  494.  * Are complicated typedefs handled by your compiler?
  495.  * If not, uncomment the following
  496.  */
  497.  
  498. /* #define _RWSTD_NO_COMPLICATED_TYPEDEF 1 */
  499.  
  500. /*
  501.  * Are embedded typedefs supported?
  502.  * If not, uncomment the following
  503. */
  504.  
  505. /* #define _RWSTD_NO_EMBEDDED_TYPEDEF 1 */
  506.  
  507. /*
  508.  * If your compiler does not support template template classes, then
  509.  * uncomment the following:
  510.  * template<class T, template<class U> allocator>
  511.  */
  512.  
  513. /* #define _RWSTD_NO_TEMPLATE_TEMPLATE 1 */
  514.  
  515. /*
  516.  * If your compiler does not have a wchar_t type, uncomment
  517.  * the following
  518.  */
  519.  
  520. /* #define _RWSTD_NO_WIDE_CHAR 1 */
  521.  
  522. /*
  523.  * If your compiler does not have a wchar.h header file, uncomment
  524.  * the following
  525.  */
  526.  
  527. /* #define _RWSTD_NO_WCHAR_H 1 */
  528.  
  529. /*
  530.  * If your compiler does not handle typedef scoping correctly,
  531.  * then uncomment the following.
  532.  */
  533.  
  534. /* #define _RWSTD_NO_TYPEDEF_OVERLOAD 1 */
  535.  
  536. /*
  537.  * If your compiler does not function match on template base classes
  538.  * correctly, then uncomment the following.
  539.  */
  540.  
  541. /* #define _RWSTD_NO_BASE_CLASS_MATCH 1 */
  542.  
  543. /*
  544.  * If your compiler does not handle forward specializations
  545.  * correctly, then uncomment the following.
  546.  */
  547.  
  548. /* #define _RWSTD_NO_FORWARD_SPECIALIZATIONS 1 */
  549.  
  550. /*
  551.  * If your compiler does not handle template types as return types 
  552.  * uncomment the following.
  553.  */
  554.  
  555. /* #define _RWSTD_NO_RET_TEMPLATE 1 */
  556.  
  557. /*
  558.  * If your compiler does not understand explicit constructors, uncomment
  559.  * the following.
  560.  */
  561.  
  562. /* #define _RWSTD_NO_EXPLICIT 1 */
  563.  
  564. /*
  565.  * If your compiler does not understand explicit argument qualification,
  566.  * uncomment the following.
  567.  */
  568.  
  569. /* #define _RWSTD_NO_EXPLICIT_ARG 1 */
  570. /*
  571.  * If your compiler does not understand the typename keyword, uncomment
  572.  * the following.
  573.  */
  574.  
  575. /* #define _RWSTD_NO_TYPENAME 1 */
  576.  
  577. /*
  578.  * Does your compiler instantiate typedefs of itself correctly?  
  579.  * If not, uncomment the following
  580.  */
  581.  
  582. /* #define _RWSTD_NO_TYPEDEF_INST 1 */
  583.  
  584. /*
  585.  * Does your compiler instantiate templates with const types correctly?  
  586.  * If not, uncomment the following
  587.  */
  588.  
  589. /* #define _RWSTD_NO_CONST_INST 1 */
  590.  
  591. /*
  592.  * Does your compiler assume trait typedefs are int? If not, uncomment
  593.  * the following
  594.  */
  595.  
  596. /* #define _RWSTD_NO_INT_TYPEDEF 1 */
  597.  
  598. /*
  599.  * Does your compiler give an ambiguity error on allocate()? If so, uncomment
  600.  * the following
  601.  */
  602.  
  603. /* #define _RWSTD_NO_ARG_MATCH 1 */
  604.  
  605. /*
  606.  * Does your compiler supply the new C++-style C headers?  If not,
  607.  * uncomment the following
  608.  */
  609.  
  610. /* #define _RWSTD_NO_NEW_HEADER 1 */
  611. /*
  612.  * does your compiler provide a placement new definition?  If no,
  613.  * uncomment the following
  614.  */
  615.  
  616. /* #define _RWSTD_NO_NEW_DECL 1 */
  617.  
  618. /*
  619.  * does your compiler inherit typedefs in templates correctly?  If no,
  620.  * uncomment the following
  621.  */
  622.  
  623. /* #define _RWSTD_NO_INHERITED_TYPEDEFS 1 */
  624.  
  625. /*
  626.  * Does your compiler have difficulty with constructors in a return
  627.  * statement?  If so then uncomment the following.
  628.  */
  629.  
  630. /* #define _RWSTD_NO_CTOR_RETURN 1 */
  631.  
  632. /*
  633.  * Does your compiler have difficulty with unDEFINED friends?  If so
  634.  * then uncomment the following.
  635.  */
  636.  
  637. /* #define _RWSTD_NO_UNDEFINED_FRIEND 1 */
  638.  
  639. /*
  640.  * Does your compiler have trouble with structures that lack a default
  641.  * constructor even when their instantiation is indirect?  If so
  642.  * then uncomment the following.
  643.  */
  644.  
  645. /* #define _RWSTD_NO_MEMBER_WO_DEF_CTOR 1 */
  646.  
  647. /* 
  648.  * Does your compiler allow un-initialized static members?  If not
  649.  * then uncomment the following.
  650.  */
  651.  
  652. /* #define _RWSTD_NO_UNINITIALIZED_STATIC_DEF 1 */
  653.  
  654. /*
  655.  * Does your compiler allow member types as template parameters?  If not
  656.  * then uncomment the following.
  657.  */
  658.  
  659. /* #define _RWSTD_NO_MEMBER_TYPE_TPARAM 1 */
  660.  
  661. /*
  662.  * Does your compiler dis-allow the use of 'static' in the out of line
  663.  * initialization of a static const member?  If so then uncomment the
  664.  * following.
  665.  */
  666.  
  667. /* #define _RWSTD_NO_STATIC_MEM_DEF 1 */
  668.  
  669. /*
  670.  * Does your compiler not allow default constructor syntax on built in
  671.  * types. (e.g. int i = int();).  If so then uncomment the following.
  672.  */
  673.  
  674. /* #define _RWSTD_NO_BUILTIN_CTOR 1 */
  675.  
  676. /* Does your compiler not allow defaults for parameters in function
  677.  * templates when the function parameter is a template parameter type.
  678.  * If so then uncomment the following.
  679.  */
  680.  
  681. /* #define _RWSTD_NO_DEFAULT_FOR_TPARAM 1 */
  682.  
  683. /* Does your compiler not allow name injection.  For instance, does it 
  684.  * allow member function specializations to be declared but not defined,
  685.  * so that the template versions of these functions will be used.
  686.  * If not, then uncomment the following.
  687.  */
  688.  
  689. /* #define _RWSTD_NO_NAME_INJECTION 1 */
  690.  
  691. /* Does your compiler have problems overloading on function template
  692.  * arguments that are partial specializations?  
  693.  * If so, then uncomment the following.
  694.  */
  695.  
  696. /* #define _RWSTD_NO_PART_SPEC_OVERLOAD 1 */
  697.  
  698. /* Does your compiler vendor supply wctype.h?
  699.  * If not, then uncomment the following.
  700.  */
  701.  
  702. /* #define _RWSTD_NO_WCTYPE_H 1 */
  703.  
  704. /* Can your compiler handle explicit instantiations?
  705.  * If not, then uncomment the following.
  706.  */
  707.  
  708. /* #define _RWSTD_NO_EXPLICIT_INSTANTIATION 1 */
  709.  
  710. /* Can your compiler handle explicit instantiations of
  711.  * function templates?
  712.  * If not, then uncomment the following.
  713.  */
  714.  
  715. /* #define _RWSTD_NO_EXPLICIT_FUNC_INSTANTIATION 1 */
  716.  
  717. /* If your compiler requires the non-standard
  718.  * include file <ieeefp.h>, then uncomment the
  719.  * following.
  720.  */
  721.  
  722. /*  #define _RWSTD_REQUIRES_IEEEFP 1 */
  723.  
  724. /* If your compiler typedefs long double to 
  725.  * double, then uncomment the following.
  726.  */
  727.  
  728. /*  #define _RWSTD_NO_LONGDOUBLE 1 */
  729.  
  730. /* If your compiler does not support static_cast<>,
  731.    then uncomment the following.
  732. */
  733.  
  734. /*  #define _RWSTD_NO_STATIC_CAST 1 */
  735.  
  736. /* If your compiler doesn't support default values for const template
  737.  * reference arguements, then uncomment the following.
  738.  */
  739.  
  740. /*  #define  _RWSTD_NO_INIT_CONST_TEMPLATE_REF_ARG  1 */
  741.  
  742. /*  If your compiler does not support using a template argument as a
  743.  *  default parameter, then uncomment the following.
  744.  */
  745.  
  746. /*  #define _RWSTD_NO_DEFAULT_TEMPLATE_ARGS 1 */
  747.  
  748. /* If your compiler does not support wide string null being
  749.  * defined as L"" but will work correctly when defined as L"\0",
  750.  * then uncomment the following.
  751.  */ 
  752. /*  #define _RWSTD_WIDE_STRING_NULL_PROBLEM 1 */
  753.  
  754. /* If your compiler does not support partial specialisation
  755.  * of template function, then uncomment the following.
  756.  */ 
  757.  
  758. /*  #define _RWSTD_NO_FUNC_PARTIAL_SPEC 1 */
  759. /* If your compiler does not support partial specialisation
  760.  * of template classes with default parameters, then uncomment
  761.  * the following.
  762.  */
  763.  
  764. /*  #define _RWSTD_NO_CLASS_PARTIAL_SPEC 1 */
  765.  
  766. /* If your compiler does not support overload of template function,
  767.  * then uncomment the following.
  768.  */
  769.  
  770. /*  #define _RWSTD_NO_OVERLOAD_OF_TEMPLATE_FUNCTION 1 */
  771.  
  772. /* If your compiler has difficulties with multi dimensional arrays of
  773.  * container classes, then uncomment the following.
  774.  */
  775.  
  776. /*  #define _RWSTD_NO_MULTI_DIM_ARRAY 1 */
  777.  
  778. /* If your compiler does not provide a catopen/catgets style message
  779.  * catalog defined in header <nl_types.h>, then uncomment the following.
  780.  */
  781.  
  782. /*  #define _RWSTD_NO_CATOPEN_CATGETS 1 */
  783. /* If the exception handler functions are located in namespace std,
  784.  * then uncomment the following.
  785.  */
  786.  
  787. /*  #define _RWSTD_EXCEPTION_HANDLER_IN_STD 1 */
  788.  
  789. /* If your compiler has the class bad_alloc defined in new.h then
  790.  * uncomment the following.
  791.  */
  792.  
  793. /*  #define _RWSTD_BAD_ALLOC_DEFINED 1 */
  794.  
  795. /* If your compiler has the exception classes already defined 
  796.  * then uncomment the following.
  797.  */
  798.  
  799. /*  #define _RWSTD_EXCEPTION_PREDEFINED 1 */
  800.  
  801. /* If your compiler has the class exception in its own exception
  802.  * file then uncomment the following.
  803.  */
  804.  
  805. /*  #define _RWSTD_EXCEPTION_DEFINED 1 */
  806.  
  807. /* If your compiler has the class bad_exception in its own exception
  808.  * file then uncomment the following.
  809.  */
  810.  
  811. /*  #define _RWSTD_BAD_EXCEPTION_DEFINED 1 */
  812.  
  813. /* If your compiler will not accept opterator::new[]
  814.  * then uncomment the following.
  815.  */
  816.  
  817. /*  #define _RWSTD_NO_NEW_BRACKETS 1 */
  818.  
  819. /* If your compiler try to instantiate member function when
  820.  * creating variable of a class.
  821.  */
  822.  
  823. /*  #define _RWSTD_NO_ONLY_NEEDED_INSTANTIATION 1 */
  824.  
  825. /* If your 'C' library does not provide overloads for the pow function
  826.  * (i.e. pow(float,float), and pow(long double, long double) if appropriate),
  827.  * then uncommment the following.
  828.  */
  829.  
  830. /*  #define _RWSTD_NO_OVERLOAD_C_POW 1 */
  831.  
  832. /* If your compiler does not have an mbstate_t type then uncomment
  833.  * the following.
  834.  */
  835.  
  836. /*  #define _RWSTD_NO_MBSTATE_T 1 */
  837.  
  838. /* If your compiler does not support the new template specialization
  839.  * syntax then umcomment the following
  840.  */
  841.  
  842. /* #define _RWSTD_NO_NEW_TEMPLATE_SYNTAX 1 */
  843.  
  844. /* If your compiler does not a have a throw specification on operator new
  845.  * then uncomment the following.
  846.  */
  847.  
  848. /*  #define _RWSTD_NO_THROW_SPEC_ON_NEW 1 */
  849.  
  850. /* 
  851.  * Uncomment this for EDG 2.36
  852.  */
  853.  
  854. /*  #define __NO_EDG_EXCEPTION_CLASSES=1 */
  855.  
  856. /* 
  857.  * If you don't want to use RW extensions (to file streams) please 
  858.  * uncomment this. See documentation for a detailed description about
  859.  * the class wise extensions added to the library.
  860.  */
  861.  
  862. /* #define _RWSTD_NO_EXTENSION 1 */
  863.  
  864. /*************************************************************************
  865. **************************************************************************
  866. **                                    **
  867. **        From here on, it's pretty much boilerplate        **
  868. **        and rarely requires any tuning.                **
  869. **                                    **
  870. **************************************************************************
  871. **************************************************************************/
  872.  
  873. /************************ Cfront derivatives ******************************/
  874.  
  875. /* Any of these defines a cfront style compiler: */
  876. #if defined(__ATT1__) || defined(__ATT2__) || defined(__ATT3__)
  877. #  define __ATT__ 1
  878. #endif
  879.  
  880. #endif // !(__TURBOC__) && !(_MSC_VER) &&!(__OS2__)
  881.  
  882. #define STARTWRAP
  883. #define ENDWRAP
  884.  
  885. /********************** Borland's Turbo C++ **************************/
  886.  
  887. #if defined(__TURBOC__)
  888.  
  889. #define _RWSTD_NO_LONG_HEADER_NAME          1
  890.  
  891. #  if defined(__MSDOS__) && defined(_Windows)
  892. #    define __WIN16__ 1
  893. #  endif
  894.  
  895. /* 
  896.  * For Borland, the __export keyword in a function declaration must 
  897.  * come after the return type: 
  898.  */
  899. #  define RWSTD_TRAILING_RWEXPORT 1
  900.    /*
  901.     * Turbo and Borland won't inline code that contains loops or that
  902.     * generates temporaries requiring destructors or that has an exception
  903.     * specification:
  904.     */
  905. #  define _RWSTD_NO_TRICKY_INLINES           1
  906.  
  907.    /* Turbo C++ V1.00 forgets the segment address when passing
  908.       a class as a far reference if the class has not been defined. */
  909. #  if __TURBOC__ <= 0x0295
  910. #    define _RWSTD_UNDEFINED_REFERENCE_BUG    1
  911. #  endif
  912.  
  913. /*
  914.  *   Borland 5.0 - 5.02:
  915.  *   implements namespaces, bool and _MUTABLE
  916.  */
  917. #  if __TURBOC__ < 0x469
  918.  
  919. #     error Only Borland C++ versions 5.0 and better are supported.
  920.  
  921. #  else
  922.  
  923. /*     if error then #define RWBC5_INCLUDE to full path of the compiler's
  924.  *     INCLUDE directory.
  925. */ 
  926. #      if 0 // Weird include macro not needed.
  927. #      ifndef RWBC5_INCLUDE
  928. #        error #define RWBC5_INCLUDE to full path
  929. #      endif
  930. #      define _RWSTD_BC5_HEADER(x) <RWBC5_INCLUDE/x>
  931. #      endif // 0
  932. # if (__TURBOC__ == 0x520)
  933. // Borland 5.02 & Borland C++Builder 1.0
  934.  
  935. #      define _RWSTD_BC5_ENUM_BUG                    1
  936. #      define _RWSTD_NO_BAD_CAST                     1
  937. #      define _RWSTD_NO_CATOPEN_CATGETS              1
  938. #      define _RWSTD_NO_COMPLICATED_TYPEDEF          1
  939. #      define _RWSTD_NO_CONST_INST                   1
  940. #      define _RWSTD_NO_EXPLICIT_ARG                    1
  941. #      define _RWSTD_NO_FRIEND_TEMPLATES             1
  942. #      define _RWSTD_NO_INSTANTIATE                  1
  943. #      define _RWSTD_NO_LOCALE                       1
  944. #      define _RWSTD_NO_LONG_NAME                    1
  945. #      define _RWSTD_NO_NAMESPACE                    1
  946. #      define _RWSTD_NO_MEMBER_TEMPLATES             1
  947. #      define _RWSTD_NO_MEM_CLASS_TEMPLATES          1
  948. #      define _RWSTD_NO_NESTING_TEMPLATES            1
  949. #      define _RWSTD_NO_NEW_HEADER                   1
  950. #      define _RWSTD_NO_NONCLASS_ARROW_RETURN        1
  951. #      define _RWSTD_NO_NONTYPE_ARGS                 1
  952. #      define _RWSTD_NO_PART_SPEC_OVERLOAD           1
  953. #      define _RWSTD_NO_SIMPLE_DEFAULT_TEMPLATES     1
  954. #      define _RWSTD_NO_STATIC_DEF3                  1
  955. #      define _RWSTD_NO_SWPRINTF                     1
  956. #      define _RWSTD_NO_TEMPLATE_ON_RETURN_TYPE      1
  957. #      define _RWSTD_NO_TEMPLATE_TEMPLATE            1
  958. #      define _RWSTD_NO_TYPENAME                     1
  959. #      define _RWSTD_NO_WINT_TYPE                    1
  960. #      define _RWSTD_FLT_ROUNDS_IS_CONSTANT          1
  961. #      define _RWSTD_NO_STI_SIMPLE                   1
  962. #      ifdef __WIN16__
  963. #        define _RWSTD_NO_MEMBER_WO_DEF_CTOR         1
  964. #      endif
  965. #      define _RWSTD_EXPLICIT_SCOPE_DESTROY          1
  966. #      define _RWSTD_NO_WCTYPE_H                     1
  967. #      define _RWSTD_NO_WCHAR_H                      1
  968. #      define _RWSTD_NO_CLASS_PARTIAL_SPEC           1
  969. #      define _RWSTD_NO_FUNC_PARTIAL_SPEC            1
  970. #      define _RWSTD_NO_SIGNED_CHAR_IN_STREAMS       1
  971. #      define _RWSTD_NO_OVERLOAD_OF_TEMPLATE_FUNCTION 1
  972. #      define _RWSTD_NO_ONLY_NEEDED_INSTANTIATION    1
  973. #      define _RWSTD_NO_OVERLOAD_C_POW               1
  974. #      define _RWSTD_NO_NEW_TEMPLATE_SYNTAX          1
  975. #      define _RWSTD_NO_MBSTATE_T                    1
  976. #      define _RWSTD_NO_WSTR                         1
  977.  
  978. #endif // 0x520
  979. #if (__TURBOC__ == 0x540)
  980. // Borland C++ Builder 4.0 (BCB)
  981.  
  982. #      define _RWSTD_EXCEPTION_HANDLER_IN_STD        1 // It's in except.h
  983. #      define _RWSTD_NO_CATOPEN_CATGETS              1
  984. #      define _RWSTD_NO_MBSTATE_T                    1
  985. #      define _RWSTD_NO_OVERLOAD_C_POW               1
  986. #      define _RWSTD_NO_NEW_BRACKETS                 1
  987. #      define _RWSTD_NO_TEMPLATE_REPOSITORY          1
  988. #      define _RWSTD_NO_THROW_SPEC_NULL              1
  989. #      define _RWSTD_PROTECTED_OSTREAM_COPY_CONSTRUCTOR 1
  990.  
  991. //     Enable iostream support for extra-long integer type.
  992. #      define _RWSTD_LONG_LONG                       __int64
  993. #      define _RWSTD_LONG_LONG_PRINTF_PREFIX         "L"
  994.  
  995. #      define _RWSTD_NO_UNDEFINED_FRIEND             1
  996.  
  997. #    endif // Borland 0x540
  998.  
  999. #    ifdef __MT__
  1000. #      define _RWSTD_MULTI_THREAD                    1
  1001. #    endif
  1002.  
  1003. #  endif  // Borland > 4.5
  1004. #endif    /* __TURBOC__ */
  1005.  
  1006. /************************ Microsoft C/C++ *****************************/
  1007.  
  1008. #if defined(_MSC_VER) && !defined(__BORLANDC__)
  1009.  
  1010. // Disable MSVC's min and max macros
  1011. #  ifndef NOMINMAX
  1012. #    define NOMINMAX                1
  1013. #  endif
  1014.  
  1015. #  define _RWSTD_MSC_BACKEND       1
  1016.  
  1017. /* MSVC version 2.1 */
  1018. #  if _MSC_VER < 1100
  1019.  
  1020. #     error Only Visual C++ versions 6.0 and better are supported.
  1021.  
  1022. // MSVC 6.0
  1023. #  else 
  1024. #      define _RWSTD_NO_NEW_HEADER                   1
  1025. #      define _RWSTD_NO_TYPENAME                     1
  1026. #      define _RWSTD_NO_CLASS_PARTIAL_SPEC           1
  1027. #      define _RWSTD_NO_COMPLICATED_TYPEDEF          1
  1028. #      define _RWSTD_NO_EXPLICIT_INSTANTIATION       1
  1029. #      define _RWSTD_NO_INSTANTIATE                  1
  1030. #      define _RWSTD_NO_NEW_BRACKETS                 1
  1031. #      define _RWSTD_NO_TEMPLATE_ON_RETURN_TYPE      1
  1032. #      define _RWSTD_NO_BAD_CAST                     1 
  1033. #      define _RWSTD_EXCEPTION_HANDLER_IN_STD        1
  1034. #      define _RWSTD_NO_FRIEND_TEMPLATES             1 
  1035.  
  1036. //     Enable iostream support for extra-long integer type.
  1037. #      define _RWSTD_LONG_LONG                       __int64
  1038. #      define _RWSTD_LONG_LONG_PRINTF_PREFIX         "L"
  1039.    
  1040. // Disable MSVC's "Same type qualifier used more than once" warning
  1041. #pragma warning ( disable : 4114)
  1042.  
  1043. #  endif /* MSVC versions */
  1044.  
  1045. #  if defined(_MSDOS) && !defined(WIN32) && !defined(_WIN32)
  1046. #    define __MSDOS__   1
  1047. #    if defined(_WINDOWS)
  1048. #      define __WIN16__ 1
  1049. #    endif
  1050. #  endif
  1051. #  if defined(WIN32) || defined(_WIN32)
  1052. #    define __WIN32__
  1053. #    define _RWSTD_TOLOWER_SIGN_EXTENDS_RESULT_BUG 1
  1054. #  else
  1055. #    define _RWSTD_NO_WSTR 1
  1056. #  endif
  1057.  
  1058. #  ifdef _RWBUILDDLL
  1059. #    define __DLL__ 1
  1060. #  endif
  1061.  
  1062. #endif // _MSC_VER
  1063. /********************** IBM C/Set++   *********************************/
  1064.  
  1065. #ifdef __IBMCPP__
  1066. #  ifdef __MULTI__
  1067. #    define _RWSTD_MULTI_THREAD 1
  1068. #  endif //__MULTI__
  1069.  
  1070. /********************** IBM Visual Age *******************************/
  1071. #ifdef __OS2__ //
  1072. #  define _RWSTD_NO_STRICT_TEMPLATE_INSTANTIATE 1
  1073. #  define _RWSTD_NO_FPOS_T                    1
  1074. #  define _RWSTD_NO_LDIV                      1
  1075. #  define _RWSTD_NO_WCTYPE_H                  1
  1076. #  define _RWSTD_NO_SWPRINTF                  1
  1077. #  define _RWSTD_NO_BOOL                      1
  1078. #  define _RWSTD_NO_SIMPLE_DEFAULT_TEMPLATES  1
  1079. #  define _RWSTD_NO_COMPLEX_DEFAULT_TEMPLATES 1
  1080. #  define _RWSTD_NO_MUTABLE                   1
  1081. #  define _RWSTD_NO_NAMESPACE                 1
  1082. #  define _RWSTD_NO_MEMBER_TEMPLATES          1
  1083. #  define _RWSTD_NO_TYPENAME                  1
  1084. #  define _RWSTD_NO_MEM_CLASS_TEMPLATES       1
  1085. #  define _RWSTD_NO_STI_SIMPLE                1
  1086. #  define _RWSTD_NO_LONG_NAME                 1
  1087. #  define _RWSTD_NO_TEMPLATE_TEMPLATE         1
  1088. #  define _RWSTD_NO_STATIC_CAST               1
  1089. #  define _RWSTD_NO_EXPLICIT_ARG              1
  1090. #  define _RWSTD_NO_NEW_HEADER                1
  1091. #  define _RWSTD_NO_EXPLICIT                  1
  1092. #  define _RWSTD_NO_INIT_CONST_TEMPLATE_REF_ARG  1
  1093. #  define _RWSTD_NO_EXPLICIT_INSTANTIATION    1
  1094. #  define _RWSTD_NO_NONCLASS_ARROW_RETURN     1
  1095. #  define _RWSTD_COMPILE_INSTANTIATE          1
  1096. #  define _RWSTD_NO_LONG_HEADER_NAME          1
  1097. #  define _RWSTD_NO_PART_SPEC_OVERLOAD        1
  1098. #  define _RWSTD_NO_TEMPLATE_SPECIALIZATION   1
  1099. #  define _RWSTD_NO_STATIC_DEF3               1
  1100. #  define _RWSTD_WIDE_STRING_NULL_PROBLEM     1
  1101. #  define _RWSTD_NO_DESTROY_BUILTIN        1
  1102. #endif //OS2
  1103. #endif //IBMCPP
  1104.  
  1105. #ifndef RW_NEVER_ENTER_DEFAULT_HEADER_BLOCK
  1106. #endif /* RW_NEVER_ENTER_DEFAULT_HEADER_BLOCK */
  1107. /********************** DECCXX ***************************************/
  1108.  
  1109. #if defined (__DECCXX)
  1110. #ifdef _RWSTD_EXCEPTION_PREDEFINED
  1111. #undef _RWSTD_EXCEPTION_PREDEFINED
  1112. #endif
  1113. #ifdef _RWSTD_EXCEPTION_DEFINED
  1114. #undef _RWSTD_EXCEPTION_DEFINED
  1115. #endif
  1116. #ifdef _RWSTD_BAD_ALLOC_DEFINED
  1117. #undef _RWSTD_BAD_ALLOC_DEFINED
  1118. #endif
  1119. #define _RWSTD_NO_MBSTATE_COMPARE 1
  1120. #endif // __DECCXX
  1121.  
  1122. /********************** Miscellaneous *********************************/
  1123.  
  1124. /* No Pi for these compilers: */
  1125. #if defined(_RWSTD_MSC_BACKEND) || defined(__OREGON__) || defined(__HIGHC__) || defined(applec) || defined(CII) || defined(__WATCOMC__)
  1126. #  ifndef M_PI
  1127. #    define M_PI 3.14159265358979323846
  1128. #  endif
  1129. #endif
  1130.  
  1131. /*
  1132.  * Only Sun defines strftime("%C", ...)
  1133.  */
  1134. #if !defined(_RWSTD_NO_STRFTIME_CAPC) && !defined(sun)
  1135. #define _RWSTD_NO_STRFTIME_CAPC 1
  1136. #endif
  1137.  
  1138. #if __SUNPRO_CC>=0x420
  1139. #define _RWSTD_NO_TEMPLATE_STATIC_ID 1
  1140. #endif
  1141.  
  1142. /********************** Environment *********************************/
  1143. /*
  1144.  * This is the section for setting things which depend on the properties
  1145.  * of the operating systems rather than specific compilers.  It follows
  1146.  * the compiler section so we have the chance to rationalize the different
  1147.  * preprocessor constants (e.g. _MSDOS vs. __MSDOS__,  _M_I86LM vs. __LARGE__)
  1148.  */
  1149.  
  1150. #ifndef _RWSTD_DEFAULT_PRECISION
  1151. #   define _RWSTD_DEFAULT_PRECISION 16    /* Assume standard IEEE format */
  1152. #endif
  1153.  
  1154. #if __cplusplus >= 199707L && __STDCPP__ == 1
  1155. #define _HPACC_ 1
  1156. #define _RWSTD_NO_NEW_HEADER 1    // For testing; must be removed 
  1157. #endif
  1158. /*
  1159.  * Most (but not all) non-unix systems convert new line to carriage
  1160.  * return / line feed on output:
  1161.  */
  1162. #if defined(__MSDOS__) || defined(__OS2__) || defined(__WIN32__) || defined(__NT__) || defined(__WINDOWS__)
  1163. #  define _RWSTD_CRLF_CONVENTION 1
  1164. #endif
  1165.  
  1166. /*
  1167. ** Miscellaneous workarounds.
  1168. */
  1169.  
  1170. #ifdef _RWSTD_NO_BOOL
  1171. # ifdef _RWSTD_MSVC_BOOL_WARNING
  1172. #  pragma warning ( disable : 4237 )
  1173. # endif
  1174. typedef int     bool;
  1175. # ifndef true
  1176. #  define true    1
  1177. # endif
  1178. # ifndef false
  1179. #  define false   0
  1180. # endif
  1181. #endif // _RWSTD_NO_BOOL
  1182.  
  1183. #ifndef _RWSTD_NO_TYPENAME
  1184. #define _TYPENAME typename
  1185. #else
  1186. #define _TYPENAME
  1187. #endif
  1188.  
  1189. #ifndef _RWSTD_NO_EXPLICIT
  1190. #define _EXPLICIT explicit
  1191. #else
  1192. #define _EXPLICIT 
  1193. #endif
  1194.  
  1195. #ifndef _RWSTD_NO_MUTABLE
  1196. #define _MUTABLE mutable
  1197. #else
  1198. #define _MUTABLE
  1199. #endif
  1200.  
  1201. #ifndef _RWSTD_NO_TRICKY_INLINES
  1202. #define _RWSTD_TRICKY_INLINE inline
  1203. #else
  1204. #define _RWSTD_TRICKY_INLINE
  1205. #endif
  1206.  
  1207. #ifdef _RWSTD_NO_MEMBER_WO_DEF_CTOR
  1208. #define _RWSTD_NO_CONST_INST 1
  1209. #endif
  1210.  
  1211. #if defined(_RWSTD_NO_STI_SIMPLE) && !defined(_RWSTD_NO_STI_TEMPLATE)
  1212. #define _RWSTD_NO_STI_TEMPLATE
  1213. #endif
  1214.  
  1215. #ifdef _RWSTD_NO_EXPLICIT_INSTANTIATION   
  1216. #    define _RWSTD_NO_EXPLICIT_FUNC_INSTANTIATION    1
  1217. #endif
  1218.  
  1219. #ifdef _RWSTD_NO_WIDE_CHAR
  1220. #  define _RWSTD_NO_OVERLOAD_WCHAR 1
  1221. #  define _RWSTD_NO_WSTR 1
  1222. #endif
  1223. //
  1224. // Macro for forming or omitting default template arguments in constructors
  1225. //
  1226.  
  1227. #ifndef _RWSTD_NO_DEFAULT_TEMPLATE_ARGS
  1228. #  define _RWSTD_DEFAULT_ARG(n) = n
  1229. #else
  1230. #  define _RWSTD_DEFAULT_ARG(n) 
  1231. #endif
  1232.  
  1233. //
  1234. // Macro for forming or ommitting default template parameters.
  1235. //
  1236. #ifndef _RWSTD_NO_SIMPLE_DEFAULT_TEMPLATES
  1237. #  define _RWSTD_SIMPLE_DEFAULT(a)  = a
  1238. #  ifndef _RWSTD_NO_COMPLEX_DEFAULT_TEMPLATES
  1239. #    define _RWSTD_COMPLEX_DEFAULT(a)  = a
  1240. #  else
  1241. #    define _RWSTD_COMPLEX_DEFAULT(a)
  1242. #  endif
  1243. #else
  1244. #  ifndef _RWSTD_NO_COMPLEX_DEFAULT_TEMPLATES
  1245. #    define _RWSTD_NO_COMPLEX_DEFAULT_TEMPLATES
  1246. #  endif
  1247. #  define _RWSTD_SIMPLE_DEFAULT(a)
  1248. #  define _RWSTD_COMPLEX_DEFAULT(a)
  1249. #  ifndef _RWSTD_NO_DEFAULT_TEMPLATES
  1250. #    define _RWSTD_NO_DEFAULT_TEMPLATES
  1251. #  endif
  1252. #endif
  1253.  
  1254. //
  1255. // Macros for adding 'std' or '__rwstd' to names
  1256. //
  1257. #ifndef _RWSTD_NO_NAMESPACE
  1258. #  if defined(_MSC_VER) && !defined(__BORLANDC__)
  1259. #    define _RW_STD ::std
  1260. #    define __RWSTD ::__rwstd
  1261. #  else
  1262. #    define _RW_STD std
  1263. #    define __RWSTD __rwstd
  1264. #  endif
  1265. #else
  1266. #  define _RW_STD 
  1267. #  define __RWSTD 
  1268. # endif
  1269.  
  1270. //
  1271. // Macro for casting, using either the "old" method
  1272. // or the new C++ cast system
  1273. //
  1274.  
  1275. #ifdef _RWSTD_NO_STATIC_CAST
  1276. #  define _RWSTD_STATIC_CAST(x,y) (x)y
  1277. #  define _RWSTD_REINTERPRET_CAST(x,y) (x)y
  1278. #  define _RWSTD_CONST_CAST(x,y) (x)y
  1279. #  define _RWSTD_REINTERPRET_CONST_CAST(x,y,z) x(z)
  1280. #else
  1281. #  define _RWSTD_STATIC_CAST(x,y) static_cast< x >(y)
  1282. #  define _RWSTD_REINTERPRET_CAST(x,y) reinterpret_cast< x >(y)
  1283. #  define _RWSTD_CONST_CAST(x,y) const_cast< x >(y)
  1284. #  define _RWSTD_REINTERPRET_CONST_CAST(x,y,z) reinterpret_cast< x >(const_cast< y >(z))
  1285. #endif
  1286.  
  1287. //  
  1288. // Macro for the new template specialization syntax
  1289. //
  1290. #ifdef _RWSTD_NO_NEW_TEMPLATE_SYNTAX
  1291. #  define _RWSTD_TEMPLATE 
  1292. #else
  1293. #  define _RWSTD_TEMPLATE template<>
  1294. #endif
  1295.  
  1296. //
  1297. // If compiler supports member and default templates then it support
  1298. // the _RWSTD_ALLLOCATOR
  1299. //
  1300. #if !defined(_RWSTD_NO_MEMBER_TEMPLATES) && !defined(_RWSTD_NO_SIMPLE_DEFAULT_TEMPLATES) && !defined(_RWSTD_NO_MEM_CLASS_TEMPLATES)
  1301. #define _RWSTD_ALLOCATOR
  1302. #endif
  1303.  
  1304. //
  1305. // Define typedef macro
  1306. //
  1307. #ifdef _RWSTD_NO_EMBEDDED_TYPEDEF
  1308. #  define _RWSTD_ALLOC_SIZE_TYPE        Allocator::size_type
  1309. #  define _RWSTD_ALLOC_DIFF_TYPE        Allocator::difference_type
  1310. #else
  1311. #  define _RWSTD_ALLOC_SIZE_TYPE        allocator_type::size_type
  1312. #  define _RWSTD_ALLOC_DIFF_TYPE        allocator_type::difference_type
  1313. #endif
  1314.  
  1315. #define _RWSTD_MB_CUR_MAX 16  //???  Need to find absolute maximum for this
  1316.  
  1317. #include <compnent.h>
  1318.  
  1319. //
  1320. // Define a generic macro for throw.  To be used as in the following:
  1321. //
  1322. //    _RWSTD_THROW(i < j && j < k, out_of_range, "j is out of range!");
  1323. //
  1324. //                ^ predicate     ^ exception   ^ message
  1325. //
  1326. // literally, if (predicate) throw exception(message)
  1327. //
  1328. #ifdef _RWSTD_NO_EXCEPTIONS
  1329. //
  1330. // If we don't have exceptions, then we'll use assert.
  1331. // We don't allow them to turn off the assert() in which such
  1332. // a thrown exception would result.
  1333. //
  1334.  
  1335. #ifdef  NDEBUG
  1336. #define __RW_NDEBUG
  1337. #undef  NDEBUG
  1338. #endif
  1339. #ifndef _RWSTD_NO_NEW_HEADER
  1340. #include <cassert>
  1341. #else
  1342. #include <assert.h>
  1343. #endif
  1344. #define _RWSTD_THROW_NO_MSG(PRED,EXC)  assert(!(PRED))
  1345. #define _RWSTD_THROW(PRED,EXC,MESG) assert(!(PRED))
  1346. //
  1347. // We must also turn off expansion of assert() if that's what the user expects.
  1348. //
  1349. #ifdef  __RW_NDEBUG
  1350. #define NDEBUG
  1351. #undef  __RW_NDEBUG
  1352. #endif
  1353. #else /*!_RWSTD_NO_EXCEPTIONS*/
  1354. //
  1355. // We must check to see if we can use <stdexcept> or just a string.
  1356. //
  1357. #ifdef _RW_STD_EXCEPT
  1358. #define _RWSTD_THROW_NO_MSG(PRED,EXC) if (PRED) throw EXC()
  1359. #define _RWSTD_THROW(PRED,EXC,MESG) if (PRED) throw EXC(MESG)  
  1360. #else
  1361. #define _RWSTD_THROW(PRED,EXC,MESG) if (PRED) throw (MESG)  
  1362. #endif
  1363. #endif /*_RWSTD_NO_EXCEPTIONS*/
  1364.  
  1365. //
  1366. // Define two generic throw specification macros.  One to illustrate
  1367. // the exceptions that a function can throw and the other to indicate
  1368. // that a function doesn't throw any exceptions.
  1369. //
  1370. //   _RWSTD_THROW_SPEC(ExceptionList)
  1371. //
  1372. //   _RWSTD_THROW_SPEC_NULL
  1373. //
  1374. // Owing to the face that the first macro must be able to take a
  1375. // variable number of arguments, we must simulate this by always
  1376. // passing the exceptions in parentheses; i.e.
  1377. //
  1378. //  void f () _RWSTD_THROW_SPEC((out_of_range));
  1379. //  void g () _RWSTD_THROW_SPEC((domain_error, invalid_argument));
  1380. //  void h () _RWSTD_THROW_SPEC((out_of_range, invalid_argument, length_error));
  1381. //
  1382.  
  1383. #if defined(_RWSTD_NO_EXCEPTIONS) || defined(_RWSTD_NO_EX_SPEC)
  1384. #define _RWSTD_THROW_SPEC(EXCEPTIONS) /**/
  1385. #define _RWSTD_THROW_SPEC_NULL        /**/
  1386. #else
  1387. #ifdef _RW_STD_EXCEPT
  1388. //
  1389. // _RWSTD_THROW will use the exceptions in <stdexcept>
  1390. //
  1391. #define _RWSTD_THROW_SPEC(ExceptionList) throw ExceptionList
  1392. #define _RWSTD_THROW_SPEC_NULL           throw()
  1393. #else
  1394. //
  1395. // _RWSTD_THROW will only throw const char *
  1396. //
  1397. #define _RWSTD_THROW_SPEC(ExceptionList) throw(const char *)
  1398. #define _RWSTD_THROW_SPEC_NULL           throw()
  1399. #endif
  1400. #endif /*_RWSTD_NO_EXCEPTIONS||_RWSTD_NO_EX_SPEC*/
  1401.  
  1402. #ifndef _RWSTD_NO_TRICKY_INLINES
  1403. #define _RWSTD_INLINE_NO_THROW _RWSTD_THROW_SPEC_NULL
  1404. #else
  1405. #define _RWSTD_INLINE_NO_THROW
  1406. #endif
  1407.  
  1408. #if defined (__BORLANDC__) && defined(_RWSTD_NO_THROW_SPEC_NULL)
  1409. #  undef  _RWSTD_THROW_SPEC_NULL
  1410. #  define _RWSTD_THROW_SPEC_NULL        /**/
  1411. #endif
  1412.  
  1413. //
  1414. // Macro for path to the ANSI 'C' headers
  1415. // Must be set specifically for each platform when the
  1416. // C++ wrappers for 'C' headers are used.
  1417. //
  1418. #define _RWSTD_ANSIC(x) </usr/include/x>
  1419.  
  1420. #endif /*__RWSTDCOMPILER_H__*/
  1421.