1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2024-12-26 01:27:28 +00:00

more changes inspired by spry's `winport' code: for portability, use the standard __VA_ARGS__ macro for variadic macros instead of the CPP extensions.

This commit is contained in:
Charles Kerr 2008-10-13 22:45:05 +00:00
parent b824c704b7
commit 88ce8a5c44
8 changed files with 16 additions and 22 deletions

View file

@ -59,7 +59,7 @@
#define TR_UINT_TO_PTR( i ) ( (void*)( (uint32_t)i ) )
#endif
#define dbgmsg( fmt... ) tr_deepLog( __FILE__, __LINE__, NULL, ## fmt )
#define dbgmsg( ... ) tr_deepLog( __FILE__, __LINE__, NULL, __VA_ARGS__ )
/**
***

View file

@ -345,7 +345,7 @@ myDebug( const char * file,
}
}
#define dbgmsg( msgs, fmt... ) myDebug( __FILE__, __LINE__, msgs, ## fmt )
#define dbgmsg( msgs, ... ) myDebug( __FILE__, __LINE__, msgs, __VA_ARGS__ )
/**
***

View file

@ -54,7 +54,7 @@ struct tr_rpc_server
char * whitelist;
};
#define dbgmsg( fmt ... ) tr_deepLog( __FILE__, __LINE__, MY_NAME, ## fmt )
#define dbgmsg( ... ) tr_deepLog( __FILE__, __LINE__, MY_NAME, __VA_ARGS__ )
/**
***

View file

@ -573,7 +573,7 @@ deadlineReached( const uint64_t deadline )
#define SHUTDOWN_MAX_SECONDS 30
#define dbgmsg( fmt... ) tr_deepLog( __FILE__, __LINE__, NULL, ## fmt )
#define dbgmsg( ... ) tr_deepLog( __FILE__, __LINE__, NULL, __VA_ARGS__ )
void
tr_sessionClose( tr_handle * session )

View file

@ -118,7 +118,7 @@ struct tr_tracker
long lastAnnounceResponse;
};
#define dbgmsg( name, fmt... ) tr_deepLog( __FILE__, __LINE__, name, ## fmt )
#define dbgmsg( name, ... ) tr_deepLog( __FILE__, __LINE__, name, __VA_ARGS__ )
/***
****

View file

@ -66,7 +66,7 @@ struct tr_run_data
void * user_data;
};
#define dbgmsg( fmt... ) tr_deepLog( __FILE__, __LINE__, "event", ## fmt )
#define dbgmsg( ... ) tr_deepLog( __FILE__, __LINE__, "event", __VA_ARGS__ )
static void
readFromPipe( int fd,

View file

@ -105,23 +105,17 @@ const char* tr_strip_positional_args( const char* fmt );
#define _( a ) tr_strip_positional_args( a )
#endif
#define tr_nerr( n, a... ) tr_msg( __FILE__, __LINE__, TR_MSG_ERR, n, ## a )
#define tr_ninf( n, a... ) tr_msg( __FILE__, __LINE__, TR_MSG_INF, n, ## a )
#define tr_ndbg( n, a... ) tr_msg( __FILE__, __LINE__, TR_MSG_DBG, n, ## a )
#define tr_nerr( n, ... ) tr_msg( __FILE__, __LINE__, TR_MSG_ERR, n, __VA_ARGS__ )
#define tr_ninf( n, ... ) tr_msg( __FILE__, __LINE__, TR_MSG_INF, n, __VA_ARGS__ )
#define tr_ndbg( n, ... ) tr_msg( __FILE__, __LINE__, TR_MSG_DBG, n, __VA_ARGS__ )
#define tr_torerr( tor, a... ) tr_msg( __FILE__, __LINE__, TR_MSG_ERR,\
tor->info.name, \
## a )
#define tr_torinf( tor, a... ) tr_msg( __FILE__, __LINE__, TR_MSG_INF,\
tor->info.name, \
## a )
#define tr_tordbg( tor, a... ) tr_msg( __FILE__, __LINE__, TR_MSG_DBG,\
tor->info.name, \
## a )
#define tr_torerr( tor, ... ) tr_msg( __FILE__, __LINE__, TR_MSG_ERR, tor->info.name, __VA_ARGS__ )
#define tr_torinf( tor, ... ) tr_msg( __FILE__, __LINE__, TR_MSG_INF, tor->info.name, __VA_ARGS__ )
#define tr_tordbg( tor, ... ) tr_msg( __FILE__, __LINE__, TR_MSG_DBG, tor->info.name, __VA_ARGS__ )
#define tr_err( a... ) tr_msg( __FILE__, __LINE__, TR_MSG_ERR, NULL, ## a )
#define tr_inf( a... ) tr_msg( __FILE__, __LINE__, TR_MSG_INF, NULL, ## a )
#define tr_dbg( a... ) tr_msg( __FILE__, __LINE__, TR_MSG_DBG, NULL, ## a )
#define tr_err( ... ) tr_msg( __FILE__, __LINE__, TR_MSG_ERR, NULL, __VA_ARGS__ )
#define tr_inf( ... ) tr_msg( __FILE__, __LINE__, TR_MSG_INF, NULL, __VA_ARGS__ )
#define tr_dbg( ... ) tr_msg( __FILE__, __LINE__, TR_MSG_DBG, NULL, __VA_ARGS__ )
int tr_wildmat( const char * text,
const char * pattern );

View file

@ -31,7 +31,7 @@
#define PULSE_MSEC 100
#define dbgmsg( fmt... ) tr_deepLog( __FILE__, __LINE__, "web", ## fmt )
#define dbgmsg( ... ) tr_deepLog( __FILE__, __LINE__, "web", __VA_ARGS__ )
struct tr_web
{