Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorConrad Scott <conrad.scott@dsl.pipex.com>2002-08-29 03:06:47 +0400
committerConrad Scott <conrad.scott@dsl.pipex.com>2002-08-29 03:06:47 +0400
commit7b78cbef17c7b45f2a4282c657e08c1b2cc1137d (patch)
tree09483792227152f6486b0049c8b89dd9fca55577
parentfa8147e86ca2fa41d0440f8e31c74a86ba3b48e6 (diff)
* safe_memory.h: Replace #include <new> with an explicit
definition of the placement new operator. (safe_delete): Remove unnecessary ## operator.
-rw-r--r--winsup/cygwin/ChangeLog6
-rw-r--r--winsup/cygwin/safe_memory.h15
2 files changed, 14 insertions, 7 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index 78afb92b8..e6ea6f1f6 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -1,3 +1,9 @@
+2002-08-29 Conrad Scott <conrad.scott@dsl.pipex.com>
+
+ * safe_memory.h: Replace #include <new> with an explicit
+ definition of the placement new operator.
+ (safe_delete): Remove unnecessary ## operator.
+
2002-08-28 Christopher Faylor <cgf@redhat.com>
* malloc.cc: Protect some definitions to avoid a compile time warning.
diff --git a/winsup/cygwin/safe_memory.h b/winsup/cygwin/safe_memory.h
index f426bbb5e..89d724a61 100644
--- a/winsup/cygwin/safe_memory.h
+++ b/winsup/cygwin/safe_memory.h
@@ -22,27 +22,28 @@ details. */
* destructor and then free(3).
*/
-#include <new>
#include <stdlib.h>
+inline void *operator new (size_t, void *__p) throw () { return __p; }
+
#define safe_new0(T) (new (malloc (sizeof (T))) T)
#ifdef NEW_MACRO_VARARGS
-#define safe_new(T, ...) \
+#define safe_new(T, ...) \
(new (malloc (sizeof (T))) T (__VA_ARGS__))
#else /* !NEW_MACRO_VARARGS */
-#define safe_new(T, args...) \
+#define safe_new(T, args...) \
(new (malloc (sizeof (T))) T (## args))
#endif /* !NEW_MACRO_VARARGS */
-#define safe_delete(T, O) \
-{ \
- (O)->~ ## T (); \
- free (O); \
+#define safe_delete(T, O) \
+{ \
+ (O)->~T (); \
+ free (O); \
}
#endif /* __SAFE_MEMORY_H__ */