diff --git a/src/lib/libstdc++/Makefile b/src/lib/libstdc++/Makefile index 70fdf6c..9ea785e 100644 --- a/src/lib/libstdc++/Makefile +++ b/src/lib/libstdc++/Makefile @@ -23,7 +23,7 @@ # Compile the source files .cc.o: - $(CXX) -Wall -nostdinc -O $(INCLUDES) -c -o $@ $< + $(CXX) -Wall -nostdinc -DNOBOOL -O $(INCLUDES) -c -o $@ $< .cc.s: $(CXX) -Wall -nostdinc -O -I./include -S -o $@ $< diff --git a/src/lib/libstdc++/sinst.cc b/src/lib/libstdc++/sinst.cc index b40cc3b..a23ac1b 100644 --- a/src/lib/libstdc++/sinst.cc +++ b/src/lib/libstdc++/sinst.cc @@ -36,7 +36,31 @@ -ostream& flush(ostream& outs) -{ +ostream& flush(ostream& outs) { return outs.flush(); -} + } + +ostream& ostream::operator<<(const char *s) { + return(*this); + } + +ostream& ostream::operator<<(char c) { + return(*this); + } + +ostream& ostream::operator<<(int n) { + return(*this); + } + +ostream& ostream::operator<<(unsigned int n) { + return(*this); + } + +ostream& ostream::operator<<(long n) { + return(*this); + } + +ostream& ostream::operator<<(unsigned long n) { + return(*this); + } + diff --git a/src/lib/libstdc++/std/straights.h b/src/lib/libstdc++/std/straights.h index a5f6b77..78bf1a2 100644 --- a/src/lib/libstdc++/std/straights.h +++ b/src/lib/libstdc++/std/straights.h @@ -1,3 +1,5 @@ +#include + typedef char charT; extern "C++" { @@ -6,6 +8,36 @@ typedef charT char_type; static char_type eos () { return char_type(); } // the null character static void assign (char_type& c1, const char_type& c2) { c1 = c2; } + static bool ne (const char_type& c1, const char_type& c2) { return !(c1 == c2); } + static bool lt (const char_type& c1, const char_type& c2) { return (c1 < c2); } + static int compare (const char_type* s1, const char_type* s2, size_t n) { + size_t i; + for (i = 0; i < n; ++i) + if (ne (s1[i], s2[i])) + return lt (s1[i], s2[i]) ? -1 : 1; + return 0; + } + static size_t length (const char_type* s) { + size_t l = 0; + while (ne (*s++, eos ())) + ++l; + return l; + } + static char_type* copy (char_type* s1, const char_type* s2, size_t n) { + for (; n--; ) + assign (s1[n], s2[n]); + return s1; + } + static char_type* move (char_type* s1, const char_type* s2, size_t n) { + char_type a[n]; + size_t i; + for (i = 0; i < n; ++i) + assign (a[i], s2[i]); + for (i = 0; i < n; ++i) + assign (s1[i], a[i]); + return s1; + } + }; class streambuf;class ios;class istream; class ostream; @@ -31,6 +63,15 @@ ostream() { } ostream& put(char c) { return *this; } ostream& flush(); + + + ostream& operator<<(char c); + ostream& operator<<(const char *s); + ostream& operator<<(int n); + ostream& operator<<(unsigned int n); + ostream& operator<<(unsigned long n); + ostream& operator<<(long n); + }; }