home *** CD-ROM | disk | FTP | other *** search
/ PC Format (South-Africa) 2001 June / PCFJune.iso / Xenon / C++ / FreeCommandLineTools.exe / Include / Rw / stddefs.h < prev    next >
Encoding:
C/C++ Source or Header  |  2000-01-31  |  5.5 KB  |  183 lines

  1. #ifndef __STDDEFS_H
  2. #define __STDDEFS_H
  3. #pragma option push -b -a8 -pc -Vx- -Ve- -w-inl -w-aus -w-sig
  4. #ifndef __RWSTDDEFS_H__
  5. #define __RWSTDDEFS_H__
  6.  
  7. /***************************************************************************
  8.  *
  9.  * stddefs.h - Common definitions
  10.  *
  11.  * $Id: stddefs.h,v 1.19 1996/09/24 19:18:09 smithey Exp $
  12.  *
  13.  ***************************************************************************
  14.  *
  15.  * Copyright (c) 1994-1999 Rogue Wave Software, Inc.  All Rights Reserved.
  16.  *
  17.  * This computer software is owned by Rogue Wave Software, Inc. and is
  18.  * protected by U.S. copyright laws and other laws and by international
  19.  * treaties.  This computer software is furnished by Rogue Wave Software,
  20.  * Inc. pursuant to a written license agreement and may be used, copied,
  21.  * transmitted, and stored only in accordance with the terms of such
  22.  * license and with the inclusion of the above copyright notice.  This
  23.  * computer software or any other copies thereof may not be provided or
  24.  * otherwise made available to any other person.
  25.  *
  26.  * U.S. Government Restricted Rights.  This computer software is provided
  27.  * with Restricted Rights.  Use, duplication, or disclosure by the
  28.  * Government is subject to restrictions as set forth in subparagraph (c)
  29.  * (1) (ii) of The Rights in Technical Data and Computer Software clause
  30.  * at DFARS 252.227-7013 or subparagraphs (c) (1) and (2) of the
  31.  * Commercial Computer Software รป Restricted Rights at 48 CFR 52.227-19,
  32.  * as applicable.  Manufacturer is Rogue Wave Software, Inc., 5500
  33.  * Flatiron Parkway, Boulder, Colorado 80301 USA.
  34.  *
  35.  **************************************************************************/
  36.  
  37. # include <stdcomp.h>     /* Set compiler-specific flags */
  38.  
  39. STARTWRAP
  40. #ifndef _RWSTD_NO_NEW_HEADER
  41. #include <cstddef>        /* Looking for size_t */
  42. #else
  43. #include <stddef.h>        /* Looking for size_t */
  44. #endif
  45. ENDWRAP
  46.  
  47. #define    _RWSTDNIL    -1L
  48.  
  49. #ifndef _RWSTD_NO_NEW_HEADER
  50. #ifndef _RWSTD_NO_NAMESPACE
  51. using std::size_t;
  52. using std::ptrdiff_t;
  53. #endif
  54. #endif
  55.  
  56. //
  57. // Macro for determining the number of bits in a word.
  58. // Used by vector<bool>.
  59. //
  60. #define _RWSTD_WORD_BIT (int(CHAR_BIT*sizeof(unsigned int)))  
  61.   
  62. /*
  63.  *     W I N D O W S - S P E C I F I C   C O D E
  64.  *
  65.  * Enable or disable, as necessary, for Microsoft Windows
  66.  */
  67. #if defined(__WIN32__) || defined (__WIN16__) 
  68. #  include <rw/stdwind.h> 
  69. #else
  70.    /* Disable Windows hacks if we are not compiling for Windows: */
  71. #  define _RWSTDExport
  72. #  define _RWSTDExportTemplate
  73. #  define _RWSTDExportFunc(ReturnType) ReturnType
  74. #  define _RWSTDExportTemplate
  75. #  define _RWSTDExportStatic
  76. #endif
  77.  
  78. #if !defined(_MSC_VER) || defined(__BORLANDC__)
  79. #define _RWSTDGExport _RWSTDExport
  80. #else
  81. #define _RWSTDGExport
  82. #endif
  83. /*************************************************************************
  84. **************************************************************************
  85. **                                    **
  86. **        From here on, it's pretty much boilerplate        **
  87. **        and rarely requires any tuning.                **
  88. **                                    **
  89. **************************************************************************
  90. **************************************************************************/
  91.  
  92. /*
  93.  *     D E B U G G I N G
  94.  *
  95.  * Use -D_RWSTDDEBUG to compile a version of the libraries to debug
  96.  * the user's code.  This will perform pre- and post-condition checks
  97.  * upon entering routines, but will be larger and run more slowly.
  98.  *
  99.  * Use -D_RWMEMCK to add memory checking software.
  100.  *
  101.  * VERY IMPORTANT!  *All* code must be compiled with the same flag.
  102.  */
  103.  
  104. #if defined(RDEBUG) && !defined(_RWSTDDEBUG)
  105. #  define _RWSTDDEBUG 1
  106. #endif
  107.  
  108. #if defined(_RWSTDDEBUG)
  109. #  ifndef _RWSTDBOUNDS_CHECK
  110. #    define _RWSTDBOUNDS_CHECK 1    /* Turn on bounds checking when debugging. */
  111. #  endif
  112. STARTWRAP
  113. #ifndef _RWSTD_NO_NEW_HEADER
  114. #  include <cassert>
  115. #else
  116. #  include <assert.h>
  117. #endif
  118. ENDWRAP
  119. #  define _RWSTDPRECONDITION(a)    assert( (a) != 0 ) /* Check pre- and post-conditions */
  120. #  define _RWSTDPOSTCONDITION(a)    assert( (a) != 0 )
  121. #ifdef _RWSTD_NO_NESTED_QUOTES
  122. #  define _RWSTDPRECONDITION2(a,b)    assert( (a) != 0 )
  123. #  define _RWSTDPOSTCONDITION2(a,b)    assert( (a) != 0 )
  124. #else
  125. #  define _RWSTDPRECONDITION2(a,b)    assert((b, (a) !=0))
  126. #  define _RWSTDPOSTCONDITION2(a,b)    assert((b, (a) !=0))
  127. #endif
  128. #  define _RWSTDASSERT(a)        assert( (a) != 0 )
  129. #else
  130. #  define _RWSTDPRECONDITION(a)
  131. #  define _RWSTDPOSTCONDITION(a)
  132. #  define _RWSTDPRECONDITION2(a,b)
  133. #  define _RWSTDPOSTCONDITION2(a,b)
  134. #  define _RWSTDASSERT(a)
  135. #endif
  136.  
  137. /*
  138.  * The following allows getting the declaration for RTL classes
  139.  * right without having to include the appropriate header file
  140.  * (in particular, istream & ostream).
  141.  */
  142. #ifdef __TURBOC__
  143. #  include <_defs.h>    /* Looking for _CLASSTYPE */
  144. #  define _RWSTDCLASSTYPE _CLASSTYPE
  145. #else
  146. #  define _RWSTDCLASSTYPE
  147. #endif
  148.  
  149. /* No RCS for MS-DOS (it has enough memory problems already!): */
  150. #ifdef __MSDOS__
  151. #define RCSID(a)
  152. #define _RW_RCSID(a)
  153. #else
  154. #define RCSID(a) static const char rcsid[] = a
  155. #define _RWSTD_RCSID(a) static const char rcsid[] = a
  156. #endif
  157.  
  158. #ifdef __cplusplus
  159.  
  160. const size_t _RWSTD_NPOS            = ~(size_t)0;
  161.  
  162. #ifndef _RW_STD_IOSTREAM
  163. class _RWSTDCLASSTYPE istream;
  164. class _RWSTDCLASSTYPE ostream;
  165. class _RWSTDCLASSTYPE ios;
  166. #endif
  167.  
  168. #ifdef _RWSTD_MULTI_THREAD
  169. class _RWSTDMutex;
  170. #endif
  171.  
  172. #ifdef _RWSTD_NO_FRIEND_INLINE_DECL
  173. #  define _RWSTD_INLINE_FRIEND friend
  174. #else
  175. #  define _RWSTD_INLINE_FRIEND inline friend
  176. #endif
  177. #endif // if C++
  178.  
  179. #endif // __RWSTDDEFS_H__
  180.  
  181. #pragma option pop
  182. #endif /* __STDDEFS_H */
  183.