mirror of
https://github.com/encounter/nfsmw.git
synced 2026-03-30 11:31:13 -07:00
64 lines
1.6 KiB
C++
64 lines
1.6 KiB
C++
/* CYGNUS LOCAL Embedded C++ whole file */
|
|
// The -*- C++ -*- dynamic memory management header.
|
|
// Copyright (C) 1994, 96-97, 1998 Free Software Foundation
|
|
|
|
#ifndef __NEW__
|
|
#define __NEW__
|
|
|
|
#define __need_size_t
|
|
#include <stddef.h>
|
|
|
|
#ifndef __EMBEDDED_CXX__
|
|
// Exception Handling is forbidden in Embedded C++.
|
|
#include <exception>
|
|
#define __THROW(what) throw (what)
|
|
#define __nothing
|
|
#else
|
|
#define __THROW(what)
|
|
#endif
|
|
|
|
// default placement versions of operator new
|
|
inline void *operator new(size_t, void *place) __THROW(__nothing) {
|
|
return place;
|
|
}
|
|
inline void *operator new[](size_t, void *place) __THROW(__nothing) {
|
|
return place;
|
|
}
|
|
|
|
#pragma interface "new"
|
|
#include <stddef.h>
|
|
|
|
extern "C++" {
|
|
|
|
namespace std {
|
|
|
|
#ifndef __EMBEDDED_CXX__
|
|
class bad_alloc : public exception {
|
|
public:
|
|
virtual const char* what() const throw() { return "bad_alloc"; }
|
|
};
|
|
#endif
|
|
|
|
struct nothrow_t {};
|
|
extern const nothrow_t nothrow;
|
|
|
|
typedef void (*new_handler)();
|
|
new_handler set_new_handler (new_handler);
|
|
|
|
} // namespace std
|
|
|
|
// replaceable signatures
|
|
void *operator new (size_t) __THROW (std::bad_alloc);
|
|
void *operator new[] (size_t) __THROW (std::bad_alloc);
|
|
void operator delete (void *) __THROW(__nothing);
|
|
void operator delete[] (void *) __THROW(__nothing);
|
|
void *operator new (size_t, const nothrow_t&) __THROW(__nothing);
|
|
void *operator new[] (size_t, const nothrow_t&) __THROW(__nothing);
|
|
void operator delete (void *, const nothrow_t&) __THROW(__nothing);
|
|
void operator delete[] (void *, const nothrow_t&) __THROW(__nothing);
|
|
|
|
} // extern "C++"
|
|
|
|
#endif
|
|
/* END CYGNUS LOCAL */
|