A patch for libstdc++
H.J. Lu
hjl@lucon.org
Fri Oct 10 15:09:00 GMT 1997
Hi,
This kludge should fix basic_string.
--
H.J. Lu (hjl@gnu.ai.mit.edu)
--
Fri Oct 10 11:08:54 1997 H.J. Lu (hjl@gnu.ai.mit.edu)
* std/bastring.h (OUTOFRANGE): Use assert () for string.
Mon Aug 25 17:31:49 1997 H.J. Lu (hjl@gnu.ai.mit.edu)
* Makefile.in ($(SHLIB)): Use $(CC) instead of (CXX) to avoid
implicit -lstdc++.
Index: libstdc++/Makefile.in
===================================================================
RCS file: /home/work/cvs/gnu/egcs/libstdc++/Makefile.in,v
retrieving revision 1.1.1.2
diff -u -r1.1.1.2 Makefile.in
--- Makefile.in 1997/08/29 00:32:44 1.1.1.2
+++ Makefile.in 1997/09/08 21:02:08
@@ -87,7 +87,7 @@
$(RANLIB) $(ARLIB)
$(SHLIB): piclist
- $(CXX) $(LIBCXXFLAGS) $(SHFLAGS) -shared -o $(SHLIB) `cat piclist` $(SHDEPS)
+ $(CC) $(LIBCXXFLAGS) $(SHFLAGS) -shared -o $(SHLIB) `cat piclist` $(SHDEPS)
$(SHARLIB): $(SHLIB)
-rm -f t$(SHARLIB)
Index: libstdc++/std/bastring.h
===================================================================
RCS file: /home/work/cvs/gnu/egcs/libstdc++/std/bastring.h,v
retrieving revision 1.1.1.5
diff -u -r1.1.1.5 bastring.h
--- bastring.h 1997/10/09 17:31:45 1.1.1.5
+++ bastring.h 1997/10/10 17:55:49
@@ -33,6 +33,7 @@
#endif
#include <cstddef>
+#include <typeinfo>
#include <std/straits.h>
extern "C++" {
@@ -365,10 +366,18 @@
#ifdef __STL_USE_EXCEPTIONS
#include <stdexcept>
-#define OUTOFRANGE(cond) \
- do { if (!(cond)) throw out_of_range (#cond); } while (0)
-#define LENGTHERROR(cond) \
- do { if (!(cond)) throw length_error (#cond); } while (0)
+#include <cassert>
+
+#define OUTOFRANGE(cond) \
+ if (typeid (value_type) == typeid (char)) \
+ assert (!(cond)); \
+ else \
+ do { if (!(cond)) throw out_of_range (#cond); } while (0)
+#define LENGTHERROR(cond) \
+ if (typeid (value_type) == typeid (char)) \
+ assert (!(cond)); \
+ else \
+ do { if (!(cond)) throw length_error (#cond); } while (0)
#else
More information about the Gcc
mailing list