Author: tfaber
Date: Sat Jan 26 18:34:33 2013
New Revision: 58228
URL:
http://svn.reactos.org/svn/reactos?rev=58228&view=rev
Log:
[INCLUDE]
- Actually put in the C++ headers what our CRT implements, instead of some random mix of
libstdc++ and who knows what. This means the header contents are somewhat outdated and
non-standard, but that's preferable to unusable
- Fix a forward declaration in math.h
Modified:
trunk/reactos/include/c++/exception
trunk/reactos/include/c++/new
trunk/reactos/include/c++/typeinfo
trunk/reactos/include/crt/math.h
Modified: trunk/reactos/include/c++/exception
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/c%2B%2B/exception?…
==============================================================================
--- trunk/reactos/include/c++/exception [iso-8859-1] (original)
+++ trunk/reactos/include/c++/exception [iso-8859-1] Sat Jan 26 18:34:33 2013
@@ -5,56 +5,42 @@
extern "C++" {
+class exception
+{
+public:
+ exception() throw();
+ exception(const char * const &) throw();
+ exception(const char * const &, int) throw();
+
+ virtual ~exception() throw();
+
+ virtual const char *what() const throw();
+private:
+ const char *_name;
+ int _do_free;
+};
+
+class bad_exception : public exception
+{
+public:
+ bad_exception(const char *name = "bad exception") throw()
+ : exception(name) { }
+
+ virtual ~bad_exception() throw() { }
+};
+
namespace std
{
- /**
- * @defgroup exceptions Exceptions
- * @ingroup diagnostics
- *
- * Classes and functions for reporting errors via exception classes.
- * @{
- */
+ using ::exception;
+ using ::bad_exception;
- /**
- * @brief Base class for all library exceptions.
- *
- * This is the base class for all exceptions thrown by the standard
- * library, and by certain language expressions. You are free to derive
- * your own %exception classes, or use a different hierarchy, or to
- * throw non-class data (e.g., fundamental types).
- */
- class exception
- {
- public:
- exception() throw() { }
- virtual ~exception() throw();
+ typedef void (*unexpected_handler) ();
- /** Returns a C-style character string describing the general cause
- * of the current error. */
- virtual const char* what() const throw();
- };
+ unexpected_handler set_unexpected(unexpected_handler) throw();
- /** If an %exception is thrown which is not listed in a function's
- * %exception specification, one of these may be thrown. */
- class bad_exception : public exception
- {
- public:
- bad_exception() throw() { }
+ __MINGW_ATTRIB_NORETURN void unexpected();
- virtual ~bad_exception() throw();
-
- virtual const char* what() const throw();
- };
-
- typedef void (*unexpected_handler) ();
-
- unexpected_handler set_unexpected(unexpected_handler) throw();
-
- __MINGW_ATTRIB_NORETURN void unexpected();
-
- bool uncaught_exception() throw();
-
- // @} group exceptions
+ bool uncaught_exception() throw();
} // namespace std
typedef void (*terminate_handler) ();
Modified: trunk/reactos/include/c++/new
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/c%2B%2B/new?rev=58…
==============================================================================
--- trunk/reactos/include/c++/new [iso-8859-1] (original)
+++ trunk/reactos/include/c++/new [iso-8859-1] Sat Jan 26 18:34:33 2013
@@ -8,24 +8,22 @@
extern "C++" {
-namespace std
+class bad_alloc : public exception
{
- class bad_alloc : public exception
- {
- public:
- bad_alloc() throw() { }
+public:
+ bad_alloc(const char *name = "bad alloc") throw()
+ : exception(name) { }
- // This declaration is not useless:
- //
http://gcc.gnu.org/onlinedocs/gcc-3.0.2/gcc_6.html#SEC118
- virtual ~bad_alloc() throw();
+ virtual ~bad_alloc() throw() { }
+};
- // See comment in eh_exception.cc.
- virtual const char* what() const throw();
- };
+namespace std
+{
+ using ::bad_alloc;
- struct nothrow_t { };
+ struct nothrow_t { };
- extern const nothrow_t nothrow;
+ extern const nothrow_t nothrow;
} // namespace std
typedef void (*new_handler)();
@@ -43,7 +41,7 @@
void operator delete[] (void* ptr) throw ();
void operator delete[] (void* ptr, const std::nothrow_t& nothrow_constant) throw();
inline void operator delete[] (void* ptr, void* voidptr2) throw() { }
-//@}
+
} // extern "C++"
#endif
Modified: trunk/reactos/include/c++/typeinfo
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/c%2B%2B/typeinfo?r…
==============================================================================
--- trunk/reactos/include/c++/typeinfo [iso-8859-1] (original)
+++ trunk/reactos/include/c++/typeinfo [iso-8859-1] Sat Jan 26 18:34:33 2013
@@ -7,41 +7,58 @@
extern "C++" {
-namespace std
+class type_info {
+public:
+ virtual ~type_info();
+
+ int before(const type_info &) const;
+ const char *name() const;
+ const char *raw_name() const;
+
+ int operator==(const type_info &) const;
+ int operator!=(const type_info &) const;
+private:
+ char *_name;
+ char _mangled[32];
+
+ type_info(const type_info &);
+ type_info &operator=(const type_info &);
+};
+
+class bad_cast : public exception
{
+public:
+ bad_cast(const char *name = "bad cast") throw()
+ : exception(name) { }
+ bad_cast(const char * const *) throw();
+ bad_cast(const char * const &) throw();
- class type_info {
- public:
- virtual ~type_info();
- bool before (const type_info& arg) const
- { return __name < __arg.__name; }
- bool operator==(const type_info& __arg) const
- { return __name == __arg.__name; }
- bool operator!=(const type_info& __arg) const
- { return !operator==(__arg); }
- const char* name() const;
- protected:
- const char* __name;
- private:
- type_info (const type_info& rhs);
- type_info& operator= (const type_info& rhs);
- };
+ virtual ~bad_cast() throw() { }
+};
- class bad_cast : public exception
- {
- public:
- bad_cast() throw() { }
- virtual ~bad_cast() throw();
- virtual const char* what() const throw();
- };
-
- class bad_typeid : public exception
- {
- public:
- bad_typeid () throw() { }
- virtual ~bad_typeid() throw();
- virtual const char* what() const throw();
- };
+class bad_typeid : public exception
+{
+public:
+ bad_typeid(const char *name = "bad typeid") throw()
+ : exception(name) { }
+
+ virtual ~bad_typeid() throw() { }
+};
+
+class __non_rtti_object : public bad_typeid
+{
+public:
+ __non_rtti_object(const char *name) throw()
+ : bad_typeid(name) { }
+
+ virtual ~__non_rtti_object() throw() { }
+};
+
+namespace std
+{
+ using ::type_info;
+ using ::bad_cast;
+ using ::bad_typeid;
} // namespace std
} // extern "C++"
Modified: trunk/reactos/include/crt/math.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/crt/math.h?rev=582…
==============================================================================
--- trunk/reactos/include/crt/math.h [iso-8859-1] (original)
+++ trunk/reactos/include/crt/math.h [iso-8859-1] Sat Jan 26 18:34:33 2013
@@ -8,7 +8,7 @@
#include "crtdefs.h"
-struct exception;
+struct _exception;
#pragma pack(push,_CRT_PACKING)