Removing the USING_MESSAGE4 define.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16710 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Michael Lotz 2006-03-11 18:06:46 +00:00
parent 2bf8fb3a96
commit bdbd1cb441
7 changed files with 4 additions and 66 deletions

View File

@ -8,11 +8,6 @@
#ifndef _MESSAGE_H
#define _MESSAGE_H
// this should be defined in your UserBuildConfig only
#ifndef USING_MESSAGE4
# define USING_MESSAGE4 1
#endif
#include <BeBuild.h>
#include <DataIO.h>
#include <Flattenable.h>

View File

@ -12,15 +12,12 @@
#include "ObjectLocker.h"
#include "TokenSpace.h"
#ifdef USING_MESSAGE4
# include <MessagePrivate.h>
#endif
#include <Application.h>
#include <Handler.h>
#include <Looper.h>
#include <LooperList.h>
#include <Message.h>
#include <MessagePrivate.h>
#include <Messenger.h>
#include <OS.h>
#include <Roster.h>
@ -330,12 +327,8 @@ BMessenger::SendMessage(BMessage *message, BMessenger replyTo,
if (!message)
return B_BAD_VALUE;
#ifndef USING_MESSAGE4
return message->_send_(fPort, fHandlerToken, timeout, false, replyTo);
#else
return BMessage::Private(message).SendMessage(fPort, fHandlerToken,
timeout, false, replyTo);
#endif
}
// SendMessage
@ -394,13 +387,9 @@ BMessenger::SendMessage(BMessage *message, BMessage *reply,
{
status_t error = (message && reply ? B_OK : B_BAD_VALUE);
if (error == B_OK) {
#ifndef USING_MESSAGE4
error = message->send_message(fPort, fTeam, fHandlerToken,
reply, deliveryTimeout, replyTimeout);
#else
error = BMessage::Private(message).SendMessage(fPort, fTeam,
fHandlerToken, reply, deliveryTimeout, replyTimeout);
#endif
// Map this error for now:
if (error == B_BAD_TEAM_ID)
error = B_BAD_PORT_ID;

View File

@ -5,7 +5,6 @@
* Authors:
* Michael Lotz <mmlr@mlotz.ch>
*/
#ifdef USING_MESSAGE4
#include <DataIO.h>
#include <MessagePrivate.h>
@ -408,5 +407,3 @@ unflatten_r5_message(uint32 format, BMessage *message, BDataIO *stream)
}
} // namespace BPrivate
#endif // USING_MESSAGE4

View File

@ -36,15 +36,13 @@
#include <AppMisc.h>
#include <ViewAux.h>
#include <TokenSpace.h>
#include <MessagePrivate.h>
#include <MessageUtils.h>
#include <ColorUtils.h>
#include <AppServerLink.h>
#include <PortLink.h>
#include <ServerProtocol.h>
#ifdef USING_MESSAGE4
#include <MessagePrivate.h>
#endif
#include <math.h>
#include <new>
@ -1261,11 +1259,7 @@ BView::DragMessage(BMessage *message, BRect dragRect, BHandler *replyTo)
message->AddInt32("buttons", buttons);
}
#ifndef USING_MESSAGE4
_set_message_reply_(message, BMessenger(replyTo, replyTo->Looper()));
#else
BMessage::Private(message).SetReply(BMessenger(replyTo, replyTo->Looper()));
#endif
int32 bufferSize = message->FlattenedSize();
char* buffer = new (nothrow) char[bufferSize];
@ -1322,11 +1316,7 @@ BView::DragMessage(BMessage *message, BBitmap *image,
message->AddInt32("buttons", buttons);
}
#ifndef USING_MESSAGE4
_set_message_reply_(message, BMessenger(replyTo, replyTo->Looper()));
#else
BMessage::Private(message).SetReply(BMessenger(replyTo, replyTo->Looper()));
#endif
int32 bufferSize = message->FlattenedSize();
char* buffer = new (nothrow) char[bufferSize];

View File

@ -2575,29 +2575,10 @@ ServerWindow::SendMessageToClient(const BMessage* msg, int32 target) const
if (target == B_NULL_TOKEN)
target = fClientToken;
#ifndef USING_MESSAGE4
ssize_t size = msg->FlattenedSize();
char* buffer = new(nothrow) char[size];
status_t ret;
if ((ret = msg->Flatten(buffer, size)) == B_OK) {
ret = BMessage::Private::SendFlattenedMessage(buffer, size,
fClientLooperPort, target, 0);
if (ret < B_OK) {
fprintf(stderr, "ServerWindow(\"%s\")::SendMessageToClient('%.4s'): %s\n",
Title(), (char*)&msg->what, strerror(ret));
}
} else
printf("PANIC: ServerWindow %s: can't flatten message in 'SendMessageToClient()'\n", fTitle);
delete[] buffer;
return ret;
#else
BMessenger reply;
BMessage::Private messagePrivate((BMessage *)msg);
return messagePrivate.SendMessage(fClientLooperPort, target, 0,
false, reply);
#endif
}

View File

@ -1707,7 +1707,7 @@ InputServer::_DispatchEvent(BMessage* event)
break;
}
#if defined(HAIKU_TARGET_PLATFORM_HAIKU) && defined(USING_MESSAGE4)
#if defined(HAIKU_TARGET_PLATFORM_HAIKU)
BMessenger reply;
BMessage::Private messagePrivate(event);
return messagePrivate.SendMessage(fAppServerPort, 0, true, 0, reply);

View File

@ -605,25 +605,11 @@ MessageDeliverer::DeliverMessage(BMessage *message, MessagingTargetSet &targets,
if (!message)
return B_BAD_VALUE;
#ifndef USING_MESSAGE4
// Set the token now, so that the header contains room for it.
// It will be set when sending the message anyway, but if it is not set
// before flattening, the header will not contain room for it, and it
// will not possible to send the message flattened later.
BMessage::Private(message).SetTarget(B_NULL_TOKEN);
// flatten the message
BMallocIO mallocIO;
status_t error = message->Flatten(&mallocIO);
if (error != B_OK)
return error;
#else
// flatten the message
BMallocIO mallocIO;
status_t error = BMessage::Private(message).NativeFlatten(&mallocIO, NULL);
if (error < B_OK)
return error;
#endif
return DeliverMessage(mallocIO.Buffer(), mallocIO.BufferLength(), targets,
timeout);