1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2024-12-24 00:34:04 +00:00

(libT) a few more win32 portability changes from Spry

This commit is contained in:
Charles Kerr 2008-10-14 17:57:44 +00:00
parent e4b1d5d726
commit a257d0fb89
3 changed files with 13 additions and 2 deletions

View file

@ -35,6 +35,9 @@
#ifdef __BEOS__
#include <StorageDefs.h>
#define MAX_PATH_LENGTH B_FILE_NAME_LENGTH
#elif defined(WIN32)
#include <windows.h>
#define MAX_PATH_LENGTH MAX_PATH
#else
#define MAX_PATH_LENGTH 1024
#endif

View file

@ -219,8 +219,9 @@ tr_ctorSetDownloadDir( tr_ctor * ctor,
{
struct optional_args * args = &ctor->optionalArgs[mode];
args->isSet_downloadDir = 0;
tr_free( args->downloadDir );
args->downloadDir = NULL;
args->isSet_downloadDir = 0;
if( directory )
{

View file

@ -189,8 +189,11 @@ tr_deepLog( const char * file,
... )
{
FILE * fp = tr_getLog( );
#ifdef WIN32
if( fp || IsDebuggerPresent( ) )
#else
if( fp )
#endif
{
va_list args;
char timestr[64];
@ -205,6 +208,10 @@ tr_deepLog( const char * file,
evbuffer_add_vprintf( buf, fmt, args );
va_end( args );
evbuffer_add_printf( buf, " (%s:%d)\n", base, line );
#ifdef WIN32
OutputDebugString( EVBUFFER_DATA( buf );
if(fp)
#endif
(void) fwrite( EVBUFFER_DATA( buf ), 1, EVBUFFER_LENGTH( buf ), fp );
tr_free( base );