Date: Tue, 16 Nov 1999 10:00:46 +0200 (WET) From: Andris Pavenis To: "Markus F.X.J. Oberhumer" cc: djgpp-workers AT delorie DOT com Subject: Re: gcc 2.95.2 & STL In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Reply-To: djgpp-workers AT delorie DOT com X-Mailing-List: djgpp-workers AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk I haven't really messed much with patching STL when I built gcc-2.95.2 (other than renaming some files and doing changes related to this renaming). Maybe it's better to ask this in gcc mailing list. Or look for libstdc++ development versions. I tested current CVS tree usess something like // This implements some standard node allocators. These are // NOT the same as the allocators in the C++ draft standard or in // in the original STL. They do not encapsulate different pointer // types; indeed we assume that there is only one pointer type. // The allocation primitives are intended to allocate individual objects, // not larger arenas as with the original STL allocators. #ifndef __THROW_BAD_ALLOC # if defined(__STL_NO_BAD_ALLOC) || !defined(__STL_USE_EXCEPTIONS) # include # include # define __THROW_BAD_ALLOC fprintf(stderr, "out of memory\n"); exit(1) # else /* Standard conforming out-of-memory handling */ # include # define __THROW_BAD_ALLOC throw std::bad_alloc() # endif #endif On Tue, 16 Nov 1999, Markus F.X.J. Oberhumer wrote: > Is there a specific reasons we don't use exceptions > in the djgpp version ? Here's the relevant diff against > my Linux gcc 2.95.2 include file. > > --- /usr/include/g++-3/stl_alloc.h Mon Oct 25 10:42:28 1999 > +++ /DOS/c/lang/c/djgpp2/lang/cxx/stl_alloc.h Tue Oct 26 01:55:46 1999 > @@ -38,7 +38,7 @@ > // The allocation primitives are intended to allocate individual objects, > // not larger arenas as with the original STL allocators. > > -#ifdef __STL_USE_EXCEPTIONS > +#if 0 > # include > # define __THROW_BAD_ALLOC throw bad_alloc() > #elif !defined(__THROW_BAD_ALLOC) > > > On a related issue there still seem some collect2 problems - > e.g. I have to use these manual template instatiations > to avoid linking -lstdcxx. Again, I don't need that > on Linux: > > #ifdef __DJGPP__ > # define __THROW_BAD_ALLOC throw bad_alloc() > # define __USE_MALLOC > #endif > > #include > > #ifdef __DJGPP__ > void (*__malloc_alloc_template<0>::__malloc_alloc_oom_handler)() = 0; > #ifndef __USE_MALLOC > template class __default_alloc_template; > #endif > #endif > > > thanks for any info on this, > Markus > > > ---- Markus F.X.J. Oberhumer ---- > ---- http://wildsau.idv.uni-linz.ac.at/mfx/ ---- > ---- 5E CB 5C 85 DE AF 9E BF E9 DA 7E 6A 39 F8 CC 67 ---- > > 3 WARPS TO URANUS > >