4 // Define to the address where bug reports for this package should be sent.
5 #define USTL_BUGREPORT "@PACKAGE_BUGREPORT@"
7 +/// Define to 1 if you want to build without libstdc++
8 +#undef WITHOUT_LIBSTDCPP
10 /// Define to 1 if you want stream operations to throw exceptions on
11 /// insufficient data or insufficient space. All these errors should
12 /// be preventable in output code; the input code should verify the
15 #undef WANT_STREAM_BOUNDS_CHECKING
17 -#if !defined(WANT_STREAM_BOUNDS_CHECKING) && !defined(NDEBUG)
18 +#if !defined(WANT_STREAM_BOUNDS_CHECKING) && !defined(NDEBUG) && !defined(WITHOUT_LIBSTDCPP)
19 #define WANT_STREAM_BOUNDS_CHECKING 1
22 -/// Define to 1 if you want to build without libstdc++
23 -#undef WITHOUT_LIBSTDCPP
25 /// Define to 1 if you don't want the standard streams.
26 /// You will not be able to run bvt tests if you do this.
32 #include "uexception.h"
34 +#ifdef WANT_STREAM_BOUNDS_CHECKING
45 const size_type expectedSize = n * stream_size_of(value_type());
46 +#ifdef WANT_STREAM_BOUNDS_CHECKING
47 if (expectedSize > is.remaining())
48 throw stream_bounds_exception ("read", typeid(v).name(), is.pos(), expectedSize, is.remaining());
50 + assert(expectedSize <= is.remaining());
53 nr_container_read (is, v);