mirror of
https://github.com/boostorg/regex.git
synced 2025-07-18 23:02:09 +02:00
Added support for compilers with no exception handling support.
[SVN r12758]
This commit is contained in:
@ -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
|
||||
|
Reference in New Issue
Block a user