*Doh* Always check the build _before_ checking in, not after. *sigh*

git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2949 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
DarkWyrm
2003-03-19 01:20:20 +00:00
parent 7b919e9ac2
commit 1fd593cdd7
4 changed files with 36 additions and 4 deletions
+24
View File
@@ -0,0 +1,24 @@
#include "Utils.h"
/*!
\brief Send a BMessage to a Looper target
\param port Receiver port of the targeted Looper
\param BMessage to send
This SendMessage takes ownership of the message sent, so deleting them after this
call is unnecessary. Passing an invalid port will have unpredictable results.
*/
void SendMessage(port_id port, BMessage *message)
{
if(!message)
return;
ssize_t flatsize=message->FlattenedSize();
char *buffer=new char[flatsize];
if(message->Flatten(buffer,flatsize)==B_OK)
write_port(port, message->what, buffer,flatsize);
delete buffer;
delete message;
}