From 329b6095ddda830433e6000b943fab82d1c83cf1 Mon Sep 17 00:00:00 2001 From: patacongo Date: Wed, 31 Oct 2012 19:13:18 +0000 Subject: Add misc/uClibc++ and build hooks in nuttx/ git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@5283 42af7a65-404d-4744-a932-0658087f49c3 --- misc/uClibc++/libxx/uClib++/Make.defs | 52 +++++++ misc/uClibc++/libxx/uClib++/algorithm.cxx | 30 ++++ misc/uClibc++/libxx/uClib++/associative_base.cxx | 26 ++++ misc/uClibc++/libxx/uClib++/bitset.cxx | 26 ++++ misc/uClibc++/libxx/uClib++/char_traits.cxx | 69 +++++++++ misc/uClibc++/libxx/uClib++/complex.cxx | 28 ++++ misc/uClibc++/libxx/uClib++/del_op.cxx | 26 ++++ misc/uClibc++/libxx/uClib++/del_opnt.cxx | 28 ++++ misc/uClibc++/libxx/uClib++/del_opv.cxx | 26 ++++ misc/uClibc++/libxx/uClib++/del_opvnt.cxx | 28 ++++ misc/uClibc++/libxx/uClib++/deque.cxx | 42 +++++ misc/uClibc++/libxx/uClib++/eh_alloc.cxx | 61 ++++++++ misc/uClibc++/libxx/uClib++/eh_globals.cxx | 42 +++++ misc/uClibc++/libxx/uClib++/exception.cxx | 52 +++++++ misc/uClibc++/libxx/uClib++/fstream.cxx | 174 +++++++++++++++++++++ misc/uClibc++/libxx/uClib++/func_exception.cxx | 87 +++++++++++ misc/uClibc++/libxx/uClib++/iomanip.cxx | 29 ++++ misc/uClibc++/libxx/uClib++/ios.cxx | 189 +++++++++++++++++++++++ misc/uClibc++/libxx/uClib++/iostream.cxx | 38 +++++ misc/uClibc++/libxx/uClib++/istream.cxx | 75 +++++++++ misc/uClibc++/libxx/uClib++/iterator.cxx | 28 ++++ misc/uClibc++/libxx/uClib++/limits.cxx | 25 +++ misc/uClibc++/libxx/uClib++/list.cxx | 29 ++++ misc/uClibc++/libxx/uClib++/locale.cxx | 29 ++++ misc/uClibc++/libxx/uClib++/map.cxx | 33 ++++ misc/uClibc++/libxx/uClib++/new_handler.cxx | 31 ++++ misc/uClibc++/libxx/uClib++/new_op.cxx | 35 +++++ misc/uClibc++/libxx/uClib++/new_opnt.cxx | 28 ++++ misc/uClibc++/libxx/uClib++/new_opv.cxx | 35 +++++ misc/uClibc++/libxx/uClib++/new_opvnt.cxx | 28 ++++ misc/uClibc++/libxx/uClib++/numeric.cxx | 27 ++++ misc/uClibc++/libxx/uClib++/ostream.cxx | 65 ++++++++ misc/uClibc++/libxx/uClib++/queue.cxx | 27 ++++ misc/uClibc++/libxx/uClib++/set.cxx | 33 ++++ misc/uClibc++/libxx/uClib++/sstream.cxx | 59 +++++++ misc/uClibc++/libxx/uClib++/stack.cxx | 27 ++++ misc/uClibc++/libxx/uClib++/stdexcept.cxx | 63 ++++++++ misc/uClibc++/libxx/uClib++/streambuf.cxx | 49 ++++++ misc/uClibc++/libxx/uClib++/string.cxx | 112 ++++++++++++++ misc/uClibc++/libxx/uClib++/support.cxx | 53 +++++++ misc/uClibc++/libxx/uClib++/typeinfo.cxx | 34 ++++ misc/uClibc++/libxx/uClib++/utility.cxx | 30 ++++ misc/uClibc++/libxx/uClib++/valarray.cxx | 29 ++++ misc/uClibc++/libxx/uClib++/vector.cxx | 83 ++++++++++ 44 files changed, 2120 insertions(+) create mode 100644 misc/uClibc++/libxx/uClib++/Make.defs create mode 100644 misc/uClibc++/libxx/uClib++/algorithm.cxx create mode 100644 misc/uClibc++/libxx/uClib++/associative_base.cxx create mode 100644 misc/uClibc++/libxx/uClib++/bitset.cxx create mode 100644 misc/uClibc++/libxx/uClib++/char_traits.cxx create mode 100644 misc/uClibc++/libxx/uClib++/complex.cxx create mode 100644 misc/uClibc++/libxx/uClib++/del_op.cxx create mode 100644 misc/uClibc++/libxx/uClib++/del_opnt.cxx create mode 100644 misc/uClibc++/libxx/uClib++/del_opv.cxx create mode 100644 misc/uClibc++/libxx/uClib++/del_opvnt.cxx create mode 100644 misc/uClibc++/libxx/uClib++/deque.cxx create mode 100644 misc/uClibc++/libxx/uClib++/eh_alloc.cxx create mode 100644 misc/uClibc++/libxx/uClib++/eh_globals.cxx create mode 100644 misc/uClibc++/libxx/uClib++/exception.cxx create mode 100644 misc/uClibc++/libxx/uClib++/fstream.cxx create mode 100644 misc/uClibc++/libxx/uClib++/func_exception.cxx create mode 100644 misc/uClibc++/libxx/uClib++/iomanip.cxx create mode 100644 misc/uClibc++/libxx/uClib++/ios.cxx create mode 100644 misc/uClibc++/libxx/uClib++/iostream.cxx create mode 100644 misc/uClibc++/libxx/uClib++/istream.cxx create mode 100644 misc/uClibc++/libxx/uClib++/iterator.cxx create mode 100644 misc/uClibc++/libxx/uClib++/limits.cxx create mode 100644 misc/uClibc++/libxx/uClib++/list.cxx create mode 100644 misc/uClibc++/libxx/uClib++/locale.cxx create mode 100644 misc/uClibc++/libxx/uClib++/map.cxx create mode 100644 misc/uClibc++/libxx/uClib++/new_handler.cxx create mode 100644 misc/uClibc++/libxx/uClib++/new_op.cxx create mode 100644 misc/uClibc++/libxx/uClib++/new_opnt.cxx create mode 100644 misc/uClibc++/libxx/uClib++/new_opv.cxx create mode 100644 misc/uClibc++/libxx/uClib++/new_opvnt.cxx create mode 100644 misc/uClibc++/libxx/uClib++/numeric.cxx create mode 100644 misc/uClibc++/libxx/uClib++/ostream.cxx create mode 100644 misc/uClibc++/libxx/uClib++/queue.cxx create mode 100644 misc/uClibc++/libxx/uClib++/set.cxx create mode 100644 misc/uClibc++/libxx/uClib++/sstream.cxx create mode 100644 misc/uClibc++/libxx/uClib++/stack.cxx create mode 100644 misc/uClibc++/libxx/uClib++/stdexcept.cxx create mode 100644 misc/uClibc++/libxx/uClib++/streambuf.cxx create mode 100644 misc/uClibc++/libxx/uClib++/string.cxx create mode 100644 misc/uClibc++/libxx/uClib++/support.cxx create mode 100644 misc/uClibc++/libxx/uClib++/typeinfo.cxx create mode 100644 misc/uClibc++/libxx/uClib++/utility.cxx create mode 100644 misc/uClibc++/libxx/uClib++/valarray.cxx create mode 100644 misc/uClibc++/libxx/uClib++/vector.cxx (limited to 'misc/uClibc++/libxx') diff --git a/misc/uClibc++/libxx/uClib++/Make.defs b/misc/uClibc++/libxx/uClib++/Make.defs new file mode 100644 index 000000000..38ae24a93 --- /dev/null +++ b/misc/uClibc++/libxx/uClib++/Make.defs @@ -0,0 +1,52 @@ +############################################################################ +# misc/uClibc++/libxx/uClibc++/Makefile +# +# Copyright (C) 2012 Gregory Nutt. All rights reserved. +# Author: Gregory Nutt +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in +# the documentation and/or other materials provided with the +# distribution. +# 3. Neither the name NuttX nor the names of its contributors may be +# used to endorse or promote products derived from this software +# without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS +# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED +# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +# POSSIBILITY OF SUCH DAMAGE. +# +########################################################################### + +# Add the uClibc++ sources + +CXXSRCS += algorithm.cxx associative_base.cxx bitset.cxx char_traits.cxx +CXXSRCS += complex.cxx del_op.cxx del_opnt.cxx del_opv.cxx del_opvnt.cxx +CXXSRCS += deque.cxx eh_alloc.cxx eh_globals.cxx exception.cxx +CXXSRCS += stream.cxx func_exception.cxx iomanip.cxx ios.cxx +CXXSRCS += iostream.cxx istream.cxx iterator.cxx limits.cxx list.cxx +CXXSRCS += locale.cxx map.cxx new_handler.cxx new_op.cxx new_opnt.cxx +CXXSRCS += new_opv.cxx new_opvnt.cxx numeric.cxx ostream.cxx queue.cxx +CXXSRCS += set.cxx sstream.cxx stack.cxx stdexcept.cxx streambuf.cxx +CXXSRCS += string.cxx support.cxx typeinfo.cxx utility.cxx valarray.cxx +CXXSRCS += vector.cxx + +# Add the path to the uClibc++ subdirectory + +DEPPATH += --dep-path . +VPATH += uClibc++ diff --git a/misc/uClibc++/libxx/uClib++/algorithm.cxx b/misc/uClibc++/libxx/uClib++/algorithm.cxx new file mode 100644 index 000000000..e21b14e3f --- /dev/null +++ b/misc/uClibc++/libxx/uClib++/algorithm.cxx @@ -0,0 +1,30 @@ +/* Copyright (C) 2004 Garrett A. Kajmowicz + This file is part of the uClibc++ Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +*/ + + +#include + + +namespace std{ + + + +} + + diff --git a/misc/uClibc++/libxx/uClib++/associative_base.cxx b/misc/uClibc++/libxx/uClib++/associative_base.cxx new file mode 100644 index 000000000..cc2d20e54 --- /dev/null +++ b/misc/uClibc++/libxx/uClib++/associative_base.cxx @@ -0,0 +1,26 @@ +/* Copyright (C) 2007 Garrett A. Kajmowicz + This file is part of the uClibc++ Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +*/ + +#include + +namespace std{ + + + +} diff --git a/misc/uClibc++/libxx/uClib++/bitset.cxx b/misc/uClibc++/libxx/uClib++/bitset.cxx new file mode 100644 index 000000000..f1ece31f9 --- /dev/null +++ b/misc/uClibc++/libxx/uClib++/bitset.cxx @@ -0,0 +1,26 @@ +/* Copyright (C) 2004 Garrett A. Kajmowicz + This file is part of the uClibc++ Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +*/ + +#include + +namespace std{ + + + +} diff --git a/misc/uClibc++/libxx/uClib++/char_traits.cxx b/misc/uClibc++/libxx/uClib++/char_traits.cxx new file mode 100644 index 000000000..2a91bd97f --- /dev/null +++ b/misc/uClibc++/libxx/uClib++/char_traits.cxx @@ -0,0 +1,69 @@ +/* Copyright (C) 2004 Garrett A. Kajmowicz + + This file is part of the uClibc++ Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +*/ + +#define __UCLIBCXX_COMPILE_CHAR_TRAITS__ 1 + + +#include +#include + +namespace std{ + +_UCXXEXPORT const char_traits::char_type* char_traits::find(const char_type* s, int n, const char_type& a){ + for(int i=0; i < n; i++){ + if(eq(s[i], a)){ + return (s+i); + } + } + return 0; +} + +_UCXXEXPORT bool char_traits::eq(const char_type& c1, const char_type& c2){ + if(strncmp(&c1, &c2, 1) == 0){ + return true; + } + return false; +} + +_UCXXEXPORT char_traits::char_type char_traits::to_char_type(const int_type & i){ + if(i > 0 && i <= 255){ + return (char)(unsigned char)i; + } + + //Out of range + return 0; +} + + + +#ifdef __UCLIBCXX_HAS_WCHAR__ + +_UCXXEXPORT const char_traits::char_type* char_traits::find(const char_type* s, int n, const char_type& a){ + for(int i=0; i < n; i++){ + if(eq(s[i], a)){ + return (s+i); + } + } + return 0; +} + +#endif + +} diff --git a/misc/uClibc++/libxx/uClib++/complex.cxx b/misc/uClibc++/libxx/uClib++/complex.cxx new file mode 100644 index 000000000..6b895a888 --- /dev/null +++ b/misc/uClibc++/libxx/uClib++/complex.cxx @@ -0,0 +1,28 @@ +/* Copyright (C) 2005 Garrett A. Kajmowicz + This file is part of the uClibc++ Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#include + + +namespace std{ + + + template class _UCXXEXPORT complex; + + +} diff --git a/misc/uClibc++/libxx/uClib++/del_op.cxx b/misc/uClibc++/libxx/uClib++/del_op.cxx new file mode 100644 index 000000000..f5a36957d --- /dev/null +++ b/misc/uClibc++/libxx/uClib++/del_op.cxx @@ -0,0 +1,26 @@ +/* Copyright (C) 2004 Garrett A. Kajmowicz + + This file is part of the uClibc++ Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#include +#include +#include + +_UCXXEXPORT void operator delete(void* ptr) throw(){ + free(ptr); +} diff --git a/misc/uClibc++/libxx/uClib++/del_opnt.cxx b/misc/uClibc++/libxx/uClib++/del_opnt.cxx new file mode 100644 index 000000000..96cb03baa --- /dev/null +++ b/misc/uClibc++/libxx/uClib++/del_opnt.cxx @@ -0,0 +1,28 @@ +/* Copyright (C) 2004 Garrett A. Kajmowicz + + This file is part of the uClibc++ Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#include +#include +#include + +#ifndef NO_NOTHROW +_UCXXEXPORT void operator delete(void* ptr, const std::nothrow_t& ) throw() { + free(ptr); +} +#endif diff --git a/misc/uClibc++/libxx/uClib++/del_opv.cxx b/misc/uClibc++/libxx/uClib++/del_opv.cxx new file mode 100644 index 000000000..028e86f36 --- /dev/null +++ b/misc/uClibc++/libxx/uClib++/del_opv.cxx @@ -0,0 +1,26 @@ +/* Copyright (C) 2004 Garrett A. Kajmowicz + + This file is part of the uClibc++ Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#include +#include +#include + +_UCXXEXPORT void operator delete[](void * ptr) throw(){ + free(ptr); +} diff --git a/misc/uClibc++/libxx/uClib++/del_opvnt.cxx b/misc/uClibc++/libxx/uClib++/del_opvnt.cxx new file mode 100644 index 000000000..f2a2a361c --- /dev/null +++ b/misc/uClibc++/libxx/uClib++/del_opvnt.cxx @@ -0,0 +1,28 @@ +/* Copyright (C) 2004 Garrett A. Kajmowicz + + This file is part of the uClibc++ Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#include +#include +#include + +#ifndef NO_NOTHROW +_UCXXEXPORT void operator delete[](void* ptr, const std::nothrow_t& ) throw(){ + free(ptr); +} +#endif diff --git a/misc/uClibc++/libxx/uClib++/deque.cxx b/misc/uClibc++/libxx/uClib++/deque.cxx new file mode 100644 index 000000000..c5155808b --- /dev/null +++ b/misc/uClibc++/libxx/uClib++/deque.cxx @@ -0,0 +1,42 @@ +/* Copyright (C) 2004 Garrett A. Kajmowicz + This file is part of the uClibc++ Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +*/ + +#include + + +namespace std{ + + + + + + + + + + + + + + +} + + + + diff --git a/misc/uClibc++/libxx/uClib++/eh_alloc.cxx b/misc/uClibc++/libxx/uClib++/eh_alloc.cxx new file mode 100644 index 000000000..5098196d8 --- /dev/null +++ b/misc/uClibc++/libxx/uClib++/eh_alloc.cxx @@ -0,0 +1,61 @@ +/* Copyright (C) 2006 Garrett A. Kajmowicz + + This file is part of the uClibc++ Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation, version 2.1 + of the License. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#include +#include +#include + +//This is a system-specific header which does all of the error-handling management +#include + +namespace __cxxabiv1{ + +extern "C" void * __cxa_allocate_exception(std::size_t thrown_size) throw(){ + void *retval; + //The sizeof crap is required by Itanium ABI because we need to provide space for + //accounting information which is implementaion (gcc) specified + retval = malloc (thrown_size + sizeof(__cxa_exception)); + if (0 == retval){ + std::terminate(); + } + memset (retval, 0, sizeof(__cxa_exception)); + return (void *)((unsigned char *)retval + sizeof(__cxa_exception)); +} + +extern "C" void __cxa_free_exception(void *vptr) throw(){ + free( (char *)(vptr) - sizeof(__cxa_exception) ); +} + + +extern "C" __cxa_dependent_exception * __cxa_allocate_dependent_exception() throw(){ + __cxa_dependent_exception *retval; + //The sizeof crap is required by Itanium ABI because we need to provide space for + //accounting information which is implementaion (gcc) specified + retval = static_cast<__cxa_dependent_exception*>(malloc (sizeof(__cxa_dependent_exception))); + if (0 == retval){ + std::terminate(); + } + memset (retval, 0, sizeof(__cxa_dependent_exception)); + return retval; +} + +extern "C" void __cxa_free_dependent_exception(__cxa_dependent_exception *vptr) throw(){ + free( (char *)(vptr) ); +} +} diff --git a/misc/uClibc++/libxx/uClib++/eh_globals.cxx b/misc/uClibc++/libxx/uClib++/eh_globals.cxx new file mode 100644 index 000000000..38d4583e6 --- /dev/null +++ b/misc/uClibc++/libxx/uClib++/eh_globals.cxx @@ -0,0 +1,42 @@ +/* Copyright (C) 2006 Garrett A. Kajmowicz + + This file is part of the uClibc++ Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation, version 2.1 + of the License. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#include +#include +#include + +//This is a system-specific header which does all of the error-handling management +#include + +//The following functionality is derived from reading of the GNU libstdc++ code and making it...simple + + +namespace __cxxabiv1{ + +static __UCLIBCXX_TLS __cxa_eh_globals eh_globals; + +extern "C" __cxa_eh_globals* __cxa_get_globals() throw(){ + return &eh_globals; +} + +extern "C" __cxa_eh_globals* __cxa_get_globals_fast() throw(){ + return &eh_globals; +} + +} diff --git a/misc/uClibc++/libxx/uClib++/exception.cxx b/misc/uClibc++/libxx/uClib++/exception.cxx new file mode 100644 index 000000000..82021ddb6 --- /dev/null +++ b/misc/uClibc++/libxx/uClib++/exception.cxx @@ -0,0 +1,52 @@ +/* Copyright (C) 2004 Garrett A. Kajmowicz + + This file is part of the uClibc++ Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +*/ + +#include + +//We can't do this yet because gcc is too stupid to be able to handle +//different implementations of exception class. + +#undef __UCLIBCXX_EXCEPTION_SUPPORT__ + +#ifdef __UCLIBCXX_EXCEPTION_SUPPORT__ + +namespace std{ + _UCXXEXPORT static char * __std_exception_what_value = "exception"; + + //We are providing our own versions to be sneaky + + + _UCXXEXPORT exception::~exception() throw(){ + //Empty function + } + + _UCXXEXPORT const char* exception::what() const throw(){ + return __std_exception_what_value; + } + + _UCXXEXPORT bad_exception::~bad_exception() throw(){ + + } + + +} + + +#endif diff --git a/misc/uClibc++/libxx/uClib++/fstream.cxx b/misc/uClibc++/libxx/uClib++/fstream.cxx new file mode 100644 index 000000000..535fe9a52 --- /dev/null +++ b/misc/uClibc++/libxx/uClib++/fstream.cxx @@ -0,0 +1,174 @@ +/* Copyright (C) 2004 Garrett A. Kajmowicz + + This file is part of the uClibc++ Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#define __UCLIBCXX_COMPILE_FSTREAM__ 1 + +#include + +namespace std{ + +#ifdef __UCLIBCXX_EXPAND_FSTREAM_CHAR__ + +#ifdef __UCLIBCXX_EXPAND_CONSTRUCTORS_DESTRUCTORS__ + + template _UCXXEXPORT filebuf::basic_filebuf(); + template _UCXXEXPORT filebuf::~basic_filebuf(); + +#endif //__UCLIBCXX_EXPAND_CONSTRUCTORS_DESTRUCTORS__ + + template _UCXXEXPORT filebuf::int_type filebuf::pbackfail(filebuf::int_type c); + template _UCXXEXPORT filebuf * filebuf::open(const char* s, ios_base::openmode mode); + template _UCXXEXPORT filebuf * filebuf::close(); + template _UCXXEXPORT filebuf::int_type filebuf::overflow(filebuf::int_type); + template _UCXXEXPORT filebuf::int_type filebuf::underflow (); + template _UCXXEXPORT streamsize filebuf::xsputn(const char* s, streamsize n); + + template _UCXXEXPORT basic_streambuf >* + filebuf::setbuf(char * s, streamsize n); + + +#ifdef __UCLIBCXX_EXPAND_CONSTRUCTORS_DESTRUCTORS__ + + template _UCXXEXPORT basic_ofstream >::basic_ofstream(); + template _UCXXEXPORT basic_ofstream >::basic_ofstream(const char* s, ios_base::openmode mode); + template _UCXXEXPORT basic_ofstream >::~basic_ofstream(); + + template _UCXXEXPORT basic_ifstream >::basic_ifstream(); + template _UCXXEXPORT basic_ifstream >::basic_ifstream(const char* s, ios_base::openmode mode); + template _UCXXEXPORT basic_ifstream >::~basic_ifstream(); + +#endif //__UCLIBCXX_EXPAND_CONSTRUCTORS_DESTRUCTORS__ + + +#endif + + + +#ifdef __UCLIBCXX_HAS_WCHAR__ + +template <> _UCXXEXPORT basic_filebuf >::int_type + basic_filebuf >::overflow(int_type c) +{ + typedef basic_streambuf > wstreambuf; + typedef char_traits wtraits; + + if(is_open() == false){ + //Can't do much + return wtraits::eof(); + } + + mbstate_t ps = { 0 }; + char out_array[8]; + size_t out_size; + + + if( wstreambuf::pbase() != 0 ){ + + //Write all possible character from the existing array first + size_t chars_written = 0; + while(wstreambuf::pbase() && (wstreambuf::pbase() + chars_written !=wstreambuf::pptr()) ){ + out_size = wcrtomb(out_array, wstreambuf::pbase()[chars_written], &ps); + if(out_size == (size_t)(-1) || fwrite(out_array, out_size, 1, fp) == 0){ + break; + } + ++chars_written; + } + + if( wstreambuf::pbase() + chars_written == wstreambuf::pptr() ){ + wstreambuf::pbump(-chars_written); + }else{ + //Shuffle data back into order + size_t chars_left = wstreambuf::pptr() - wstreambuf::pbase() - chars_written; + for(size_t i = 0; i < chars_left; ++i){ + wstreambuf::pbase()[i] = (wstreambuf::pptr() - chars_written)[i]; + } + return wtraits::eof(); + } + } + + if( !wtraits::eq_int_type(c, wtraits::eof()) ){ + out_size = wcrtomb(out_array, c, &ps); + if(out_size == (size_t)(-1) || fwrite(out_array, out_size, 1, fp) == 0){ + return wtraits::eof(); + } + return c; + } + + return wtraits::not_eof(c); +} + + +template <> _UCXXEXPORT basic_filebuf >::int_type + basic_filebuf >::underflow() +{ + /*Some variables used internally: + Buffer pointers: + + charT * mgbeg; + charT * mgnext; + charT * mgend; + + eback() returns mgbeg + gptr() returns mgnext + egptr() returns mgend + + gbump(int n) mgnext+=n + */ + + typedef char_traits traits; + typedef basic_streambuf wstreambuf; + + + if(wstreambuf::eback() == wstreambuf::gptr() && 0 != wstreambuf::eback()){ //Buffer is full + return traits::to_int_type(*wstreambuf::gptr()); + } + + size_t in_size; + + wchar_t c = 0; + wint_t wi = 0; + in_size = 0; + + wi = fgetwc(fp); + if(WEOF == wi){ + fprintf(stderr, "WEOF returned by fgetwc\n"); + return traits::eof(); + } + + c = traits::to_char_type(wi); + + if(wstreambuf::eback() == 0){ + return traits::to_int_type(c); + } + + for(wchar_t * i = wstreambuf::gptr(); i < wstreambuf::egptr(); ++i){ + *(i-1) = *i; + } + + *(wstreambuf::egptr()-1) = c; + + wstreambuf::mgnext -= 1; + + return traits::to_int_type(*wstreambuf::gptr()); +} + +#endif // __UCLIBCXX_HAS_WCHAR__ + + +} diff --git a/misc/uClibc++/libxx/uClib++/func_exception.cxx b/misc/uClibc++/libxx/uClib++/func_exception.cxx new file mode 100644 index 000000000..fab095f3d --- /dev/null +++ b/misc/uClibc++/libxx/uClib++/func_exception.cxx @@ -0,0 +1,87 @@ +/* Copyright (C) 2004 Garrett A. Kajmowicz + + This file is part of the uClibc++ Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#include +#include +#include +#include + +namespace std{ + +#ifdef __UCLIBCXX_EXCEPTION_SUPPORT__ + +_UCXXEXPORT void __throw_bad_alloc(){ + throw bad_alloc(); +} + +_UCXXEXPORT void __throw_out_of_range( const char * message){ + if(message == 0){ + throw out_of_range(); + } + throw out_of_range(message); +} + +_UCXXEXPORT void __throw_overflow_error( const char * message){ + if(message == 0){ + throw overflow_error(); + } + throw overflow_error(message); +} + +_UCXXEXPORT void __throw_length_error(const char * message){ + if(message == 0){ + throw length_error(); + } + throw length_error(message); +} + +_UCXXEXPORT void __throw_invalid_argument(const char * message){ + if(message == 0){ + throw invalid_argument(); + } + throw invalid_argument(message); +} + +#else + +_UCXXEXPORT void __throw_bad_alloc(){ + abort(); +} + +_UCXXEXPORT void __throw_out_of_range( const char * ){ + abort(); +} + +_UCXXEXPORT void __throw_overflow_error( const char * ){ + abort(); +} + +_UCXXEXPORT void __throw_length_error(const char * ){ + abort(); +} + +_UCXXEXPORT void __throw_invalid_argument(const char *){ + abort(); +} + +#endif + + + +} diff --git a/misc/uClibc++/libxx/uClib++/iomanip.cxx b/misc/uClibc++/libxx/uClib++/iomanip.cxx new file mode 100644 index 000000000..c5e60ccea --- /dev/null +++ b/misc/uClibc++/libxx/uClib++/iomanip.cxx @@ -0,0 +1,29 @@ +/* Copyright (C) 2005 Garrett A. Kajmowicz + + This file is part of the uClibc++ Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#include + +namespace std{ + + + + +} + + diff --git a/misc/uClibc++/libxx/uClib++/ios.cxx b/misc/uClibc++/libxx/uClib++/ios.cxx new file mode 100644 index 000000000..3b85d5be2 --- /dev/null +++ b/misc/uClibc++/libxx/uClib++/ios.cxx @@ -0,0 +1,189 @@ +/* Copyright (C) 2004 Garrett A. Kajmowicz + + This file is part of the uClibc++ Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#define __UCLIBCXX_COMPILE_IOS__ 1 + +#include +#include +#include +#include +#include + +namespace std{ + + +#ifdef __UCLIBCXX_SUPPORT_CDIR__ + _UCXXLOCAL int ios_base::Init::init_cnt = 0; //Needed to ensure the static value is created + +//Create buffers first +#ifdef __UCLIBCXX_SUPPORT_COUT__ + _UCXXEXPORT filebuf _cout_filebuf; +#endif +#ifdef __UCLIBCXX_SUPPORT_CIN__ + _UCXXEXPORT filebuf _cin_filebuf; +#endif +#ifdef __UCLIBCXX_SUPPORT_CERR__ + _UCXXEXPORT filebuf _cerr_filebuf; +#endif +#ifdef __UCLIBCXX_SUPPORT_CLOG__ + _UCXXEXPORT filebuf _clog_filebuf; +#endif +#ifdef __UCLIBCXX_SUPPORT_WCOUT__ + _UCXXEXPORT wfilebuf _wcout_filebuf; +#endif +#ifdef __UCLIBCXX_SUPPORT_WCIN__ + _UCXXEXPORT wfilebuf _wcin_filebuf; +#endif +#ifdef __UCLIBCXX_SUPPORT_WCERR__ + _UCXXEXPORT wfilebuf _wcerr_filebuf; +#endif +#ifdef __UCLIBCXX_SUPPORT_WCLOG__ + _UCXXEXPORT wfilebuf _wclog_filebuf; +#endif + +//Then create streams +#ifdef __UCLIBCXX_SUPPORT_COUT__ + _UCXXEXPORT ostream cout(&_cout_filebuf); +#endif +#ifdef __UCLIBCXX_SUPPORT_CIN__ + _UCXXEXPORT istream cin(&_cin_filebuf); +#endif +#ifdef __UCLIBCXX_SUPPORT_CERR__ + _UCXXEXPORT ostream cerr(&_cerr_filebuf); +#endif +#ifdef __UCLIBCXX_SUPPORT_CLOG__ + _UCXXEXPORT ostream clog(&_clog_filebuf); +#endif +#ifdef __UCLIBCXX_SUPPORT_WCOUT__ + _UCXXEXPORT wostream wcout(&_wcout_filebuf); +#endif +#ifdef __UCLIBCXX_SUPPORT_WCIN__ + _UCXXEXPORT wistream wcin(&_wcin_filebuf); +#endif +#ifdef __UCLIBCXX_SUPPORT_WCERR__ + _UCXXEXPORT wostream wcerr(&_wcerr_filebuf); +#endif +#ifdef __UCLIBCXX_SUPPORT_WCLOG__ + _UCXXEXPORT wostream wclog(&_wclog_filebuf); +#endif + + + _UCXXEXPORT ios_base::Init::Init(){ + if(init_cnt == 0){ //Need to construct cout et al +#ifdef __UCLIBCXX_SUPPORT_COUT__ + _cout_filebuf.fp = stdout; + _cout_filebuf.openedFor = ios_base::out; +#endif +#ifdef __UCLIBCXX_SUPPORT_CERR__ + _cerr_filebuf.fp = stderr; + _cerr_filebuf.openedFor = ios_base::out; + cerr.mformat |= ios_base::unitbuf; +#endif +#ifdef __UCLIBCXX_SUPPORT_CLOG__ + _clog_filebuf.fp = stderr; + _clog_filebuf.openedFor = ios_base::out; +#endif +#ifdef __UCLIBCXX_SUPPORT_CIN__ + _cin_filebuf.fp = stdin; + _cin_filebuf.openedFor = ios_base::in; + +#ifdef __UCLIBCXX_SUPPORT_COUT__ + cin.tie(&cout); +#endif + +#endif +#ifdef __UCLIBCXX_SUPPORT_WCOUT__ + _wcout_filebuf.fp = stdout; + _wcout_filebuf.openedFor = ios_base::out; +#endif +#ifdef __UCLIBCXX_SUPPORT_WCERR__ + _wcerr_filebuf.fp = stderr; + _wcerr_filebuf.openedFor = ios_base::out; + wcerr.mformat |= ios_base::unitbuf; +#endif +#ifdef __UCLIBCXX_SUPPORT_WCLOG__ + _wclog_filebuf.fp = stderr; + _wclog_filebuf.openedFor = ios_base::out; +#endif +#ifdef __UCLIBCXX_SUPPORT_WCIN__ + _wcin_filebuf.fp = stdin; + _wcin_filebuf.openedFor = ios_base::in; + +#ifdef __UCLIBCXX_SUPPORT_WCOUT__ + wcin.tie(&wcout); +#endif + +#endif + } + init_cnt++; + } + + _UCXXEXPORT ios_base::Init::~Init(){ + --init_cnt; + if(init_cnt==0){ + + } + } +#endif + + +#ifdef __UCLIBCXX_EXPAND_IOS_CHAR__ + + template _UCXXEXPORT void basic_ios >::clear(iostate state); + template _UCXXEXPORT void basic_ios >::setstate(iostate state); + +#endif + + + _UCXXEXPORT ios_base::fmtflags ios_base::flags(fmtflags fmtfl){ + fmtflags temp = mformat; + mformat = fmtfl; + return temp; + } + + _UCXXEXPORT ios_base::fmtflags ios_base::setf(fmtflags fmtfl){ + return flags(flags() | fmtfl); + } + + _UCXXEXPORT ios_base::fmtflags ios_base::setf(fmtflags fmtfl, fmtflags mask ){ + return flags( (flags()& ~mask) | (fmtfl & mask)); + } + + _UCXXEXPORT streamsize ios_base::precision(streamsize prec){ + streamsize temp = mprecision; + mprecision = prec; + return temp; + } + + _UCXXEXPORT streamsize ios_base::width(streamsize wide){ + streamsize temp = mwidth; + mwidth = wide; + return temp; + } + + _UCXXEXPORT locale ios_base::imbue(const locale& loc){ + locale retval = mLocale; + mLocale = loc; + return retval; + } + +} + + + diff --git a/misc/uClibc++/libxx/uClib++/iostream.cxx b/misc/uClibc++/libxx/uClib++/iostream.cxx new file mode 100644 index 000000000..7a190a2bf --- /dev/null +++ b/misc/uClibc++/libxx/uClib++/iostream.cxx @@ -0,0 +1,38 @@ +/* Copyright (C) 2004 Garrett A. Kajmowicz + + This file is part of the uClibc++ Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#define __UCLIBCXX_COMPILE_IOSTREAM__ 1 + +#include + +namespace std{ + +#ifdef __UCLIBCXX_EXPAND_OSTREAM_CHAR__ +#ifdef __UCLIBCXX_EXPAND_ISTREAM_CHAR__ + + template _UCXXEXPORT basic_iostream >:: + basic_iostream(basic_streambuf >* sb); + template _UCXXEXPORT basic_iostream >::~basic_iostream(); + +#endif +#endif + +} + + diff --git a/misc/uClibc++/libxx/uClib++/istream.cxx b/misc/uClibc++/libxx/uClib++/istream.cxx new file mode 100644 index 000000000..9e9613973 --- /dev/null +++ b/misc/uClibc++/libxx/uClib++/istream.cxx @@ -0,0 +1,75 @@ +/* Copyright (C) 2004 Garrett A. Kajmowicz + + This file is part of the uClibc++ Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +*/ + +#define __UCLIBCXX_COMPILE_ISTREAM__ 1 + +#include + + +namespace std{ + +#ifdef __UCLIBCXX_EXPAND_ISTREAM_CHAR__ + + template <> _UCXXEXPORT string _readToken >(istream & stream) + { + string temp; + char_traits::int_type c; + while(true){ + c = stream.rdbuf()->sgetc(); + if(c != char_traits::eof() && isspace(c) == false){ + stream.rdbuf()->sbumpc(); + temp.append(1, char_traits::to_char_type(c)); + }else{ + break; + } + } + if (temp.size() == 0) + stream.setstate(ios_base::eofbit|ios_base::failbit); + + return temp; + } + + template _UCXXEXPORT istream::int_type istream::get(); + template _UCXXEXPORT istream & istream::get(char &c); + + template _UCXXEXPORT istream & istream::operator>>(bool &n); + template _UCXXEXPORT istream & istream::operator>>(short &n); + template _UCXXEXPORT istream & istream::operator>>(unsigned short &n); + template _UCXXEXPORT istream & istream::operator>>(int &n); + template _UCXXEXPORT istream & istream::operator>>(unsigned int &n); + template _UCXXEXPORT istream & istream::operator>>(long unsigned &n); + template _UCXXEXPORT istream & istream::operator>>(long int &n); + template _UCXXEXPORT istream & istream::operator>>(void *& p); + template _UCXXEXPORT istream & operator>>(istream & is, char & c); + + +#ifdef __UCLIBCXX_HAS_FLOATS__ + template _UCXXEXPORT istream & istream::operator>>(float &f); + template _UCXXEXPORT istream & istream::operator>>(double &f); + template _UCXXEXPORT istream & istream::operator>>(long double &f); +#endif + + template _UCXXEXPORT void __skipws(basic_istream >& is); + +#endif + + +} + diff --git a/misc/uClibc++/libxx/uClib++/iterator.cxx b/misc/uClibc++/libxx/uClib++/iterator.cxx new file mode 100644 index 000000000..2e21517a2 --- /dev/null +++ b/misc/uClibc++/libxx/uClib++/iterator.cxx @@ -0,0 +1,28 @@ +/* Copyright (C) 2004 Garrett A. Kajmowicz + + This file is part of the uClibc++ Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#include + +namespace std{ + + + +} + + diff --git a/misc/uClibc++/libxx/uClib++/limits.cxx b/misc/uClibc++/libxx/uClib++/limits.cxx new file mode 100644 index 000000000..0fd42d577 --- /dev/null +++ b/misc/uClibc++/libxx/uClib++/limits.cxx @@ -0,0 +1,25 @@ +/* Copyright (C) 2006 Garrett A. Kajmowicz + This file is part of the uClibc++ Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +*/ + +#include + +namespace std{ + + +} diff --git a/misc/uClibc++/libxx/uClib++/list.cxx b/misc/uClibc++/libxx/uClib++/list.cxx new file mode 100644 index 000000000..cfc44e079 --- /dev/null +++ b/misc/uClibc++/libxx/uClib++/list.cxx @@ -0,0 +1,29 @@ +/* Copyright (C) 2004 Garrett A. Kajmowicz + + This file is part of the uClibc++ Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#include + +namespace std{ + + + + +} + + diff --git a/misc/uClibc++/libxx/uClib++/locale.cxx b/misc/uClibc++/libxx/uClib++/locale.cxx new file mode 100644 index 000000000..bc41792df --- /dev/null +++ b/misc/uClibc++/libxx/uClib++/locale.cxx @@ -0,0 +1,29 @@ +/* Copyright (C) 2004 Garrett A. Kajmowicz + + This file is part of the uClibc++ Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#include +#include +#include +#include +#include + +namespace std{ + +} + diff --git a/misc/uClibc++/libxx/uClib++/map.cxx b/misc/uClibc++/libxx/uClib++/map.cxx new file mode 100644 index 000000000..06e56a0bb --- /dev/null +++ b/misc/uClibc++/libxx/uClib++/map.cxx @@ -0,0 +1,33 @@ +/* Copyright (C) 2004 Garrett A. Kajmowicz + This file is part of the uClibc++ Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +*/ + +#include + +namespace std{ + + + + + + + + + + +} diff --git a/misc/uClibc++/libxx/uClib++/new_handler.cxx b/misc/uClibc++/libxx/uClib++/new_handler.cxx new file mode 100644 index 000000000..1d85ee3fa --- /dev/null +++ b/misc/uClibc++/libxx/uClib++/new_handler.cxx @@ -0,0 +1,31 @@ +/* Copyright (C) 2005 Garrett A. Kajmowicz + + This file is part of the uClibc++ Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#include + +const std::nothrow_t std::nothrow = { }; + +//Name selected to be compatable with g++ code +std::new_handler __new_handler; + +_UCXXEXPORT std::new_handler std::set_new_handler(std::new_handler new_p) throw(){ + std::new_handler retval = __new_handler; + __new_handler = new_p; + return retval; +} diff --git a/misc/uClibc++/libxx/uClib++/new_op.cxx b/misc/uClibc++/libxx/uClib++/new_op.cxx new file mode 100644 index 000000000..764eb835c --- /dev/null +++ b/misc/uClibc++/libxx/uClib++/new_op.cxx @@ -0,0 +1,35 @@ +/* Copyright (C) 2004 Garrett A. Kajmowicz + + This file is part of the uClibc++ Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#include +#include +#include + +_UCXXEXPORT void* operator new(std::size_t numBytes) throw(std::bad_alloc){ + //C++ stardard 5.3.4.8 requires that a valid pointer be returned for + //a call to new(0). Thus: + if(numBytes == 0){ + numBytes = 1; + } + void * p = malloc(numBytes); + if(p == 0){ + std::__throw_bad_alloc(); + } + return p; +} diff --git a/misc/uClibc++/libxx/uClib++/new_opnt.cxx b/misc/uClibc++/libxx/uClib++/new_opnt.cxx new file mode 100644 index 000000000..cffce610b --- /dev/null +++ b/misc/uClibc++/libxx/uClib++/new_opnt.cxx @@ -0,0 +1,28 @@ +/* Copyright (C) 2004 Garrett A. Kajmowicz + + This file is part of the uClibc++ Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#include +#include +#include + +#ifndef NO_NOTHROW +_UCXXEXPORT void* operator new(std::size_t numBytes, const std::nothrow_t& ) throw(){ + return malloc(numBytes); +} +#endif diff --git a/misc/uClibc++/libxx/uClib++/new_opv.cxx b/misc/uClibc++/libxx/uClib++/new_opv.cxx new file mode 100644 index 000000000..ef416e07b --- /dev/null +++ b/misc/uClibc++/libxx/uClib++/new_opv.cxx @@ -0,0 +1,35 @@ +/* Copyright (C) 2004 Garrett A. Kajmowicz + + This file is part of the uClibc++ Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#include +#include +#include + +_UCXXEXPORT void* operator new[](std::size_t numBytes) throw(std::bad_alloc){ + //C++ stardard 5.3.4.8 requires that a valid pointer be returned for + //a call to new(0). Thus: + if(numBytes == 0){ + numBytes = 1; + } + void * p = malloc(numBytes); + if(p == 0){ + std::__throw_bad_alloc(); + } + return p; +} diff --git a/misc/uClibc++/libxx/uClib++/new_opvnt.cxx b/misc/uClibc++/libxx/uClib++/new_opvnt.cxx new file mode 100644 index 000000000..3ea592afb --- /dev/null +++ b/misc/uClibc++/libxx/uClib++/new_opvnt.cxx @@ -0,0 +1,28 @@ +/* Copyright (C) 2004 Garrett A. Kajmowicz + + This file is part of the uClibc++ Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#include +#include +#include + +#ifndef NO_NOTHROW +_UCXXEXPORT void* operator new[](std::size_t numBytes, const std::nothrow_t& ) throw(){ + return malloc(numBytes); +} +#endif diff --git a/misc/uClibc++/libxx/uClib++/numeric.cxx b/misc/uClibc++/libxx/uClib++/numeric.cxx new file mode 100644 index 000000000..eb93f2eb7 --- /dev/null +++ b/misc/uClibc++/libxx/uClib++/numeric.cxx @@ -0,0 +1,27 @@ +/* Copyright (C) 2004 Garrett A. Kajmowicz + + This file is part of the uClibc++ Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#include + +namespace std{ + + +} + + diff --git a/misc/uClibc++/libxx/uClib++/ostream.cxx b/misc/uClibc++/libxx/uClib++/ostream.cxx new file mode 100644 index 000000000..0973871b0 --- /dev/null +++ b/misc/uClibc++/libxx/uClib++/ostream.cxx @@ -0,0 +1,65 @@ +/* Copyright (C) 2004 Garrett A. Kajmowicz + + This file is part of the uClibc++ Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#define __UCLIBCXX_COMPILE_OSTREAM__ 1 + +#include + +namespace std{ + + +#ifdef __UCLIBCXX_EXPAND_OSTREAM_CHAR__ + +#ifdef __UCLIBCXX_EXPAND_CONSTRUCTORS_DESTRUCTORS__ + template _UCXXEXPORT ostream::~basic_ostream(); +#endif //__UCLIBCXX_EXPAND_CONSTRUCTORS_DESTRUCTORS__ + + template _UCXXEXPORT ostream & ostream::flush(); + + template _UCXXEXPORT ostream & ostream::operator<<(bool n); + template _UCXXEXPORT ostream & ostream::operator<<(short int n); + template _UCXXEXPORT ostream & ostream::operator<<(unsigned short int n); + template _UCXXEXPORT ostream & ostream::operator<<(int n); + template _UCXXEXPORT ostream & ostream::operator<<(unsigned int n); + template _UCXXEXPORT ostream & ostream::operator<<(long n); + template _UCXXEXPORT ostream & ostream::operator<<(unsigned long n); + template _UCXXEXPORT ostream & ostream::operator<<(float f); + template _UCXXEXPORT ostream & ostream::operator<<(double f); + template _UCXXEXPORT ostream & ostream::operator<<(long double f); + template _UCXXEXPORT ostream & ostream::operator<<(void* p); + template _UCXXEXPORT ostream & ostream::operator<<(basic_streambuf >* sb); + +#ifdef __UCLIBCXX_EXPAND_CONSTRUCTORS_DESTRUCTORS__ + + template _UCXXEXPORT ostream::sentry::sentry(ostream & os); + template _UCXXEXPORT ostream::sentry::~sentry(); + +#endif //__UCLIBCXX_EXPAND_CONSTRUCTORS_DESTRUCTORS__ + + template _UCXXEXPORT ostream & endl(ostream & os); + template _UCXXEXPORT ostream & flush(ostream & os); + template _UCXXEXPORT ostream & operator<<(ostream & out, char c); + template _UCXXEXPORT ostream & operator<<(ostream & out, const char* c); + template _UCXXEXPORT ostream & operator<<(ostream & out, unsigned char c); + template _UCXXEXPORT ostream & operator<<(ostream & out, const unsigned char* c); + +#endif + + +} diff --git a/misc/uClibc++/libxx/uClib++/queue.cxx b/misc/uClibc++/libxx/uClib++/queue.cxx new file mode 100644 index 000000000..356efeb13 --- /dev/null +++ b/misc/uClibc++/libxx/uClib++/queue.cxx @@ -0,0 +1,27 @@ +/* Copyright (C) 2004 Garrett A. Kajmowicz + This file is part of the uClibc++ Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#include + + +namespace std{ + + + + +} diff --git a/misc/uClibc++/libxx/uClib++/set.cxx b/misc/uClibc++/libxx/uClib++/set.cxx new file mode 100644 index 000000000..61ec56a71 --- /dev/null +++ b/misc/uClibc++/libxx/uClib++/set.cxx @@ -0,0 +1,33 @@ +/* Copyright (C) 2004 Garrett A. Kajmowicz + This file is part of the uClibc++ Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +*/ + +#include + +namespace std{ + + + + + + + + + + +} diff --git a/misc/uClibc++/libxx/uClib++/sstream.cxx b/misc/uClibc++/libxx/uClib++/sstream.cxx new file mode 100644 index 000000000..e712b6764 --- /dev/null +++ b/misc/uClibc++/libxx/uClib++/sstream.cxx @@ -0,0 +1,59 @@ +/* Copyright (C) 2004 Garrett A. Kajmowicz + + This file is part of the uClibc++ Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#define __UCLIBCXX_COMPILE_SSTREAM__ 1 + +#include + +namespace std{ + +#ifdef __UCLIBCXX_EXPAND_SSTREAM_CHAR__ + + typedef char_traits tr_ch; + typedef basic_stringbuf > char_stringbuf; + +#ifdef __UCLIBCXX_EXPAND_CONSTRUCTORS_DESTRUCTORS__ + + template _UCXXEXPORT char_stringbuf::basic_stringbuf(ios_base::openmode which); + template _UCXXEXPORT char_stringbuf::~basic_stringbuf(); + +#endif //__UCLIBCXX_EXPAND_CONSTRUCTORS_DESTRUCTORS__ + + template _UCXXEXPORT basic_string, allocator > char_stringbuf::str() const; + template _UCXXEXPORT char_stringbuf::int_type char_stringbuf::pbackfail(char_stringbuf::int_type c); + template _UCXXEXPORT char_stringbuf::int_type char_stringbuf::overflow(char_stringbuf::int_type c); + template _UCXXEXPORT char_stringbuf::pos_type + char_stringbuf::seekoff(char_stringbuf::off_type, ios_base::seekdir, ios_base::openmode); + template _UCXXEXPORT char_stringbuf::int_type char_stringbuf::underflow (); + template _UCXXEXPORT streamsize char_stringbuf::xsputn(const char* s, streamsize n); + +#ifdef __UCLIBCXX_EXPAND_CONSTRUCTORS_DESTRUCTORS__ + + template _UCXXEXPORT basic_stringstream >::basic_stringstream(ios_base::openmode which); + template _UCXXEXPORT basic_istringstream >::~basic_istringstream(); + template _UCXXEXPORT basic_ostringstream >::~basic_ostringstream(); + template _UCXXEXPORT basic_stringstream >::~basic_stringstream(); + +#endif //__UCLIBCXX_EXPAND_CONSTRUCTORS_DESTRUCTORS__ + +#endif + +} + + diff --git a/misc/uClibc++/libxx/uClib++/stack.cxx b/misc/uClibc++/libxx/uClib++/stack.cxx new file mode 100644 index 000000000..53a21bba5 --- /dev/null +++ b/misc/uClibc++/libxx/uClib++/stack.cxx @@ -0,0 +1,27 @@ +/* Copyright (C) 2004 Garrett A. Kajmowicz + This file is part of the uClibc++ Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#include + + +namespace std{ + + + + +} diff --git a/misc/uClibc++/libxx/uClib++/stdexcept.cxx b/misc/uClibc++/libxx/uClib++/stdexcept.cxx new file mode 100644 index 000000000..90dccc7a4 --- /dev/null +++ b/misc/uClibc++/libxx/uClib++/stdexcept.cxx @@ -0,0 +1,63 @@ +/* Copyright (C) 2004 Garrett A. Kajmowicz + + This file is part of the uClibc++ Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#include +#include + +#ifdef __UCLIBCXX_EXCEPTION_SUPPORT__ + +namespace std{ + + _UCXXEXPORT logic_error::logic_error() throw() : mstring(){ + + } + + _UCXXEXPORT logic_error::logic_error(const string& what_arg) : mstring(what_arg){ + + } + + _UCXXEXPORT const char * logic_error::what() const throw(){ + return mstring.c_str(); + } + + + _UCXXEXPORT out_of_range::out_of_range() : logic_error(){ + + } + + _UCXXEXPORT out_of_range::out_of_range(const string & what_arg) : logic_error(what_arg) { + + } + + _UCXXEXPORT runtime_error::runtime_error() : mstring(){ + + } + + _UCXXEXPORT runtime_error::runtime_error(const string& what_arg) : mstring(what_arg){ + + } + + _UCXXEXPORT const char * runtime_error::what() const throw(){ + return mstring.c_str(); + } + +} + +#endif + diff --git a/misc/uClibc++/libxx/uClib++/streambuf.cxx b/misc/uClibc++/libxx/uClib++/streambuf.cxx new file mode 100644 index 000000000..541732459 --- /dev/null +++ b/misc/uClibc++/libxx/uClib++/streambuf.cxx @@ -0,0 +1,49 @@ +/* Copyright (C) 2004 Garrett A. Kajmowicz + + This file is part of the uClibc++ Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#define __UCLIBCXX_COMPILE_STREAMBUF__ 1 + +#include + +namespace std{ + +#ifdef __UCLIBCXX_EXPAND_STREAMBUF_CHAR__ + +#ifdef __UCLIBCXX_EXPAND_CONSTRUCTORS_DESTRUCTORS__ + + template _UCXXEXPORT streambuf::basic_streambuf(); + template _UCXXEXPORT streambuf::~basic_streambuf(); + +#endif + + template _UCXXEXPORT locale streambuf::pubimbue(const locale &loc); + template _UCXXEXPORT streamsize streambuf::in_avail(); + template _UCXXEXPORT streambuf::int_type streambuf::sbumpc(); + template _UCXXEXPORT streambuf::int_type streambuf::snextc(); + template _UCXXEXPORT streambuf::int_type streambuf::sgetc(); + template _UCXXEXPORT streambuf::int_type streambuf::sputbackc(char_type c); + template _UCXXEXPORT streambuf::int_type streambuf::sungetc(); + template _UCXXEXPORT streambuf::int_type streambuf::sputc(char_type c); + +#endif + + +} + + diff --git a/misc/uClibc++/libxx/uClib++/string.cxx b/misc/uClibc++/libxx/uClib++/string.cxx new file mode 100644 index 000000000..1edf69b5d --- /dev/null +++ b/misc/uClibc++/libxx/uClib++/string.cxx @@ -0,0 +1,112 @@ +/* Copyright (C) 2004 Garrett A. Kajmowicz + + This file is part of the uClibc++ Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#define __UCLIBCXX_COMPILE_STRING__ 1 + +#include +#include +#include +#include +#include +#include + +namespace std{ + +#ifdef __UCLIBCXX_EXPAND_STRING_CHAR__ + +#ifdef __UCLIBCXX_EXPAND_CONSTRUCTORS_DESTRUCTORS__ + + template _UCXXEXPORT string::basic_string(const allocator &); + template _UCXXEXPORT string::basic_string(size_type n, char c, const allocator & ); + template _UCXXEXPORT string::basic_string(const char* s, const allocator& al); + template _UCXXEXPORT string::basic_string(const basic_string& str, size_type pos, size_type n, const allocator& al); + template _UCXXEXPORT string::~basic_string(); + +#endif // __UCLIBCXX_EXPAND_CONSTRUCTORS_DESTRUCTORS__ + + template _UCXXEXPORT string & string::append(const char * s, size_type n); + + template _UCXXEXPORT string::size_type string::find(const string & str, size_type pos) const; + template _UCXXEXPORT string::size_type string::find(const char* s, size_type pos) const; + template _UCXXEXPORT string::size_type string::find (char c, size_type pos) const; + template _UCXXEXPORT string::size_type string::rfind(const string & str, size_type pos) const; + template _UCXXEXPORT string::size_type string::rfind(char c, size_type pos) const; + template _UCXXEXPORT string::size_type string::rfind(const char* s, size_type pos) const; + + template _UCXXEXPORT string::size_type string::find_first_of(const string &, size_type) const; + template _UCXXEXPORT string::size_type string::find_first_of(const char *, size_type pos, size_type n) const; + template _UCXXEXPORT string::size_type string::find_first_of(const char*, size_type pos) const; + template _UCXXEXPORT string::size_type string::find_first_of(char c, size_type pos) const; + + template _UCXXEXPORT string::size_type string::find_last_of (const string & , size_type pos) const; + template _UCXXEXPORT string::size_type string::find_last_of (const char* s, size_type pos, size_type n) const; + template _UCXXEXPORT string::size_type string::find_last_of (const char* s, size_type pos) const; + template _UCXXEXPORT string::size_type string::find_last_of (char c, size_type pos) const; + + template _UCXXEXPORT string::size_type string::find_first_not_of(const string &, size_type) const; + template _UCXXEXPORT string::size_type string::find_first_not_of(const char*, size_type, size_type) const; + template _UCXXEXPORT string::size_type string::find_first_not_of(const char*, size_type) const; + template _UCXXEXPORT string::size_type string::find_first_not_of(char c, size_type) const; + + template _UCXXEXPORT int string::compare(const string & str) const; +// template _UCXXEXPORT int string::compare(size_type pos1, size_type n1, const string & str) const; + template _UCXXEXPORT int string::compare( + size_type pos1, size_type n1, const string & str, size_type pos2, size_type n2) const; + + template _UCXXEXPORT string string::substr(size_type pos, size_type n) const; + + template _UCXXEXPORT string & string::operator=(const string & str); + template _UCXXEXPORT string & string::operator=(const char * s); + + template _UCXXEXPORT bool operator==(const string & lhs, const string & rhs); + template _UCXXEXPORT bool operator==(const char * lhs, const string & rhs); + template _UCXXEXPORT bool operator==(const string & lhs, const char * rhs); + + template _UCXXEXPORT bool operator!=(const string & lhs, const string & rhs); + template _UCXXEXPORT bool operator!=(const char * lhs, const string & rhs); + template _UCXXEXPORT bool operator!=(const string & lhs, const char * rhs); + + template _UCXXEXPORT string operator+(const string & lhs, const char* rhs); + template _UCXXEXPORT string operator+(const char* lhs, const string & rhs); + template _UCXXEXPORT string operator+(const string & lhs, const string & rhs); + + template _UCXXEXPORT bool operator> (const string & lhs, const string & rhs); + template _UCXXEXPORT bool operator< (const string & lhs, const string & rhs); + + +//Functions dependent upon OSTREAM +#ifdef __UCLIBCXX_EXPAND_OSTREAM_CHAR__ + +template _UCXXEXPORT ostream & operator<<(ostream & os, const string & str); + +#endif + + +//Functions dependent upon ISTREAM +#ifdef __UCLIBCXX_EXPAND_ISTREAM_CHAR__ + +template _UCXXEXPORT istream & operator>>(istream & is, string & str); + + +#endif + + +#endif + +} diff --git a/misc/uClibc++/libxx/uClib++/support.cxx b/misc/uClibc++/libxx/uClib++/support.cxx new file mode 100644 index 000000000..875459442 --- /dev/null +++ b/misc/uClibc++/libxx/uClib++/support.cxx @@ -0,0 +1,53 @@ +/* Copyright (C) 2004 Garrett A. Kajmowicz + + This file is part of the uClibc++ Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#include + +extern "C" void *__cxa_allocate_exception(size_t thrown_size){ + void * retval; + +// The amount of data needed is the size of the object *PLUS* +// the size of the header. The header is of struct __cxa_exception +// The address needs to be adjusted because the pointer we return +// should not point to the start of the memory, but to the point +// where the object being thrown actually starts +// + retval = malloc(thrown_size + sizeof(__cxa_exception)); + +// Check to see that we actuall allocated memory + if(retval == 0){ + std::terminate(); + } + + //Need to do a typecast to char* otherwize we are doing math with + //a void* which makes the compiler cranky (Like me) + return ((char *)retval + sizeof(__cxa_exception)); +} + +extern "C" void __cxa_free_exception(void *thrown_exception){ + + + +} + +extern "C" void __cxa_throw (void *thrown_exception, void *info,void (*dest) (void *) ){ + + +} + diff --git a/misc/uClibc++/libxx/uClib++/typeinfo.cxx b/misc/uClibc++/libxx/uClib++/typeinfo.cxx new file mode 100644 index 000000000..b8ea30197 --- /dev/null +++ b/misc/uClibc++/libxx/uClib++/typeinfo.cxx @@ -0,0 +1,34 @@ +/* Copyright (C) 2004 Garrett A. Kajmowicz + + This file is part of the uClibc++ Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#include + +namespace std{ + + _UCXXEXPORT bad_cast::~bad_cast() throw(){ + + } + + _UCXXEXPORT bad_typeid::~bad_typeid() throw(){ + + } + +} + + diff --git a/misc/uClibc++/libxx/uClib++/utility.cxx b/misc/uClibc++/libxx/uClib++/utility.cxx new file mode 100644 index 000000000..b2f8995d7 --- /dev/null +++ b/misc/uClibc++/libxx/uClib++/utility.cxx @@ -0,0 +1,30 @@ +/* Copyright (C) 2004 Garrett A. Kajmowicz + This file is part of the uClibc++ Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +*/ + + +#include + + +namespace std{ + + + +} + + diff --git a/misc/uClibc++/libxx/uClib++/valarray.cxx b/misc/uClibc++/libxx/uClib++/valarray.cxx new file mode 100644 index 000000000..e4bd504cf --- /dev/null +++ b/misc/uClibc++/libxx/uClib++/valarray.cxx @@ -0,0 +1,29 @@ +/* Copyright (C) 2004 Garrett A. Kajmowicz + + This file is part of the uClibc++ Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#include + +namespace std{ + + + + +} + + diff --git a/misc/uClibc++/libxx/uClib++/vector.cxx b/misc/uClibc++/libxx/uClib++/vector.cxx new file mode 100644 index 000000000..5ee0de188 --- /dev/null +++ b/misc/uClibc++/libxx/uClib++/vector.cxx @@ -0,0 +1,83 @@ +/* Copyright (C) 2004 Garrett A. Kajmowicz + + This file is part of the uClibc++ Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#define __UCLIBCXX_COMPILE_VECTOR__ 1 + + +#include + +namespace std{ + + +#ifdef __UCLIBCXX_EXPAND_VECTOR_BASIC__ + +#ifdef __UCLIBCXX_EXPAND_CONSTRUCTORS_DESTRUCTORS__ + + template _UCXXEXPORT vector >::vector(const allocator& al); + template _UCXXEXPORT vector >::vector(size_type n, const char & value, const allocator & al); + + template _UCXXEXPORT vector >::~vector(); + template _UCXXEXPORT vector >::~vector(); + +#endif //__UCLIBCXX_EXPAND_CONSTRUCTORS_DESTRUCTORS__ + + template _UCXXEXPORT void vector >::reserve(size_type n); + template _UCXXEXPORT void vector >::reserve(size_type n); + template _UCXXEXPORT void vector >::reserve(size_type n); + template _UCXXEXPORT void vector >::reserve(size_type n); + template _UCXXEXPORT void vector >::reserve(size_type n); + template _UCXXEXPORT void vector >::reserve(size_type n); + template _UCXXEXPORT void vector >::reserve(size_type n); + template _UCXXEXPORT void vector >::reserve(size_type n); + template _UCXXEXPORT void vector >::reserve(size_type n); + template _UCXXEXPORT void vector >::reserve(size_type n); + template _UCXXEXPORT void vector >::reserve(size_type n); + + template _UCXXEXPORT void vector >::resize(size_type sz, const char & c); + template _UCXXEXPORT void vector >::resize(size_type sz, const unsigned char & c); + template _UCXXEXPORT void vector >::resize(size_type sz, const short & c); + template _UCXXEXPORT void vector > + ::resize(size_type sz, const unsigned short int & c); + template _UCXXEXPORT void vector >::resize(size_type sz, const int & c); + template _UCXXEXPORT void vector >::resize(size_type sz, const unsigned int & c); + template _UCXXEXPORT void vector >::resize(size_type sz, const long int & c); + template _UCXXEXPORT void vector >:: + resize(size_type sz, const unsigned long int & c); + template _UCXXEXPORT void vector >::resize(size_type sz, const float & c); + template _UCXXEXPORT void vector >::resize(size_type sz, const double & c); + template _UCXXEXPORT void vector >::resize(size_type sz, const bool & c); + +#elif defined __UCLIBCXX_EXPAND_STRING_CHAR__ + + +#ifdef __UCLIBCXX_EXPAND_CONSTRUCTORS_DESTRUCTORS__ + template _UCXXEXPORT vector >::vector(const allocator& al); + template _UCXXEXPORT vector >::vector(size_type n, const char & value, const allocator & al); + template _UCXXEXPORT vector >::~vector(); +#endif // __UCLIBCXX_EXPAND_CONSTRUCTORS_DESTRUCTORS__ + + template _UCXXEXPORT void vector >::reserve(size_type n); + template _UCXXEXPORT void vector >::resize(size_type sz, const char & c); + +#endif + + + + +} -- cgit v1.2.3