home *** CD-ROM | disk | FTP | other *** search
/ DOS/V Power Report 1997 May / VPR9705A.ISO / VPR_DATA / PROGRAM / CBTRIAL / SETUP / DATA.Z / STDDEFS.H < prev    next >
C/C++ Source or Header  |  1997-02-14  |  7KB  |  211 lines

  1. #ifndef __RWSTDDEFS_H__
  2. #define __RWSTDDEFS_H__
  3. /* $Revision:   8.2  $ */
  4.  
  5. /***************************************************************************
  6.  *
  7.  * stddefs.h - Common definitions
  8.  *
  9.  * $Id: stddefs.h,v 1.11 1995/09/01 02:28:38 smithey Exp $
  10.  *
  11.  ***************************************************************************
  12.  *
  13.  * (c) Copyright 1994, 1995 Rogue Wave Software, Inc.
  14.  * ALL RIGHTS RESERVED
  15.  *
  16.  * The software and information contained herein are proprietary to, and
  17.  * comprise valuable trade secrets of, Rogue Wave Software, Inc., which
  18.  * intends to preserve as trade secrets such software and information.
  19.  * This software is furnished pursuant to a written license agreement and
  20.  * may be used, copied, transmitted, and stored only in accordance with
  21.  * the terms of such license and with the inclusion of the above copyright
  22.  * notice.  This software and information or any other copies thereof may
  23.  * not be provided or otherwise made available to any other person.
  24.  *
  25.  * Notwithstanding any other lease or license that may pertain to, or
  26.  * accompany the delivery of, this computer software and information, the
  27.  * rights of the Government regarding its use, reproduction and disclosure
  28.  * are as set forth in Section 52.227-19 of the FARS Computer
  29.  * Software-Restricted Rights clause.
  30.  *
  31.  * Use, duplication, or disclosure by the Government is subject to
  32.  * restrictions as set forth in subparagraph (c)(1)(ii) of the Rights in
  33.  * Technical Data and Computer Software clause at DFARS 252.227-7013.
  34.  * Contractor/Manufacturer is Rogue Wave Software, Inc.,
  35.  * P.O. Box 2328, Corvallis, Oregon 97339.
  36.  *
  37.  * This computer software and information is distributed with "restricted
  38.  * rights."  Use, duplication or disclosure is subject to restrictions as
  39.  * set forth in NASA FAR SUP 18-52.227-79 (April 1985) "Commercial
  40.  * Computer Software-Restricted Rights (April 1985)."  If the Clause at
  41.  * 18-52.227-74 "Rights in Data General" is specified in the contract,
  42.  * then the "Alternate III" clause applies.
  43.  *
  44.  **************************************************************************/
  45.  
  46. # include "stdcomp.h"   /* Set compiler-specific flags */
  47.  
  48. STARTWRAP
  49. #ifndef RWSTD_NO_NEW_HEADER
  50. #include <cstddef>              /* Looking for size_t */
  51. #else
  52. #include <stddef.h>             /* Looking for size_t */
  53. #endif
  54. ENDWRAP
  55.  
  56. /*
  57.  * In rare instances, the following few lines may have to be reworked
  58.  * to deal with naming conflicts.
  59.  */
  60.  
  61. #ifndef TRUE
  62. #  define TRUE  1
  63. #  define FALSE 0
  64. #endif
  65.  
  66. typedef int RWBoolean;
  67. #define rwstdnil        0
  68. #define RWSTDNIL        -1L
  69.  
  70. /*************************************************************************
  71. **************************************************************************
  72. **                                                                      **
  73. **              From here on, it's pretty much boilerplate              **
  74. **              and rarely requires any tuning.                         **
  75. **                                                                      **
  76. **************************************************************************
  77. **************************************************************************/
  78.  
  79. /*
  80.  *     D E B U G G I N G
  81.  *
  82.  * Use -DRWSTDDEBUG to compile a version of the libraries to debug
  83.  * the user's code.  This will perform pre- and post-condition checks
  84.  * upon entering routines, but will be larger and run more slowly.
  85.  *
  86.  * Use -DRWMEMCK to add memory checking software.
  87.  *
  88.  * VERY IMPORTANT!  *All* code must be compiled with the same flag.
  89.  */
  90.  
  91. #if defined(RDEBUG) && !defined(RWSTDDEBUG)
  92. #  define RWSTDDEBUG 1
  93. #endif
  94.  
  95. #if defined(RWSTDDEBUG)
  96. #  ifndef RWSTDBOUNDS_CHECK
  97. #    define RWSTDBOUNDS_CHECK 1 /* Turn on bounds checking when debugging. */
  98. #  endif
  99. STARTWRAP
  100. #ifndef RWSTD_NO_NEW_HEADER
  101. #  include <cassert>
  102. #else
  103. #  include <assert.h>
  104. #endif
  105. ENDWRAP
  106. #  define RWSTDPRECONDITION(a)  assert( (a) != 0 ) /* Check pre- and post-conditions */
  107. #  define RWSTDPOSTCONDITION(a) assert( (a) != 0 )
  108. #ifdef RWSTD_NO_NESTED_QUOTES
  109. #  define RWSTDPRECONDITION2(a,b)       assert( (a) != 0 )
  110. #  define RWSTDPOSTCONDITION2(a,b)      assert( (a) != 0 )
  111. #else
  112. #  define RWSTDPRECONDITION2(a,b)       assert((b, (a) !=0))
  113. #  define RWSTDPOSTCONDITION2(a,b)      assert((b, (a) !=0))
  114. #endif
  115. #  define RWSTDASSERT(a)                assert( (a) != 0 )
  116. #else
  117. #  define RWSTDPRECONDITION(a)
  118. #  define RWSTDPOSTCONDITION(a)
  119. #  define RWSTDPRECONDITION2(a,b)
  120. #  define RWSTDPOSTCONDITION2(a,b)
  121. #  define RWSTDASSERT(a)
  122. #endif
  123.  
  124. /* Check for USL hook for multi-thread mode: */
  125. #if defined(_REENTRANT) && !defined(RWSTD_MULTI_THREAD)
  126. # define RWSTD_MULTI_THREAD 1
  127. #endif
  128.  
  129.  
  130. /*
  131.  *     W I N D O W S - S P E C I F I C   C O D E
  132.  *
  133.  * Enable or disable, as necessary, for Microsoft Windows
  134.  */
  135. #if defined(__WIN16__) || defined(__WIN32__)
  136. #  include <stdwind.h>
  137. #else
  138.    /* Disable Windows hacks if we are not compiling for Windows: */
  139. #  define RWSTDExport
  140. #  define RWSTDExportTemplate
  141. #  define rwexport
  142. #endif
  143.  
  144. #ifndef _MSC_VER
  145. #define RWSTDGExport RWSTDExport
  146. #else
  147. #define RWSTDGExport
  148. #endif
  149.  
  150. /*
  151.  * The following allows getting the declaration for RTL classes
  152.  * right without having to include the appropriate header file
  153.  * (in particular, istream & ostream).
  154.  */
  155. #ifdef __TURBOC__
  156. #  include <_defs.h>    /* Looking for _CLASSTYPE */
  157. #  define _RWSTDCLASSTYPE _CLASSTYPE
  158. #else
  159. #  define _RWSTDCLASSTYPE
  160. #endif
  161.  
  162. /* No RCS for MS-DOS (it has enough memory problems already!): */
  163. #ifdef __MSDOS__
  164. #define RCSID(a)
  165. #define RW_RCSID(a)
  166. #else
  167. #define RCSID(a) static const char rcsid[] = a
  168. #define RWSTD_RCSID(a) static const char rcsid[] = a
  169. #endif
  170.  
  171. /* Enable near/far pointers if we are using segmented architecture: */
  172. #if (defined(__MSDOS__) || defined(I8086)) && !defined(__HIGHC__)
  173. #  define RWSTD_SEGMENTED_ARCHITECTURE
  174. #  define rwnear near
  175. #  define rwfar  far
  176. #  define rwhuge huge
  177. #else
  178. #  define rwnear
  179. #  define rwfar
  180. #  define rwhuge
  181. #endif
  182.  
  183. #ifdef __cplusplus
  184.  
  185.  
  186. const size_t RWSTD_NPOS            = ~(size_t)0;
  187.  
  188.  
  189. #ifdef RW_STD_IOSTREAM
  190. #include <iosfwd>
  191. #else
  192. class _RWSTDCLASSTYPE istream;
  193. class _RWSTDCLASSTYPE ostream;
  194. class _RWSTDCLASSTYPE ios;
  195. #endif
  196.  
  197. #ifdef RW_MULTI_THREAD
  198. class RWSTDMutex;
  199. #endif
  200.  
  201. #ifdef RWSTD_NO_FRIEND_INLINE_DECL
  202. #  define RWSTD_INLINE_FRIEND friend
  203. #else
  204. #  define RWSTD_INLINE_FRIEND inline friend
  205. #endif
  206.  
  207.  
  208. #endif // if C++
  209.  
  210. #endif // __RWSTDDEFS_H__
  211.