Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

74 lines
1.8 KiB

  1. // new standard header
  2. #ifndef _NEW_
  3. #define _NEW_
  4. #include <exception>
  5. #ifdef _MSC_VER
  6. #pragma pack(push,8)
  7. #endif /* _MSC_VER */
  8. _STD_BEGIN
  9. // CLASS bad_alloc
  10. class _CRTIMP2 bad_alloc : public exception {
  11. public:
  12. bad_alloc(const char *_S = "bad allocation") _THROW0()
  13. : exception(_S) {}
  14. virtual ~bad_alloc() _THROW0()
  15. {}
  16. protected:
  17. virtual void _Doraise() const
  18. {_RAISE(*this); }
  19. };
  20. // SUPPORT TYPES
  21. #ifndef __NOTHROW_T_DEFINED
  22. struct nothrow_t {};
  23. extern _CRTIMP2 const nothrow_t nothrow;
  24. #endif /* __NOTHROW_T_DEFINED */
  25. _STD_END
  26. typedef void (__cdecl *new_handler)();
  27. extern new_handler _New_hand;
  28. // new AND delete DECLARATIONS
  29. void __cdecl operator delete(void *) _THROW0();
  30. void *__cdecl operator new(size_t) _THROW1(std::bad_alloc);
  31. #ifndef __NOTHROW_T_DEFINED
  32. #define __NOTHROW_T_DEFINED
  33. void *__cdecl operator new(size_t, const std::nothrow_t&)
  34. _THROW0();
  35. #if _MSC_VER >= 1200 /*IFSTRIP=IGN*/
  36. #if defined(_WIN64) /*IFSTRIP=IGN*/
  37. void __cdecl operator delete(void *,
  38. const std::nothrow_t&) _THROW0();
  39. #else
  40. inline void __cdecl operator delete(void * pv, const std::nothrow_t&)
  41. {::delete(pv);}
  42. #endif
  43. #endif
  44. #endif /* __NOTHROW_T_DEFINED */
  45. #ifndef __PLACEMENT_NEW_INLINE
  46. #define __PLACEMENT_NEW_INLINE
  47. inline void *__cdecl operator new(size_t, void *_P)
  48. {return (_P); }
  49. #if _MSC_VER >= 1200 /*IFSTRIP=IGN*/
  50. inline void __cdecl operator delete(void *, void *)
  51. {return; }
  52. #endif
  53. #endif
  54. #ifdef _CRTIMP
  55. _CRTIMP
  56. #endif
  57. new_handler __cdecl set_new_handler(new_handler) _THROW0();
  58. #ifdef _MSC_VER
  59. #pragma pack(pop)
  60. #endif /* _MSC_VER */
  61. #endif /* _NEW_ */
  62. /*
  63. * Copyright (c) 1994 by P.J. Plauger. ALL RIGHTS RESERVED.
  64. * Consult your license regarding permissions and restrictions.
  65. */