home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World 1998 October
/
PCWorld_1998-10_cd.bin
/
software
/
prehled
/
komix
/
DATA.Z
/
ConstraintSections.hxx
< prev
next >
Wrap
Text File
|
1997-09-05
|
2KB
|
62 lines
//---------------------------------------------------------------------------
//
// Copyright (c) 1997 by Cayenne Software, Inc.
//
// This software is furnished under a license and may be used only in
// accordance with the terms of such license and with the inclusion of
// the above copyright notice. This software or any other copies thereof
// may not be provided or otherwise made available to any other person.
// No title to and ownership of the software is hereby transferred.
//
// The information in this software is subject to change without notice
// and should not be construed as a commitment by Cayenne Software,
// Inc.
//
//---------------------------------------------------------------------------
// File : ConstraintSections.hxx
// Original date : Fri Sep 5 12:59:32 MET DST 1997
// SCCS id : @(#)ConstraintSections.hxx /main/titanic/2 5 Sep 1997
// Description : Marcos for supporting runtime constraints
//
//---------------------------------------------------------------------------
#include <stdlib.h>
#include <iostream.h>
#ifndef NDEBUG
#define invariant(expr) \
{ \
if (!(expr)) { \
cerr << "Invariant failed: " << #expr \
<< " file: " << __FILE__ \
<< " line: " << __LINE__ << endl; \
} \
}
#define ensure(expr) \
{ \
if (!(expr)) { \
cerr << "Ensure failed: " << #expr \
<< " file: " << __FILE__ \
<< " line: " << __LINE__ << endl; \
} \
}
#define require(expr) \
{ \
if (!(expr)) { \
cerr << "Require failed: " << #expr \
<< " file: " << __FILE__ \
<< " line: " << __LINE__ << endl; \
} \
}
#else
#define invariant(expr)
#define ensure(expr)
#define require(expr)
#endif