/*
 * Copyright (c) 1997
 * Silicon Graphics Computer Systems, Inc.
 *
 * Permission to use, copy, modify, distribute and sell this software
 * and its documentation for any purpose is hereby granted without fee,
 * provided that the above copyright notice appear in all copies and
 * that both that copyright notice and this permission notice appear
 * in supporting documentation.  Silicon Graphics makes no
 * representations about the suitability of this software for any
 * purpose.  It is provided "as is" without express or implied warranty.
 */ 

#ifndef __SGI_STDEXCEPT
#define __SGI_STDEXCEPT

#include <exception>

#if _MIPS_SIM != _ABIO32

#include <stl_config.h>
#include <stl_string_fwd.h>

namespace std {

class logic_error : public exception {
public:
  logic_error(const string& s) { __string_copy(s, name, _bufsize); }
  const char* what() const __STL_NOTHROW { return name; }
private:
  enum { _bufsize = 256 };
  char name[_bufsize];
};

class runtime_error : public exception {
public:
  runtime_error(const string& s) { __string_copy(s, name, _bufsize); }
  const char* what() const __STL_NOTHROW { return name; }
private:
  enum { _bufsize = 256 };
  char name[_bufsize];
};

class domain_error : public logic_error {
public:
  domain_error(const string& arg) : logic_error(arg) {}
};

class invalid_argument : public logic_error {
public:
  invalid_argument(const string& arg) : logic_error(arg) {}
};

class length_error : public logic_error {
public:
  length_error(const string& arg) : logic_error(arg) {}
};

class out_of_range : public logic_error {
public:
  out_of_range(const string& arg) : logic_error(arg) {}
};

class range_error : public runtime_error {
public:
  range_error(const string& arg) : runtime_error(arg) {}
};

class overflow_error : public runtime_error {
public:
  overflow_error(const string& arg) : runtime_error(arg) {}
};

class underflow_error : public runtime_error {
public:
  underflow_error(const string& arg) : runtime_error(arg) {}
};

} // Close namespace std

#ifndef __SGI_STL_STRING
#include <string>
#endif

#endif /* Not o32 */

#endif /* __SGI_STDEXCEPT */

// Local Variables:
// mode:C++
// End:
