home *** CD-ROM | disk | FTP | other *** search
- #ifndef __NEW_H
- #define __NEW_H
- #pragma option push -b -a8 -pc -Vx- -Ve- -w-inl -w-aus -w-sig
- // -*- C++ -*-
- #if !defined(_HPACC_)
- #ifndef __STD_NEW
- #define __STD_NEW
-
- /***************************************************************************
- *
- * new - declarations for the Standard Library new header
- *
- ***************************************************************************
- *
- * (c) Copyright 1994, 1998 Rogue Wave Software, Inc.
- * ALL RIGHTS RESERVED
- *
- * The software and information contained herein are proprietary to, and
- * comprise valuable trade secrets of, Rogue Wave Software, Inc., which
- * intends to preserve as trade secrets such software and information.
- * This software is furnished pursuant to a written license agreement and
- * may be used, copied, transmitted, and stored only in accordance with
- * the terms of such license and with the inclusion of the above copyright
- * notice. This software and information or any other copies thereof may
- * not be provided or otherwise made available to any other person.
- *
- * Notwithstanding any other lease or license that may pertain to, or
- * accompany the delivery of, this computer software and information, the
- * rights of the Government regarding its use, reproduction and disclosure
- * are as set forth in Section 52.227-19 of the FARS Computer
- * Software-Restricted Rights clause.
- *
- * Use, duplication, or disclosure by the Government is subject to
- * restrictions as set forth in subparagraph (c)(1)(ii) of the Rights in
- * Technical Data and Computer Software clause at DFARS 252.227-7013.
- * Contractor/Manufacturer is Rogue Wave Software, Inc.,
- * P.O. Box 2328, Corvallis, Oregon 97339.
- *
- * This computer software and information is distributed with "restricted
- * rights." Use, duplication or disclosure is subject to restrictions as
- * set forth in NASA FAR SUP 18-52.227-79 (April 1985) "Commercial
- * Computer Software-Restricted Rights (April 1985)." If the Clause at
- * 18-52.227-74 "Rights in Data General" is specified in the contract,
- * then the "Alternate III" clause applies.
- *
- **************************************************************************/
-
- #include <stdcomp.h>
- #include <rw/stddefs.h>
- #include <exception>
-
- #ifndef _RWSTD_NO_NAMESPACE
- namespace __rwstd {
- #endif
-
- extern const char _RWSTDExportFunc(*) __rw_stdexcept_BadAllocException;
-
- #ifndef _RWSTD_NO_NAMESPACE
- }
- namespace std {
- #endif
-
- #if !defined(_RWSTD_BAD_ALLOC_DEFINED) || defined(__TURBOC__)
- class _RWSTDExport bad_alloc : public exception
- {
- public:
- bad_alloc () _RWSTD_THROW_SPEC_NULL : exception( )
- { ; }
- bad_alloc(const bad_alloc&) _RWSTD_THROW_SPEC_NULL
- { ; }
- bad_alloc& operator=(const bad_alloc&) _RWSTD_THROW_SPEC_NULL
- { return *this; }
- virtual ~bad_alloc () _RWSTD_THROW_SPEC_NULL;
-
- virtual const char * what () const _RWSTD_THROW_SPEC_NULL
- {
- return __RWSTD::__rw_stdexcept_BadAllocException;
- }
- };
- #else
- #ifndef _RWSTD_NO_NAMESPACE
- }
- #endif
- #if defined(_MSC_VER) && !defined(__BORLANDC__)
- #include _RWSTD_MS42_HEADER(new)
- #else
- #include <new.h>
- #endif
- #ifndef _RWSTD_NO_NAMESPACE
- namespace std {
- #endif
- #endif /*_RWSTD_BAD_ALLOC_DEFINED */
-
- #ifndef _RWSTD_NOTHROW_IN_STD
- struct nothrow_t {};
- extern const nothrow_t nothrow;
- #endif // _RWSTD_NOTHROW_IN_STD
-
- #if !defined(_RWSTD_EXCEPTION_HANDLER_IN_STD) || defined(__BORLANDC__)
- typedef void ( _RTLENTRY *new_handler) ();
-
- #if !defined(_MSC_VER) || defined(__BORLANDC__)
- extern new_handler _RTLENTRY _EXPFUNC set_new_handler( new_handler new_p );
- #endif
- #endif // ! _RWSTD_EXCEPTION_HANDLER_IN_STD || __BORLANDC__
- #ifndef _RWSTD_NO_NAMESPACE
- }
- #endif
-
- #ifndef _RWSTD_NO_NEW_BRACKETS
- #ifndef _RWSTD_NO_THROW_SPEC_ON_NEW
- extern void * _RTLENTRY _EXPFUNC operator new(size_t, void*) _RWSTD_THROW_SPEC_NULL;
- inline void* _RTLENTRY operator new[] ( size_t, void* ptr) _RWSTD_THROW_SPEC_NULL
- { return ptr; }
- #else
- extern void * _RTLENTRY _EXPFUNC operator new(size_t, void*);
- inline void* _RTLENTRY operator new[] ( size_t, void* ptr)
- { return ptr; }
- #endif // _RWSTD_NO_THROW_SPEC_ON_NEW
- #else
- #if defined(_MSC_VER) && !defined(__BORLANDC__)
- #include <new.h>
- extern void * _RTLENTRY _EXPFUNC operator new(size_t, void* ptr);
- #else
- #ifndef _RWSTD_NO_THROW_SPEC_ON_NEW
- static inline void * _RTLENTRY operator new(size_t, void* ptr) _RWSTD_THROW_SPEC_NULL
- { return ptr; }
- #else
- static inline void * _RTLENTRY operator new(size_t, void* ptr)
- { return ptr; }
- #endif // _RWSTD_NO_THROW_SPEC_ON_NEW
- #endif // _MSC_VER
- #endif // _RWSTD_NO_NEW_BRACKETS
-
- #ifdef __BORLANDC__
- // Prototypes for the standard global new & delete operators
- void * _RTLENTRY _EXPFUNC operator new (size_t);
- void _RTLENTRY _EXPFUNC operator delete (void *);
- // inline versions of the nothrow_t versions of new & delete operators
- inline void * _RTLENTRY operator new (size_t size, const std::nothrow_t &)
- {
- size = size ? size : 1;
- return malloc(size);
- }
- inline void * _RTLENTRY operator new[] (size_t size, const std::nothrow_t &nt)
- {
- return ::operator new (size, nt);
- }
- inline void _RTLENTRY operator delete (void *v, const std::nothrow_t &nt)
- {
- ::operator delete (v); // The standard operator doesn't throw any exceptions
- }
- inline void _RTLENTRY operator delete[] (void *v, const std::nothrow_t &nt)
- {
- ::operator delete[] (v); // The standard operator doesn't throw any exceptions
- }
- #endif // __BORLANDC__
-
- #endif /*__STD_NEW */
-
- #else
- #include <new.h>
- #endif /* !defined (_HPACC_) */
- #ifndef __USING_STD_NAMES__
- using namespace std;
- #endif
- #pragma option pop
- #endif /* __NEW_H */
-