#ifndef __RWSTDDEFS_H__
#define __RWSTDDEFS_H__

/***************************************************************************
 *
 * stddefs.h - Common definitions
 *
 * $Id: stddefs.h,v 1.19 1996/09/24 19:18:09 smithey Exp $
 *
 ***************************************************************************
 *    
 *  Copyright 2000 Compaq Computer Corporation
 *
 *  COMPAQ Registered in U.S. Patent and Trademark Office.
 *
 *  Confidential computer software. Valid license from Compaq required for
 *  possession, use or copying. Consistent with FAR 12.211 and 12.212,
 *  Commercial Computer Software, Computer Software Documentation, and
 *  Technical Data for Commercial Items are licensed to the U.S. Government
 *  under vendor's standard commercial license.
 *
 ****************************************************************************
 *
 * (c) Copyright 1994, 1998 Rogue Wave Software, Inc.
 * ALL RIGHTS RESERVED
 *
 * The software and information contained herein are proprietary to, and
 * comprise valuable trade secrets of, Rogue Wave Software, Inc., which
 * intends to preserve as trade secrets such software and information.
 * This software is furnished pursuant to a written license agreement and
 * may be used, copied, transmitted, and stored only in accordance with
 * the terms of such license and with the inclusion of the above copyright
 * notice.  This software and information or any other copies thereof may
 * not be provided or otherwise made available to any other person.
 *
 * Notwithstanding any other lease or license that may pertain to, or
 * accompany the delivery of, this computer software and information, the
 * rights of the Government regarding its use, reproduction and disclosure
 * are as set forth in Section 52.227-19 of the FARS Computer
 * Software-Restricted Rights clause.
 * 
 * Use, duplication, or disclosure by the Government is subject to
 * restrictions as set forth in subparagraph (c)(1)(ii) of the Rights in
 * Technical Data and Computer Software clause at DFARS 252.227-7013.
 * Contractor/Manufacturer is Rogue Wave Software, Inc.,
 * P.O. Box 2328, Corvallis, Oregon 97339.
 *
 * This computer software and information is distributed with "restricted
 * rights."  Use, duplication or disclosure is subject to restrictions as
 * set forth in NASA FAR SUP 18-52.227-79 (April 1985) "Commercial
 * Computer Software-Restricted Rights (April 1985)."  If the Clause at
 * 18-52.227-74 "Rights in Data General" is specified in the contract,
 * then the "Alternate III" clause applies.
 *
 **************************************************************************/

#include <stdcomp>	/* Set compiler-specific flags */

STARTWRAP
#ifndef _RWSTD_NO_NEW_HEADER
#include <cstddef>		/* Looking for size_t */
#else
#include <stddef.h>		/* Looking for size_t */
#endif
ENDWRAP

#if defined(__VMS) && defined(__DECCXX) && !defined(__DECFIXCXXL1158)
#pragma __extern_prefix __save
#pragma __extern_prefix "CXXL$" 
#endif

#define	_RWSTDNIL	-1L

#ifndef _RWSTD_NO_NEW_HEADER
#ifndef _RWSTD_NO_NAMESPACE
using std::size_t;
using std::ptrdiff_t;
#endif
#endif

//
// Macro for determining the number of bits in a word.
// Used by vector<bool>.
//
#define _RWSTD_WORD_BIT (int(CHAR_BIT*sizeof(unsigned int)))  


  
/*
 *     W I N D O W S - S P E C I F I C   C O D E
 *
 * Enable or disable, as necessary, for Microsoft Windows
 */
#if defined(__WIN32__) || defined (__WIN16__) 
#  include "rw/stdwind.h"
#else
   /* Disable Windows hacks if we are not compiling for Windows: */
#  define _RWSTDExport
#  define _RWSTDExportTemplate
#  define _RWSTDExportFunc(ReturnType) ReturnType
#  define _RWSTDExportTemplate
#  define _RWSTDExportStatic
#endif

#ifndef _MSC_VER
#define _RWSTDGExport _RWSTDExport
#else
#define _RWSTDGExport
#endif


/*************************************************************************
**************************************************************************
**									**
**		From here on, it's pretty much boilerplate		**
**		and rarely requires any tuning.				**
**									**
**************************************************************************
**************************************************************************/

/*
 *     D E B U G G I N G
 *
 * Use -D_RWSTDDEBUG to compile a version of the libraries to debug
 * the user's code.  This will perform pre- and post-condition checks
 * upon entering routines, but will be larger and run more slowly.
 *
 * Use -D_RWMEMCK to add memory checking software.
 *
 * VERY IMPORTANT!  *All* code must be compiled with the same flag.
 */

#if defined(RDEBUG) && !defined(_RWSTDDEBUG)
#  define _RWSTDDEBUG 1
#endif

#if defined(_RWSTDDEBUG)
#  ifndef _RWSTDBOUNDS_CHECK
#    define _RWSTDBOUNDS_CHECK 1	/* Turn on bounds checking when debugging. */
#  endif
STARTWRAP
#if defined(__VMS) && defined(__DECCXX) && !defined(__DECFIXCXXL1158)
#   pragma __extern_prefix __restore
#endif
#ifndef _RWSTD_NO_NEW_HEADER
#  include <cassert>
#else
#  include <assert.h>
#endif
#if defined(__VMS) && defined(__DECCXX) && !defined(__DECFIXCXXL1158)
#pragma __extern_prefix __save
#pragma __extern_prefix "CXXL$" 
#endif
ENDWRAP
#  define _RWSTDPRECONDITION(a)	assert( (a) != 0 ) /* Check pre- and post-conditions */
#  define _RWSTDPOSTCONDITION(a)	assert( (a) != 0 )
#ifdef _RWSTD_NO_NESTED_QUOTES
#  define _RWSTDPRECONDITION2(a,b)	assert( (a) != 0 )
#  define _RWSTDPOSTCONDITION2(a,b)	assert( (a) != 0 )
#else
#  define _RWSTDPRECONDITION2(a,b)	assert((b, (a) !=0))
#  define _RWSTDPOSTCONDITION2(a,b)	assert((b, (a) !=0))
#endif
#  define _RWSTDASSERT(a)		assert( (a) != 0 )
#else
#  define _RWSTDPRECONDITION(a)
#  define _RWSTDPOSTCONDITION(a)
#  define _RWSTDPRECONDITION2(a,b)
#  define _RWSTDPOSTCONDITION2(a,b)
#  define _RWSTDASSERT(a)
#endif

/* Check DECCXX hook for multi-thread mode: */
#if defined (__DECCXX)
#   define _RWSTD_MULTI_THREAD 1
#endif

/*
 * The following allows getting the declaration for RTL classes
 * right without having to include the appropriate header file
 * (in particular, istream & ostream).
 */
#ifdef __TURBOC__
#  include <_defs.h>	/* Looking for _CLASSTYPE */
#  define _RWSTDCLASSTYPE _CLASSTYPE
#else
#  define _RWSTDCLASSTYPE
#endif

/* No RCS for MS-DOS (it has enough memory problems already!): */
#ifdef __MSDOS__
#define RCSID(a)
#define _RW_RCSID(a)
#else
#define RCSID(a) static const char rcsid[] = a
#define _RWSTD_RCSID(a) static const char rcsid[] = a
#endif

#ifdef __cplusplus

const size_t _RWSTD_NPOS            = ~(size_t)0;

#ifndef _RW_STD_IOSTREAM
class _RWSTDCLASSTYPE istream;
class _RWSTDCLASSTYPE ostream;
class _RWSTDCLASSTYPE ios;
#endif

#ifdef _RW_MULTI_THREAD
class _RWSTDMutex;
#endif

#ifdef _RWSTD_NO_FRIEND_INLINE_DECL
#  define _RWSTD_INLINE_FRIEND friend
#else
#  define _RWSTD_INLINE_FRIEND inline friend
#endif

#if defined(__DECCXX) && !defined(__DECFIXCXXL1200)

#ifndef _RWSTD_NO_NAMESPACE
namespace _RWrwstd {
#endif
template <bool __b>
struct __rw_select { };

template <>
struct __rw_select<true> { };


#ifndef _RWSTD_NO_NAMESPACE
}
#endif

#define _RWSTD_DISPATCH_INT(yes) const __RWSTD::__rw_select < yes >*
#define _RWSTD_DISPATCH(iter) \
        ((__RWSTD::__rw_select<numeric_limits< iter >::is_integer>*)0)

#endif


#endif // if C++


#if defined(__VMS) && defined(__DECCXX) && !defined(__DECFIXCXXL1158)
#   pragma __extern_prefix __restore
#endif

#endif // __RWSTDDEFS_H__


