--- /dev/null
+// C++ forwarding C assert header.
+
+#pragma once
+
+#include <assert.h>
#ifndef __EXCEPTION__\r
#define __EXCEPTION__\r
\r
+#include <crtdefs.h>\r
+\r
extern "C++" {\r
\r
class exception\r
set_cpp(WITH_EXCEPTIONS)
-include_directories(${REACTOS_SOURCE_DIR}/lib/sdk/crt/include)
+include_directories(
+ ${REACTOS_SOURCE_DIR}/lib/sdk/crt/include
+ ${REACTOS_SOURCE_DIR}/include/c++)
list(APPEND SOURCE
ehvec.cpp
+ new_nothrow.cpp
typeinfo.cpp)
if(ARCH STREQUAL "i386")
; void __cdecl operator delete(void *,unsigned int)
DEFINE_ALIAS ??3@YAXPAXI@Z, ??3@YAXPAX@Z
+; void __cdecl operator delete(void *,struct std::nothrow_t const &)
+DEFINE_ALIAS ??3@YAXPAXABUnothrow_t@std@@@Z, ??3@YAXPAX@Z
+
+; void __cdecl operator delete[](void *,struct std::nothrow_t const &)
+DEFINE_ALIAS ??_V@YAXPAXABUnothrow_t@std@@@Z, ??3@YAXPAX@Z
+
END
--- /dev/null
+/*
+ * PROJECT: ReactOS C++ runtime library
+ * LICENSE: LGPLv2.1+ - See COPYING.LIB in the top level directory
+ * PURPOSE: nothrow version of the new operators
+ * PROGRAMMER: Thomas Faber (thomas.faber@reactos.org)
+ */
+
+#include <new>
+
+void* operator new (std::size_t) throw(std::bad_alloc);
+void* operator new[] (std::size_t) throw(std::bad_alloc);
+
+const std::nothrow_t std::nothrow;
+
+void* operator new (std::size_t size, const std::nothrow_t& nothrow_constant) throw()
+{
+ try
+ {
+ return operator new (size);
+ }
+ catch (std::bad_alloc)
+ {
+ return NULL;
+ }
+}
+
+void* operator new[] (std::size_t size, const std::nothrow_t& nothrow_constant) throw()
+{
+ try
+ {
+ return operator new[] (size);
+ }
+ catch (std::bad_alloc)
+ {
+ return NULL;
+ }
+}
* PROGRAMMER: Thomas Faber (thomas.faber@reactos.org)
*/
-/* TODO: #include <exception> instead */
-class type_info {
-public:
- __declspec(dllimport) virtual ~type_info();
-private:
- type_info(const type_info &);
- type_info &operator=(const type_info &);
-};
+#include <typeinfo>
/* These stubs don't need to do anything (those private functions are never
* called). They need to be in cpprt, though, in order to have the vtable