OSDN Git Service

Initial revision
[pf3gnuchains/gcc-fork.git] / libstdc++ / stl / stl_exception.h
1 /*
2  * Copyright (c) 1998
3  * Silicon Graphics Computer Systems, Inc.
4  *
5  * Permission to use, copy, modify, distribute and sell this software
6  * and its documentation for any purpose is hereby granted without fee,
7  * provided that the above copyright notice appear in all copies and
8  * that both that copyright notice and this permission notice appear
9  * in supporting documentation.  Silicon Graphics makes no
10  * representations about the suitability of this software for any
11  * purpose.  It is provided "as is" without express or implied warranty.
12  */ 
13
14 #ifndef __SGI_STL_EXCEPTION_H
15 #define __SGI_STL_EXCEPTION_H
16
17 // This header exists solely for portability.  Normally it just includes
18 // the header <exception>.
19
20 // The header <exception> contains low-level functions that interact
21 // with a compiler's exception-handling mechanism.  It is assumed to
22 // be supplied with the compiler, rather than with the library, because
23 // it is inherently tied very closely to the compiler itself.
24
25 // On platforms where <exception> does not exist, this header defines
26 // an exception base class.  This is *not* a substitute for everything
27 // in <exception>, but it suffices to support a bare minimum of STL
28 // functionality.
29
30 #include <stl_config.h>
31
32 #ifndef __STL_NO_EXCEPTION_HEADER
33
34 #include <exception>
35 #define __STL_EXCEPTION_BASE exception
36
37 #else /* __STL_NO_EXCEPTION_HEADER */
38
39 __STL_BEGIN_NAMESPACE
40
41 class _Exception {
42 public:
43   virtual ~_Exception() __STL_NOTHROW {}
44   virtual const char* what() const __STL_NOTHROW { return ""; }
45 };
46
47 #define __STL_EXCEPTION_BASE _Exception
48
49 __STL_END_NAMESPACE
50
51 #endif /* __STL_NO_EXCEPTION_HEADER */
52
53 #endif /* __SGI_STL_EXCEPTION_H */
54
55 // Local Variables:
56 // mode:C++
57 // End: