turn off glib-dependant checksuming for non-linux builds

This commit is contained in:
Andy2 2010-10-18 22:08:04 -07:00
parent 6e56fb3544
commit b9e3ca212b
2 changed files with 15 additions and 7 deletions

View file

@ -54,7 +54,7 @@ typedef struct MsgQueueElem {
XP_PlayerAddr channelNo; XP_PlayerAddr channelNo;
XP_U16 sendCount; /* how many times sent? */ XP_U16 sendCount; /* how many times sent? */
MsgID msgID; /* saved for ease of deletion */ MsgID msgID; /* saved for ease of deletion */
#ifdef DEBUG #ifdef COMMS_CHECKSUM
gchar* checksum; gchar* checksum;
#endif #endif
} MsgQueueElem; } MsgQueueElem;
@ -553,7 +553,7 @@ comms_makeFromStream( MPFORMAL XWStreamCtxt* stream, XW_UtilCtxt* util,
msg->len = stream_getU16( stream ); msg->len = stream_getU16( stream );
msg->msg = (XP_U8*)XP_MALLOC( mpool, msg->len ); msg->msg = (XP_U8*)XP_MALLOC( mpool, msg->len );
stream_getBytes( stream, msg->msg, msg->len ); stream_getBytes( stream, msg->msg, msg->len );
#ifdef DEBUG #ifdef COMMS_CHECKSUM
msg->checksum = g_compute_checksum_for_data( G_CHECKSUM_MD5, msg->checksum = g_compute_checksum_for_data( G_CHECKSUM_MD5,
msg->msg, msg->len ); msg->msg, msg->len );
#endif #endif
@ -886,7 +886,7 @@ makeElemWithID( CommsCtxt* comms, MsgID msgID, AddressRecord* rec,
stream_getBytes( stream, newMsgElem->msg + headerLen, streamSize ); stream_getBytes( stream, newMsgElem->msg + headerLen, streamSize );
} }
#ifdef DEBUG #ifdef COMMS_CHECKSUM
newMsgElem->checksum = g_compute_checksum_for_data( G_CHECKSUM_MD5, newMsgElem->checksum = g_compute_checksum_for_data( G_CHECKSUM_MD5,
newMsgElem->msg, newMsgElem->msg,
newMsgElem->len ); newMsgElem->len );
@ -962,8 +962,15 @@ printQueue( const CommsCtxt* comms )
for ( elem = comms->msgQueueHead, i = 0; i < comms->queueLen; for ( elem = comms->msgQueueHead, i = 0; i < comms->queueLen;
elem = elem->next, ++i ) { elem = elem->next, ++i ) {
XP_STATUSF( "\t%d: channel: %x; msgID=" XP_LD "; check=%s", XP_STATUSF( "\t%d: channel: %x; msgID=" XP_LD
i+1, elem->channelNo, elem->msgID, elem->checksum ); #ifdef COMMS_CHECKSUM
"; check=%s"
#endif
,i+1, elem->channelNo, elem->msgID
#ifdef COMMS_CHECKSUM
, elem->checksum
#endif
);
} }
} }
@ -989,7 +996,7 @@ static void
freeElem( const CommsCtxt* XP_UNUSED_DBG(comms), MsgQueueElem* elem ) freeElem( const CommsCtxt* XP_UNUSED_DBG(comms), MsgQueueElem* elem )
{ {
XP_FREE( comms->mpool, elem->msg ); XP_FREE( comms->mpool, elem->msg );
#ifdef DEBUG #ifdef COMMS_CHECKSUM
g_free( elem->checksum ); g_free( elem->checksum );
#endif #endif
XP_FREE( comms->mpool, elem ); XP_FREE( comms->mpool, elem );

View file

@ -17,7 +17,8 @@
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
ifeq ($(MEMDEBUG),TRUE) ifeq ($(MEMDEBUG),TRUE)
DEFINES = -DMEM_DEBUG -DDEBUG -DENABLE_LOGGING -DNUMBER_KEY_AS_INDEX DEFINES = -DMEM_DEBUG -DDEBUG -DENABLE_LOGGING -DNUMBER_KEY_AS_INDEX
DEFINES += -DCOMMS_CHECKSUM
CFLAGS += -g $(GPROFFLAG) -Wall -Wunused-parameter -Wcast-align -Werror -O0 CFLAGS += -g $(GPROFFLAG) -Wall -Wunused-parameter -Wcast-align -Werror -O0
CFLAGS += -DDEBUG_TS CFLAGS += -DDEBUG_TS
PLATFORM = obj_linux_memdbg PLATFORM = obj_linux_memdbg