make boost compile without exceptions

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@4356 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Lars Gullik Bjønnes 2002-06-10 17:57:29 +00:00
parent 3005c47180
commit 3dbc80c145
4 changed files with 36 additions and 4 deletions

View File

@ -66,3 +66,29 @@
// #define BOOST_DISABLE_WIN32
#define BOOST_NO_EXCEPTIONS 1
#define BOOST_NO_WREGEX 1
#define BOOST_NO_WSTRING 1
#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_NOEH_ASSERT(x)\
if(0 == (x))\
{\
std::fprintf(stderr, "Error: critical boost 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_NOEH_ASSERT(x)
#endif

View File

@ -83,7 +83,10 @@ public:
#ifdef BOOST_HAS_THREADS
mutex_type::scoped_lock lock(mtx_);
#endif
#ifndef BOOST_NO_EXCEPTIONS
if(use_count_ == 0 && weak_count_ != 0) throw use_count_is_zero();
#endif
BOOST_NOEH_ASSERT(!(use_count_ == 0 && weak_count_ != 0));
++use_count_;
++weak_count_;
}
@ -237,7 +240,10 @@ public:
catch(...)
{
d(p); // delete p
#ifndef BOOST_NO_EXCEPTIONS
throw;
#endif
BOOST_NOEH_ASSERT(false);
}
}

View File

@ -12,7 +12,6 @@ libboostregex_la_SOURCES = \
primary_transform.hpp \
regex.cpp \
w32_regex_traits.cpp \
winstances.cpp \
regex_synch.cpp
# cregex.cpp \
@ -20,3 +19,4 @@ libboostregex_la_SOURCES = \
# posix_api.cpp \
# wide_posix_api.cpp \
# regex_debug.cpp
# winstances.cpp \