Service Kit: Fix behavior in release mode

* Code put inside an ASSERT will not be executed at all in release mode.
 * In release builds, don't print any messages to the standard output.
This commit is contained in:
Adrien Destugues
2013-10-15 16:48:46 +02:00
parent bb1d0adcd1
commit 7895042a8a
2 changed files with 8 additions and 1 deletions
@@ -127,5 +127,10 @@ BUrlProtocolDispatchingListener::_SendMessage(BMessage* message,
message->AddPointer(kUrlProtocolCaller, caller); message->AddPointer(kUrlProtocolCaller, caller);
message->AddInt8(kUrlProtocolMessageType, notification); message->AddInt8(kUrlProtocolMessageType, notification);
ASSERT(fMessenger.SendMessage(message) == B_OK); #ifdef DEBUG
status_t result = fMessenger.SendMessage(message);
ASSERT(result == B_OK);
#else
fMessenger.SendMessage(message);
#endif
} }
@@ -67,6 +67,7 @@ void
BUrlProtocolListener::DebugMessage(BUrlRequest* caller, BUrlProtocolListener::DebugMessage(BUrlRequest* caller,
BUrlProtocolDebugMessage type, const char* text) BUrlProtocolDebugMessage type, const char* text)
{ {
#ifdef DEBUG
switch (type) { switch (type) {
case B_URL_PROTOCOL_DEBUG_TEXT: case B_URL_PROTOCOL_DEBUG_TEXT:
cout << " "; cout << " ";
@@ -88,4 +89,5 @@ BUrlProtocolListener::DebugMessage(BUrlRequest* caller,
} }
cout << " " << caller->Protocol() << ": " << text << endl; cout << " " << caller->Protocol() << ": " << text << endl;
#endif
} }