/**
 * @file
 * @brief Exception Handling support header
 * @date 11.07.12
 * @author Ilia Vaprol
 */

#ifndef STANDALONE_EXCEPTION_
#define STANDALONE_EXCEPTION_

#if defined(__EXCEPTIONS) && __EXCEPTIONS==1
#error Exceptions must be disabled
#endif

extern "C++" {

namespace std {

	class exception {
	public:
		exception() throw() { }
		virtual ~exception() throw() { }
		virtual const char* what() const throw() { return "std::exception"; }
	};

	class bad_exception : public exception {
	public:
		bad_exception() throw() { }
		virtual ~bad_exception() throw() { }
		virtual const char* what() const throw() { return "std::bad_exception"; }
	};

	typedef void (*terminate_handler)();

	typedef void (*unexpected_handler)();

	terminate_handler set_terminate(terminate_handler) throw();

	void terminate();

	unexpected_handler set_unexpected(unexpected_handler) throw();

	void unexpected();

} // namespace std

} // extern "C++"

#endif // STANDALONE_EXCEPTION_
