/* Copyright (c) 1997-2004
   Ewgenij Gawrilow, Michael Joswig (Technische Universitaet Berlin, Germany)
   http://www.math.tu-berlin.de/polymake,  mailto:polymake@math.tu-berlin.de

   This program is free software; you can redistribute it and/or modify it
   under the terms of the GNU General Public License as published by the
   Free Software Foundation; either version 2, or (at your option) any
   later version: http://www.gnu.org/licenses/gpl.txt.

   This program 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 General Public License for more details.
*/

#ifndef _POLYMAKE_STD_STL_ALLOC_H
#define _POLYMAKE_STD_STL_ALLOC_H "$Project: polymake $$Id: stl_alloc.h,v 1.11 2004/06/22 16:22:41 gawrilow Exp $"

#if defined(__COMO__)

# include <stl_config.h>
# include_next <stl_alloc.h>

#elif defined(__GNUC__)

# if __GNUC__ > 3 || ( __GNUC__ == 3 && __GNUC_MINOR__ >= 3 )
#  define _POLYMAKE_LACKING_REALLOCATE
# endif
# include_next <bits/stl_alloc.h>

#endif // __GNUC__

namespace pm {

#if defined(__COMO__)
   typedef std::single_client_alloc raw_alloc;
#elif defined(__GNUC__)
# if __GNUC__ == 3 && __GNUC_MINOR__ >= 1
   typedef std::__single_client_alloc raw_alloc;
# else
   typedef std::alloc raw_alloc;
# endif
#endif

   typedef std::__allocator<char, pm::raw_alloc> alloc;
}

#if defined(__COMO__) || defined(__GNUC__)
namespace std {
   template <typename X>
   struct _Alloc_traits<X, pm::alloc> {
      static const bool _S_instanceless=true;
#if defined(__GNUC__) && __GNUC__ == 3 && __GNUC_MINOR__ == 0 || defined(__COMO__)
      typedef simple_alloc<X, pm::raw_alloc> _Alloc_type;
#else
      typedef __simple_alloc<X, pm::raw_alloc> _Alloc_type;
#endif
      typedef __allocator<X, pm::raw_alloc> allocator_type;
   };
}
#endif

#ifdef _POLYMAKE_LACKING_REALLOCATE
namespace pm {
   void* reallocate(void*, size_t, size_t);
}
#endif

#endif // _POLYMAKE_STD_STL_ALLOC_H

// Local Variables:
// mode:C++
// c-basic-offset:3
// End:
