From 035f4f9d32e6abc145e353a536ce797a74049871 Mon Sep 17 00:00:00 2001 From: LordJZ Date: Fri, 3 Aug 2012 05:14:11 +0400 Subject: [PATCH] Possibly fix ByteBuffer when no ACE_Stack_Trace available. Testing required as I do not have access to a system that lacks ACE_Stack_Trace." --- src/shared/ByteBuffer.h | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/shared/ByteBuffer.h b/src/shared/ByteBuffer.h index acbb7f35633..f1d014f8353 100644 --- a/src/shared/ByteBuffer.h +++ b/src/shared/ByteBuffer.h @@ -54,11 +54,20 @@ class ByteBufferException void PrintPosError() const { + char const* traceStr; + +#ifdef HAVE_ACE_STACK_TRACE_H ACE_Stack_Trace trace; + traceStr = trace.c_str(); +#else + traceStr = NULL; +#endif + sLog.outError( "Attempted to %s in ByteBuffer (pos: " SIZEFMTD " size: "SIZEFMTD") " - "value with size: " SIZEFMTD "\n%s", - (add ? "put" : "get"), pos, size, esize, trace.c_str()); + "value with size: " SIZEFMTD "%s%s", + (add ? "put" : "get"), pos, size, esize, + traceStr ? "\n" : "", traceStr ? traceStr : ""); } private: bool add;