]> git.lyx.org Git - lyx.git/commitdiff
make boost compile without exceptions
authorLars Gullik Bjønnes <larsbj@gullik.org>
Mon, 10 Jun 2002 17:57:29 +0000 (17:57 +0000)
committerLars Gullik Bjønnes <larsbj@gullik.org>
Mon, 10 Jun 2002 17:57:29 +0000 (17:57 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@4356 a592a061-630c-0410-9148-cb99ea01b6c8

boost/boost/any.hpp
boost/boost/config/user.hpp
boost/boost/detail/shared_count.hpp
boost/libs/regex/src/Makefile.am

index 5587aa6e41a1f235321693083f1d15b59e075bc0..bda7f2efb1e8851f1cdc33992a39cabcda02358e 100644 (file)
@@ -82,7 +82,7 @@ namespace boost
         class placeholder
         {
         public: // structors
-    
+
             virtual ~placeholder()
             {
             }
@@ -92,7 +92,7 @@ namespace boost
             virtual const std::type_info & type() const = 0;
 
             virtual placeholder * clone() const = 0;
-    
+
         };
 
         template<typename ValueType>
index 98adbac9096e70c8f11964213a17c864ecb826cb..507117f783d8bcbd70dc72410fd5cd45f98d89b9 100644 (file)
 // #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
index 63316f41c41b9e18a2463f88251a80b677f553e7..b937ce0e11858469be56a9944721eb88f0c3010f 100644 (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);
         }
     }
 
@@ -256,7 +262,7 @@ public:
         r.release();
     }
 
-#endif 
+#endif
 
     ~shared_count() // nothrow
     {
index 423f2fee309f82d5b5c18888baa274bf4a44c0e9..417d8a7abc1630ae015fc7b2fd5c9e3d46e08088 100644 (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 \