Ignore:
Timestamp:
Jan 25, 2009, 4:14:11 PM (13 years ago)
Author:
charles
Message:

(trunk libT) new macro, tr_assert(). use it to help smoke out #1749

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/utils.c

    r7748 r7797  
    3737#include "utils.h"
    3838#include "platform.h"
     39#include "version.h"
    3940
    4041static tr_lock *      messageLock = NULL;
     
    192193
    193194char*
    194 tr_getLogTimeStr( char * buf,
    195                   int    buflen )
     195tr_getLogTimeStr( char * buf, int buflen )
    196196{
    197197    char           tmp[64];
     
    211211    return buf;
    212212}
     213
     214void
     215tr_assertImpl( const char * file, int line, const char * test, const char * fmt, ... )
     216{
     217    char buf[64];
     218    fprintf( stderr, "[%s] Transmission %s Assertion \"%s\" failed at %s:%d.  ",
     219                     tr_getLogTimeStr( buf, sizeof( buf ) ),
     220                      LONG_VERSION_STRING, test, file, line );
     221    if( fmt && *fmt ) {
     222        va_list args;
     223        fputc( '(', stderr );
     224        va_start( args, fmt );
     225        vfprintf( stderr, fmt, args );
     226        va_end( args );
     227        fputs( ")  ", stderr );
     228    }
     229    fputs( "Please report this bug at <http://trac.transmissionbt.com/newticket>; Thank you.\n", stderr );
     230    abort( );
     231}
     232
    213233
    214234tr_bool
Note: See TracChangeset for help on using the changeset viewer.