This is the mail archive of the
ecos-patches@sources.redhat.com
mailing list for the eCos project.
patch for "packages/compat/posix/current/src/mqueue.cxx"
- From: sandeep <sandeep at codito dot com>
- To: ecos-patches at sources dot redhat dot com
- Cc: sandeep <sandeep at codito dot com>
- Date: Mon, 12 May 2003 22:01:16 +0900
- Subject: patch for "packages/compat/posix/current/src/mqueue.cxx"
change description :
--------------------
removed '#include <new>' and added placement inline definition for new
operator for getting it to be compiled. this file mentions about 'placement
new' in code, but definition was missing.
In the attached patch "/trying/cvs/" tree refers to redhat ecos cvs
and "/trying/here/" tree refers to local modified copy.
--
regards
sandeep
--------------------------------------------------------------------------
Paul Revere was a tattle-tale
--------------------------------------------------------------------------
--- /trying/cvs/ecos/packages/compat/posix/current/src/mqueue.cxx 2003-04-15 13:27:30.000000000 +0900
+++ /trying/here/ecos/packages/compat/posix/current/src/mqueue.cxx 2003-05-05 20:39:45.000000000 +0900
@@ -79,7 +79,7 @@
#include <stdarg.h> // varargs
#include <pthread.h> // mutexes
#include <string.h> // strncpy
-#include <new> // C++ new
+
#ifdef CYGFUN_POSIX_MQUEUE_NOTIFY
# include <signal.h>
# include "pprivate.h" // cyg_sigqueue()
@@ -131,6 +131,15 @@
/* LOCAL FUNCTIONS */
+//-----------------------------------------------------------------------------
+
+// placement new
+inline void *operator new(size_t size, void *ptr)
+{
+ CYG_CHECK_DATA_PTR( ptr, "Bad pointer" );
+ return ptr;
+}
+
//------------------------------------------------------------------------
// Deallocation callback from Cyg_Mqueue