Added support for compilers with no exception handling support.

[SVN r12758]
This commit is contained in:
John Maddock
2002-02-08 12:44:43 +00:00
parent a5d1526fbb
commit c8e9df8fa2
12 changed files with 267 additions and 12 deletions

View File

@ -273,6 +273,35 @@ using std::distance;
# include <windows.h>
#endif
/*****************************************************************************
*
* Error Handling for exception free compilers:
*
****************************************************************************/
#ifdef BOOST_NO_EXCEPTIONS
//
// If there are no exceptions then we must report critical-errors
// the only way we know how; by terminating.
//
#ifdef __BORLANDC__
// <cstdio> seems not to make stderr usable with Borland:
#include <stdio.h>
#endif
# define BOOST_REGEX_NOEH_ASSERT(x)\
if(0 == (x))\
{\
std::fprintf(stderr, "Error: critical regex++ failure in \"%s\"", #x);\
std::abort();\
}
#else
//
// With exceptions then error handling is taken care of and
// there is no need for these checks:
//
# define BOOST_REGEX_NOEH_ASSERT(x)
#endif
/*****************************************************************************
*
* Debugging / tracing support:
@ -516,6 +545,10 @@ namespace std{
using ::fopen;
using ::fclose;
using ::FILE;
#ifdef BOOST_NO_EXCEPTIONS
using ::fprintf;
using ::abort;
#endif
}
#endif