#ifndef __RWSTDDEFS_H__
#define __RWSTDDEFS_H__
//
//
//  Copyright Digital Equipment Corporation 1996. All rights reserved.
//
//  Restricted Rights: Use, duplication, or disclosure by the U.S.
//  Government is subject to restrictions as set forth in subparagraph
//  (c) (1) (ii) of DFARS 252.227-7013, or in FAR 52.227-19, or in FAR
//  52.227-14 Alt. III, as applicable.
//
//  This software is proprietary to and embodies the confidential
//  technology of Digital Equipment Corporation. Possession, use, or
//  copying of this software and media is authorized only pursuant to a
//  valid written license from Digital or an authorized sublicensor.
//
//

/***************************************************************************
 *
 * stddefs - Common definitions
 *
 * $Id: stddefs,v 1.19 1996/09/24 19:18:09 smithey Exp $
 *
 ***************************************************************************
 *
 * (c) Copyright 1994-1996 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(__DECCXX)
#   ifdef __PRAGMA_ENVIRONMENT
#      pragma __environment __save
#      pragma __environment __header_defaults
#   endif
#endif

/*
 * In rare instances, the following few lines may have to be reworked
 * to deal with naming conflicts.
 */

#ifndef TRUE
#  define TRUE  1
#  define FALSE 0
#endif

typedef int _RWBoolean;
#define rwstdnil	0
#define	_RWSTDNIL	-1L

#ifndef _RWSTD_NO_NEW_HEADER
#ifndef _RWSTD_NO_NAMESPACE
using std::size_t;
#endif
#endif
  
/*
 *     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 <stdwind.h>
#else
   /* Disable Windows hacks if we are not compiling for Windows: */
#  define _RWSTDExport
#  define _RWSTDExportTemplate
#  define _RWSTDExportFunc(ReturnType) ReturnType
#  define _RWSTDExportTemplate
#  define rwexport
#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
#ifndef _RWSTD_NO_NEW_HEADER
#  include <cassert>
#else
#  include <assert.h>
#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

/* Check for USL hook for multi-thread mode: */ 
#if defined(_REENTRANT) && !defined(_RWSTD_MULTI_THREAD)
# 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

#if defined(__DECCXX) && !defined(__DECFIXCXXL781)
#else
/* 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
#endif

/* Enable near/far pointers if we are using segmented architecture: */
#if (defined(__MSDOS__) || defined(I8086)) && !defined(__HIGHC__)
#  define _RWSTD_SEGMENTED_ARCHITECTURE
#  define rwnear near
#  define rwfar  far
#  define rwhuge huge
#else
#  define rwnear
#  define rwfar
#  define rwhuge
#endif

#ifdef __cplusplus


const size_t _RWSTD_NPOS            = ~(size_t)0;


#if defined(__DECCXX) && !defined(__DECFIXCXXL562)
#else
#ifdef __USE_STD_IOSTREAM
#include <iosfwd>
#else
class _RWSTDCLASSTYPE istream;
class _RWSTDCLASSTYPE ostream;
class _RWSTDCLASSTYPE ios;
#endif
#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


#endif // if C++

#if defined(__DECCXX)
#   ifdef __PRAGMA_ENVIRONMENT
#      pragma __environment __restore
#   endif
#endif

#endif // __RWSTDDEFS_H__
