delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/1999/11/16/03:32:42

Date: Tue, 16 Nov 1999 10:00:46 +0200 (WET)
From: Andris Pavenis <pavenis AT lanet DOT lv>
To: "Markus F.X.J. Oberhumer" <markus DOT oberhumer AT jk DOT uni-linz DOT ac DOT at>
cc: djgpp-workers AT delorie DOT com
Subject: Re: gcc 2.95.2 & STL
In-Reply-To: <XFMail.991116070230.markus.oberhumer@jk.uni-linz.ac.at>
Message-ID: <Pine.A41.4.05.9911160953020.144866-100000@ieva01.lanet.lv>
MIME-Version: 1.0
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

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 <bits/std_cstdio.h>
#    include <bits/std_cstdlib.h>
#    define __THROW_BAD_ALLOC fprintf(stderr, "out of memory\n"); exit(1)
#  else /* Standard conforming out-of-memory handling */
#    include <bits/std_new.h>
#    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 <new>
>  #   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 <vector>
> 
> #ifdef __DJGPP__
> void (*__malloc_alloc_template<0>::__malloc_alloc_oom_handler)() = 0;
> #ifndef __USE_MALLOC
> template class  __default_alloc_template<false, 0>;
> #endif
> #endif
> 
> 
> thanks for any info on this,
> Markus
> 
> 
> ----   Markus F.X.J. Oberhumer <markus DOT oberhumer AT jk DOT uni-linz DOT ac DOT at>   ----
> ----             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
> 
> 

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019