wiki:BuildingTransmissionQtWindows/transmission-2.00-Qt-build.diff

Version 1 (modified by rb07, 12 years ago) (diff)

--

diff -NaurX /home/rberber/diff-excludes.txt transmission-2.00-orig/configure transmission-2.00/configure --- transmission-2.00-orig/configure 2010-06-15 20:33:46.000000000 -0500 +++ transmission-2.00/configure 2010-06-17 18:52:25.000000000 -0500 @@ -19312,6 +19312,11 @@

WIN32_FALSE=

fi

+case $host_os in + mingw*) + libevent_extra_libs+="-lws2_32" + ;; +esac

ac_config_files="$ac_config_files Makefile transmission.spec cli/Makefile daemon/Makefile doc/Makefile libtransmission/Makefile third-party/Makefile third-party/miniupnp/Makefile third-party/libnatpmp/Makefile third-party/dht/Makefile macosx/Makefile gtk/Makefile gtk/icons/Makefile web/Makefile web/images/Makefile web/images/buttons/Makefile web/images/graphics/Makefile web/images/progress/Makefile web/javascript/Makefile web/javascript/jquery/Makefile web/stylesheets/Makefile po/Makefile.in"

diff -NaurX /home/rberber/diff-excludes.txt transmission-2.00-orig/libtransmission/JSON_parser.h transmission-2.00/libtransmission/JSON_parser.h --- transmission-2.00-orig/libtransmission/JSON_parser.h 2010-06-15 20:32:58.000000000 -0500 +++ transmission-2.00/libtransmission/JSON_parser.h 2010-06-17 18:52:25.000000000 -0500 @@ -11,7 +11,7 @@

#include <stddef.h>

/* Windows DLL stuff */

-#ifdef _WIN32 +#if defined(WIN32) && !defined(STATICLIB)

# ifdef JSON_PARSER_DLL_EXPORTS # define JSON_PARSER_DLL_API declspec(dllexport) # else

diff -NaurX /home/rberber/diff-excludes.txt transmission-2.00-orig/libtransmission/Makefile.in transmission-2.00/libtransmission/Makefile.in --- transmission-2.00-orig/libtransmission/Makefile.in 2010-06-15 20:33:47.000000000 -0500 +++ transmission-2.00/libtransmission/Makefile.in 2010-06-17 18:52:25.000000000 -0500 @@ -88,7 +88,7 @@

bencode_test_OBJECTS = $(am_bencode_test_OBJECTS) amDEPENDENCIES_1 = ./libtransmission.a \

$(top_builddir)/third-party/miniupnp/libminiupnp.a \

  • $(top_builddir)/third-party/libnatpmp/libnatpmp.a

+ $(top_builddir)/third-party/libnatpmp/libnatpmp.a

bencode_test_DEPENDENCIES = $(amDEPENDENCIES_1) AM_V_lt = $(amv_lt_$(V)) amv_lt_ = $(amv_lt_$(AM_DEFAULT_VERBOSITY))

@@ -501,6 +501,7 @@

./libtransmission.a \ $(top_builddir)/third-party/miniupnp/libminiupnp.a \ $(top_builddir)/third-party/libnatpmp/libnatpmp.a \

+ -liphlpapi \

@INTLLIBS@ \ @DHT_LIBS@ \ @LIBCURL_LIBS@ \

diff -NaurX /home/rberber/diff-excludes.txt transmission-2.00-orig/libtransmission/announcer.c transmission-2.00/libtransmission/announcer.c --- transmission-2.00-orig/libtransmission/announcer.c 2010-06-15 20:32:58.000000000 -0500 +++ transmission-2.00/libtransmission/announcer.c 2010-06-17 18:52:25.000000000 -0500 @@ -1407,7 +1407,7 @@

/* %1$ld - http status code, such as 404

  • %2$s - human-readable explanation of the http status code */

char * buf = tr_strdup_printf(

  • _( "tracker gave HTTP Response Code %1$ld (%2$s)" ),

+ _( "tracker gave HTTP Response Code %ld (%s)" ),

responseCode, tr_webGetResponseStr( responseCode ) );

@@ -1733,7 +1733,7 @@

tier->lastScrapeStr, sizeof( tier->lastScrapeStr ) );

else

tr_snprintf( tier->lastScrapeStr, sizeof( tier->lastScrapeStr ),

  • _( "tracker gave HTTP Response Code %1$ld (%2$s)" ),

+ _( "tracker gave HTTP Response Code %ld (%s)" ),

responseCode, tr_webGetResponseStr( responseCode ) );

tr_tordbg( tier->tor, "%s", tier->lastScrapeStr );

}

@@ -1764,7 +1764,7 @@

sizeof( tier->lastScrapeStr ) );

else

tr_snprintf( tier->lastScrapeStr, sizeof( tier->lastScrapeStr ),

  • _( "tracker gave HTTP Response Code %1$ld (%2$s)" ),

+ _( "tracker gave HTTP Response Code %ld (%s)" ),

responseCode, tr_webGetResponseStr( responseCode ) );

}

diff -NaurX /home/rberber/diff-excludes.txt transmission-2.00-orig/libtransmission/bencode.c transmission-2.00/libtransmission/bencode.c --- transmission-2.00-orig/libtransmission/bencode.c 2010-06-15 20:32:58.000000000 -0500 +++ transmission-2.00/libtransmission/bencode.c 2010-06-17 18:52:25.000000000 -0500 @@ -17,6 +17,11 @@

#include <stdio.h> #include <stdlib.h> /* realpath() */ #include <string.h>

+#ifdef WIN32 + #include <fcntl.h> + #define fsync _commit + static char *realpath(); +#endif

#include <sys/types.h> /* stat() */ #include <sys/stat.h> /* stat() */

@@ -1629,7 +1634,12 @@

filename = buf;

/* if the file already exists, try to move it out of the way & keep it as a backup */

+#ifdef WIN32 + tmp = tr_strdup_printf( "%s_tmp.XXXXXX", filename ); + #define mkstemp(t) open(mktemp(t), O_CREAT | O_EXCL | O_RDWR | O_BINARY, 0600); +#else

tmp = tr_strdup_printf( "%s.tmp.XXXXXX", filename );

+#endif

fd = mkstemp( tmp ); if( fd >= 0 ) {

@@ -1653,21 +1663,21 @@

else {

err = errno;

  • tr_err( _( "Couldn't save file \"%1$s\": %2$s" ), filename, tr_strerror( err ) );

+ tr_err( _( "Couldn't save file \"%s\": %s" ), filename, tr_strerror( err ) );

unlink( tmp );

}

} else {

err = errno;

  • tr_err( _( "Couldn't save file \"%1$s\": %2$s" ), filename, tr_strerror( err ) );

+ tr_err( _( "Couldn't save file \"%s\": %s" ), filename, tr_strerror( err ) );

unlink( tmp );

}

} else {

err = errno;

  • tr_err( _( "Couldn't save temporary file \"%1$s\": %2$s" ), tmp, tr_strerror( err ) );

+ tr_err( _( "Couldn't save temporary file \"%s\": %s" ), tmp, tr_strerror( err ) );

close( fd ); unlink( tmp );

}

@@ -1677,7 +1687,7 @@

else {

err = errno;

  • tr_err( _( "Couldn't save temporary file \"%1$s\": %2$s" ), tmp, tr_strerror( err ) );

+ tr_err( _( "Couldn't save temporary file \"%s\": %s" ), tmp, tr_strerror( err ) );

}

tr_free( tmp );

@@ -1710,3 +1720,16 @@

tr_free( content ); return err;

}

+ +#ifdef WIN32 +/* From a message to the Mingw-msys list, circa Jun 2, 2005 + * by Mark Junker. + */ +static +char *realpath(const char *path, char *resolved_path) +{ + if (GetFullPathNameA(path, TR_PATH_MAX, resolved_path, NULL) == 0) + return NULL; + return resolved_path; +} +#endif diff -NaurX /home/rberber/diff-excludes.txt transmission-2.00-orig/libtransmission/blocklist.c transmission-2.00/libtransmission/blocklist.c --- transmission-2.00-orig/libtransmission/blocklist.c 2010-06-15 20:32:58.000000000 -0500 +++ transmission-2.00/libtransmission/blocklist.c 2010-06-17 19:08:58.000000000 -0500 @@ -73,14 +73,14 @@

{

int fd; struct stat st;

  • const char * err_fmt = _( "Couldn't read \"%1$s\": %2$s" );

+ const char * err_fmt = _( "Couldn't read \"%s\": %s" );

blocklistClose( b );

if( stat( b->filename, &st ) == -1 )

return;

  • fd = open( b->filename, O_RDONLY );

+ fd = open( b->filename, O_RDONLY | O_BINARY );

if( fd == -1 ) {

tr_err( err_fmt, b->filename, tr_strerror( errno ) );

@@ -105,7 +105,7 @@

{

char * base = tr_basename( b->filename );

  • tr_inf( _( "Blocklist \"%s\" contains %'zu entries" ), base, b->ruleCount );

+ tr_inf( _( "Blocklist \"%s\" contains %zu entries" ), base, b->ruleCount );

tr_free( base );

}

}

@@ -307,7 +307,7 @@

int inCount = 0; int outCount = 0; char line[2048];

  • const char * err_fmt = _( "Couldn't read \"%1$s\": %2$s" );

+ const char * err_fmt = _( "Couldn't read \"%s\": %s" );

if( !filename ) {

@@ -315,7 +315,7 @@

return 0;

}

  • in = fopen( filename, "r" );

+ in = fopen( filename, "rb" );

if( !in ) {

tr_err( err_fmt, filename, tr_strerror( errno ) );

@@ -352,7 +352,7 @@

if( fwrite( &range, sizeof( struct tr_ip_range ), 1, out ) != 1 ) {

  • tr_err( _( "Couldn't save file \"%1$s\": %2$s" ), b->filename,

+ tr_err( _( "Couldn't save file \"%s\": %s" ), b->filename,

tr_strerror( errno ) );

break;

}

@@ -362,7 +362,7 @@

{

char * base = tr_basename( b->filename );

  • tr_inf( _( "Blocklist \"%1$s\" updated with %2$'d entries" ), base, outCount );

+ tr_inf( _( "Blocklist \"%s\" updated with %d entries" ), base, outCount );

tr_free( base );

}

diff -NaurX /home/rberber/diff-excludes.txt transmission-2.00-orig/libtransmission/fdlimit.c transmission-2.00/libtransmission/fdlimit.c --- transmission-2.00-orig/libtransmission/fdlimit.c 2010-06-15 20:32:58.000000000 -0500 +++ transmission-2.00/libtransmission/fdlimit.c 2010-06-17 18:52:25.000000000 -0500 @@ -125,7 +125,7 @@

#ifdef WIN32

  • HANDLE hFile = CreateFile?( filename, GENERIC_WRITE, 0, 0, CREATE_NEW, 0, 0 );

+ HANDLE hFile = CreateFile?( filename, GENERIC_WRITE, 0, 0, CREATE_NEW, FILE_FLAG_RANDOM_ACCESS, 0 );

if( hFile != INVALID_HANDLE_VALUE ) {

LARGE_INTEGER li;

@@ -338,7 +338,7 @@

char * dir = tr_dirname( filename ); const int err = tr_mkdirp( dir, 0777 ) ? errno : 0; if( err ) {

  • tr_err( _( "Couldn't create \"%1$s\": %2$s" ), dir, tr_strerror( err ) );

+ tr_err( _( "Couldn't create \"%s\": %s" ), dir, tr_strerror( err ) );

tr_free( dir ); return err;

}

@@ -366,7 +366,7 @@

if( file->fd == -1 ) {

const int err = errno;

  • tr_err( _( "Couldn't open \"%1$s\": %2$s" ), filename, tr_strerror( err ) );

+ tr_err( _( "Couldn't open \"%s\": %s" ), filename, tr_strerror( err ) );

return err;

}

diff -NaurX /home/rberber/diff-excludes.txt transmission-2.00-orig/libtransmission/handshake.c transmission-2.00/libtransmission/handshake.c --- transmission-2.00-orig/libtransmission/handshake.c 2010-06-15 20:32:58.000000000 -0500 +++ transmission-2.00/libtransmission/handshake.c 2010-06-17 18:52:25.000000000 -0500 @@ -346,7 +346,7 @@

/* send it */ setReadState( handshake, AWAITING_YB );

  • tr_peerIoWrite( handshake->io, outbuf, walk-outbuf, FALSE );

+ tr_peerIoWrite( handshake->io, outbuf, walk - outbuf, FALSE );

}

static uint32_t

diff -NaurX /home/rberber/diff-excludes.txt transmission-2.00-orig/libtransmission/metainfo.c transmission-2.00/libtransmission/metainfo.c --- transmission-2.00-orig/libtransmission/metainfo.c 2010-06-15 20:32:58.000000000 -0500 +++ transmission-2.00/libtransmission/metainfo.c 2010-06-17 18:52:25.000000000 -0500 @@ -112,7 +112,7 @@

out = fopen( name, "wb+" ); if( !out ) {

  • tr_nerr( inf->name, _( "Couldn't create \"%1$s\": %2$s" ),

+ tr_nerr( inf->name, _( "Couldn't create \"%s\": %s" ),

name, tr_strerror( errno ) );

} else

diff -NaurX /home/rberber/diff-excludes.txt transmission-2.00-orig/libtransmission/net.c transmission-2.00/libtransmission/net.c --- transmission-2.00-orig/libtransmission/net.c 2010-06-15 20:32:58.000000000 -0500 +++ transmission-2.00/libtransmission/net.c 2010-06-17 18:52:25.000000000 -0500 @@ -32,8 +32,9 @@

#include <sys/types.h>

#ifdef WIN32

  • #include <winsock2.h> /* inet_addr */
  • #include <WS2tcpip.h>

+ #define _WIN32_WINNT 0x0501 + #include <ws2tcpip.h> + #define EADDRINUSE WSAEADDRINUSE

#else

#include <sys/socket.h> #include <netinet/in.h>

diff -NaurX /home/rberber/diff-excludes.txt transmission-2.00-orig/libtransmission/net.h transmission-2.00/libtransmission/net.h --- transmission-2.00-orig/libtransmission/net.h 2010-06-15 20:32:58.000000000 -0500 +++ transmission-2.00/libtransmission/net.h 2010-06-17 18:52:25.000000000 -0500 @@ -31,8 +31,7 @@

#ifdef WIN32

#include <inttypes.h>

  • #include <winsock2.h>
  • #include <WS2tcpip.h>

+ #include <ws2tcpip.h>

typedef int socklen_t;

#else

#include <sys/types.h>

diff -NaurX /home/rberber/diff-excludes.txt transmission-2.00-orig/libtransmission/peer-io.c transmission-2.00/libtransmission/peer-io.c --- transmission-2.00-orig/libtransmission/peer-io.c 2010-06-15 20:32:58.000000000 -0500 +++ transmission-2.00/libtransmission/peer-io.c 2010-06-17 18:52:25.000000000 -0500 @@ -19,8 +19,52 @@

#ifdef WIN32

#include <winsock2.h>

+ #define WINDOWS_SUCKS 1 + int fix_errno () { + int werror= WSAGetLastError(); + switch(werror) { + case WSAEWOULDBLOCK: errno = EAGAIN; break; + case WSAEINTR: errno = EINTR; break; + case WSAEBADF: errno = EBADF; break; + case WSAEACCES: errno = EACCES; break; + case WSAEFAULT: errno = EFAULT; break; + case WSAEINVAL: errno = EINVAL; break; + case WSAEMFILE: errno = EMFILE; break; + case WSAEINPROGRESS: errno = werror; break; /* net.h has these */ + case WSAEALREADY: errno = 120; break; + case WSAENOTSOCK: errno = 108; break; + case WSAEDESTADDRREQ: errno = 121; break; + case WSAEMSGSIZE: errno = 122; break; + case WSAEPROTOTYPE: errno = 107; break; + case WSAENOPROTOOPT: errno = 109; break; + case WSAEAFNOSUPPORT: errno = werror; break; + case WSAEADDRINUSE: errno = 112; break; + case WSAEADDRNOTAVAIL: errno = 125; break; + case WSAENETDOWN: errno = 115; break; + case WSAENETUNREACH: errno = werror; break; + case WSAENETRESET: errno = 126; break; + case WSAECONNABORTED: errno = 113; break; + case WSAECONNRESET: errno = werror; break; + case WSAENOBUFS: errno = 105; break; + case WSAEISCONN: errno = 127; break; + case WSAENOTCONN: errno = werror; break; + case WSAESHUTDOWN: errno = 110; break; + case WSAETOOMANYREFS: errno = 129; break; + case WSAETIMEDOUT: errno = 116; break; + case WSAECONNREFUSED: errno = werror; break; + case WSAELOOP: errno = 92; break; + case WSAENAMETOOLONG: errno = ENAMETOOLONG; break; + case WSAEHOSTDOWN: errno = 117; break; + case WSAEHOSTUNREACH: break; + default: + errno = werror; + break; + } + return errno; + }

#else

#include <arpa/inet.h> /* inet_ntoa */

+ #define WINDOWS_SUCKS 0

#endif

#include <event.h>

@@ -223,7 +267,7 @@

errno = 0; res = evbuffer_read( io->inbuf, fd, howmuch );

  • e = errno;

+ e = WINDOWS_SUCKS? fix_errno() : errno;

if( res > 0 ) {

@@ -268,8 +312,8 @@

#else

n = (int) write(fd, buffer->buffer, howmuch );

#endif

  • e = errno;
  • dbgmsg( io, "wrote %d to peer (%s)", n, (n==-1?strerror(e):"") );

+ e = WINDOWS_SUCKS? fix_errno() : errno; + dbgmsg(io, "wrote %d to peer (%d, %s)", n, e, (n == -1? strerror(e):"no error"));

if( n > 0 )

evbuffer_drain( buffer, n );

@@ -315,18 +359,11 @@

e = errno;

if (res == -1) {

-#ifndef WIN32 -/*todo. evbuffer uses WriteFile? when WIN32 is set. WIN32 system calls do not

  • * *set errno. thus this error checking is not portable*/
if (e == EAGAIN
e == EINTR e == EINPROGRESS)

goto reschedule;

/* error case */ what |= EVBUFFER_ERROR;

-#else

  • goto reschedule;

-#endif -

} else if (res == 0) {

/* eof case */ what |= EVBUFFER_EOF;

@@ -769,7 +806,7 @@

struct tr_datatype * datatype;

assert( tr_amInEventThread( io->session ) );

  • dbgmsg( io, "adding %zu bytes into io->output", byteCount );

+ dbgmsg( io, "adding %u bytes into io->output", byteCount );

datatype = tr_new( struct tr_datatype, 1 ); datatype->isPieceData = isPieceData != 0;

@@ -881,7 +918,7 @@

int e; errno = 0; res = evbuffer_read( io->inbuf, io->socket, howmuch );

  • e = errno;

+ e = WINDOWS_SUCKS? fix_errno() : errno;

dbgmsg( io, "read %d from peer (%s)", res, (res==-1?strerror(e):"") );

@@ -945,7 +982,7 @@

bytesUsed = tr_peerIoTryWrite( io, limit );

}

  • dbgmsg( io, "flushing peer-io, hasFinishedConnecting %d, direction %d, limit %zu, bytesUsed %d", (int)io->hasFinishedConnecting, (int)dir, limit, bytesUsed );

+ dbgmsg( io, "flushing peer-io, hasFinishedConnecting %d, direction %s, limit %u, bytesUsed %d", (int)io->hasFinishedConnecting, (dir == TR_DOWN)? "DOWN":"UP", limit, bytesUsed );

return bytesUsed;

}

diff -NaurX /home/rberber/diff-excludes.txt transmission-2.00-orig/libtransmission/peer-mgr.c transmission-2.00/libtransmission/peer-mgr.c --- transmission-2.00-orig/libtransmission/peer-mgr.c 2010-06-15 20:32:58.000000000 -0500 +++ transmission-2.00/libtransmission/peer-mgr.c 2010-06-17 18:52:25.000000000 -0500 @@ -15,6 +15,9 @@

#include <stdlib.h> /* qsort */

#include <event.h>

+#ifdef WIN32 + #include <errno.h> +#endif

#include "transmission.h" #include "announcer.h"

diff -NaurX /home/rberber/diff-excludes.txt transmission-2.00-orig/libtransmission/platform.c transmission-2.00/libtransmission/platform.c --- transmission-2.00-orig/libtransmission/platform.c 2010-06-15 20:32:58.000000000 -0500 +++ transmission-2.00/libtransmission/platform.c 2010-06-17 18:52:25.000000000 -0500 @@ -352,7 +352,7 @@

}

if( count )

  • tr_inf( _( "Migrated %1$d files from \"%2$s\" to \"%3$s\"" ),

+ tr_inf( _( "Migrated %d files from \"%s\" to \"%s\"" ),

count, oldDir, newDir );

closedir( dirh );

}

@@ -436,7 +436,7 @@

s = tr_buildPath( getHomeDir( ), "Library", "Application Support",

appname, NULL );

#elif defined( WIN32 )

  • char appdata[TR_MAX_PATH]; /* SHGetFolderPath() requires MAX_PATH */

+ char appdata[TR_PATH_MAX]; /* SHGetFolderPath() requires MAX_PATH */

SHGetFolderPath( NULL, CSIDL_APPDATA, NULL, 0, appdata ); s = tr_buildPath( appdata, appname, NULL );

#elif defined( HAIKU )

diff -NaurX /home/rberber/diff-excludes.txt transmission-2.00-orig/libtransmission/platform.h transmission-2.00/libtransmission/platform.h --- transmission-2.00-orig/libtransmission/platform.h 2010-06-15 20:32:58.000000000 -0500 +++ transmission-2.00/libtransmission/platform.h 2010-06-17 18:52:25.000000000 -0500 @@ -26,8 +26,8 @@

#endif

#ifdef WIN32

  • #include <windows.h> /* MAX_PATH */
  • #define TR_PATH_MAX MAX_PATH

+ #include <windef.h> /* MAX_PATH */ + #define TR_PATH_MAX (MAX_PATH + 1)

#else

#include <limits.h> /* PATH_MAX */ #ifdef PATH_MAX

diff -NaurX /home/rberber/diff-excludes.txt transmission-2.00-orig/libtransmission/port-forwarding.c transmission-2.00/libtransmission/port-forwarding.c --- transmission-2.00-orig/libtransmission/port-forwarding.c 2010-06-15 20:32:58.000000000 -0500 +++ transmission-2.00/libtransmission/port-forwarding.c 2010-06-17 18:52:25.000000000 -0500 @@ -84,7 +84,7 @@

newStatus = tr_sharedTraversalStatus( s );

if( newStatus != oldStatus )

  • tr_ninf( getKey( ), _( "State changed from \"%1$s\" to \"%2$s\"" ),

+ tr_ninf( getKey( ), _( "State changed from \"%s\" to \"%s\"" ),

getNatStateStr( oldStatus ), getNatStateStr( newStatus ) );

}

diff -NaurX /home/rberber/diff-excludes.txt transmission-2.00-orig/libtransmission/rpcimpl.c transmission-2.00/libtransmission/rpcimpl.c --- transmission-2.00-orig/libtransmission/rpcimpl.c 2010-06-15 20:32:58.000000000 -0500 +++ transmission-2.00/libtransmission/rpcimpl.c 2010-06-17 18:52:25.000000000 -0500 @@ -859,7 +859,7 @@

if( response_code != 200 ) {

  • tr_snprintf( result, sizeof( result ), "http error %ld: %s",

+ tr_snprintf( result, sizeof( result ), "portTested: http error %ld: %s",

response_code, tr_webGetResponseStr( response_code ) );

} else /* success */

@@ -901,19 +901,19 @@

if( response_code != 200 ) {

  • tr_snprintf( result, sizeof( result ), "http error %ld: %s",

+ tr_snprintf( result, sizeof( result ), "gotNewBlocklist: http error %ld: %s",

response_code, tr_webGetResponseStr( response_code ) );

} else /* successfully fetched the blocklist... */ {

const char * configDir = tr_sessionGetConfigDir( session ); char * filename = tr_buildPath( configDir, "blocklist.tmp", NULL );

  • FILE * fp = fopen( filename, "w+" );

+ FILE * fp = fopen( filename, "wb+" );

if( fp == NULL ) {

tr_snprintf( result, sizeof( result ),

  • _( "Couldn't save file \"%1$s\": %2$s" ),

+ _( "Couldn't save file \"%s\": %s" ),

filename, tr_strerror( errno ) );

} else

@@ -924,7 +924,7 @@

if( n != response_byte_count ) {

tr_snprintf( result, sizeof( result ),

  • _( "Couldn't save file \"%1$s\": %2$s" ),

+ _( "Couldn't save file \"%s\": %s" ),

filename, tr_strerror( errno ) );

} else

@@ -1022,7 +1022,7 @@

else {

char result[1024];

  • tr_snprintf( result, sizeof( result ), "http error %ld: %s",

+ tr_snprintf( result, sizeof( result ), "gotMetadataFromURL: http error %ld: %s",

response_code, tr_webGetResponseStr( response_code ) );

tr_idle_function_done( data->data, result );

}

diff -NaurX /home/rberber/diff-excludes.txt transmission-2.00-orig/libtransmission/torrent.c transmission-2.00/libtransmission/torrent.c --- transmission-2.00-orig/libtransmission/torrent.c 2010-06-15 20:32:58.000000000 -0500 +++ transmission-2.00/libtransmission/torrent.c 2010-06-17 18:52:25.000000000 -0500 @@ -1666,6 +1666,19 @@

tr_torrentSetRatioLimitHitCallback( torrent, NULL, NULL );

}

+#ifdef WIN32 +#include <pthread.h> /* asctime_r(), ctime_r(), localtime_r() */ + +static void +setenv (const char *name, const char *value, int override) +{ + int len = strlen(name) + strlen(value) + 2; + char *str = malloc(len); + sprintf(str, "%s=%s", name, value); + putenv(str); + /* leaks memory on purpose (i.e. Windows semantics) */ +} +#endif

static void torrentCallScript( tr_torrent * tor, const char * script )

@@ -1713,7 +1726,7 @@

if( recentChange ) {

  • tr_torinf( tor, _( "State changed from \"%1$s\" to \"%2$s\"" ),

+ tr_torinf( tor, _( "State changed from \"%s\" to \"%s\"" ),

getCompletionString( tor->completeness ), getCompletionString( completeness ) );

}

diff -NaurX /home/rberber/diff-excludes.txt transmission-2.00-orig/libtransmission/tr-dht.c transmission-2.00/libtransmission/tr-dht.c --- transmission-2.00-orig/libtransmission/tr-dht.c 2010-06-15 20:32:58.000000000 -0500 +++ transmission-2.00/libtransmission/tr-dht.c 2010-06-17 18:52:25.000000000 -0500 @@ -25,13 +25,19 @@

#include <stdio.h>

/* posix */

-#include <netinet/in.h> /* sockaddr_in */

#include <signal.h> /* sig_atomic_t */ #include <sys/time.h>

-#include <sys/types.h> -#include <sys/socket.h> /* socket(), bind() */ -#include <netdb.h>

#include <unistd.h> /* close() */

+#ifdef WIN32 + #include <inttypes.h> + #define _WIN32_WINNT 0x0501 /* freeaddrinfo(),getaddrinfo(),getnameinfo() */ + #include <ws2tcpip.h> +#else + #include <sys/types.h> + #include <sys/socket.h> /* socket(), bind() */ + #include <netdb.h> + #include <netinet/in.h> /* sockaddr_in */ +#endif

/* third party */ #include <event.h>

@@ -193,7 +199,7 @@

tr_buildPath(cl->session->configDir, "dht.bootstrap", NULL);

if(bootstrap_file)

  • f = fopen(bootstrap_file, "r");

+ f = fopen(bootstrap_file, "rb");

if(f != NULL) {

tr_ninf("DHT", "Attempting manual bootstrap"); for(;;) {

diff -NaurX /home/rberber/diff-excludes.txt transmission-2.00-orig/libtransmission/tr-lpd.c transmission-2.00/libtransmission/tr-lpd.c --- transmission-2.00-orig/libtransmission/tr-lpd.c 2010-06-15 20:32:58.000000000 -0500 +++ transmission-2.00/libtransmission/tr-lpd.c 2010-06-17 18:52:25.000000000 -0500 @@ -25,14 +25,21 @@

#include <stdio.h>

/* posix */

-#include <netinet/in.h> /* sockaddr_in */

#include <signal.h> /* sig_atomic_t */ #include <sys/time.h>

-#include <sys/types.h> -#include <sys/socket.h> /* socket(), bind() */

#include <unistd.h> /* close() */ #include <fcntl.h> /* fcntl(), O_NONBLOCK */ #include <ctype.h> /* toupper() */

+#ifdef WIN32 + #include <inttypes.h> + #define _WIN32_WINNT 0x0501 /* freeaddrinfo(),getaddrinfo(),getnameinfo() */ + #include <ws2tcpip.h> + typedef unsigned short in_port_t; +#else + #include <sys/types.h> + #include <sys/socket.h> /* socket(), bind() */ + #include <netinet/in.h> /* sockaddr_in */ +#endif

/* third party */ #include <event.h>

@@ -125,6 +132,59 @@

  • @brief a line-feed, as understood by the LPD protocol */ #define CRLF "\r\n"

+#ifdef WIN32 +static const char * +inet_ntop( int af, const void *src, char *dst, socklen_t cnt ) +{ + if (af == AF_INET) + { + struct sockaddr_in in; + memset( &in, 0, sizeof( in ) ); + in.sin_family = AF_INET; + memcpy( &in.sin_addr, src, sizeof( struct in_addr ) ); + getnameinfo((struct sockaddr *)&in, sizeof(struct sockaddr_in), + dst, cnt, NULL, 0, NI_NUMERICHOST); + return dst; + } + else if (af == AF_INET6) + { + struct sockaddr_in6 in; + memset( &in, 0, sizeof( in ) ); + in.sin6_family = AF_INET6; + memcpy( &in.sin6_addr, src, sizeof( struct in_addr6 ) ); + getnameinfo((struct sockaddr *)&in, sizeof(struct sockaddr_in6), + dst, cnt, NULL, 0, NI_NUMERICHOST); + return dst; + } + return NULL; +} + +static int +inet_pton(int af, const char *src, void *dst) +{ + struct addrinfo hints; + struct addrinfo *res; + struct addrinfo *ressave; + + memset(&hints, 0, sizeof(struct addrinfo)); + hints.ai_family = af; + + if (getaddrinfo(src, NULL, &hints, &res) != 0) + return -1; + + ressave = res; + + while (res) + { + memcpy(dst, res->ai_addr, res->ai_addrlen); + res = res->ai_next; + } + + freeaddrinfo(ressave); + return 0; +} +#endif +

/

@@ -242,6 +302,7 @@

  • @} */

+#ifndef WIN32

/

  • @brief Configures additional capabilities for a socket */ static inline int lpd_configureSocket( int sock, int add )

@@ -257,6 +318,7 @@

return add;

}

+#endif

/

  • @brief Initializes Local Peer Discovery for this node

@@ -291,7 +353,12 @@

goto fail;

/* enable non-blocking operation */

+#ifdef WIN32 + unsigned long flags= 1; + if (ioctlsocket(lpd_socket, FIONBIO, &flags) == SOCKET_ERROR) +#else

if( lpd_configureSocket( lpd_socket, O_NONBLOCK ) < 0 )

+#endif

goto fail;

if( setsockopt( lpd_socket, SOL_SOCKET, SO_REUSEADDR,

@@ -331,7 +398,12 @@

goto fail;

/* enable non-blocking operation */

+#ifdef WIN32 + unsigned long flags= 1; + if (ioctlsocket(lpd_socket, FIONBIO, &flags) == SOCKET_ERROR) +#else

if( lpd_configureSocket( lpd_socket2, O_NONBLOCK ) < 0 )

+#endif

goto fail;

/* configure outbound multicast TTL */

diff -NaurX /home/rberber/diff-excludes.txt transmission-2.00-orig/libtransmission/trevent.c transmission-2.00/libtransmission/trevent.c --- transmission-2.00-orig/libtransmission/trevent.c 2010-06-15 20:32:58.000000000 -0500 +++ transmission-2.00/libtransmission/trevent.c 2010-06-17 18:52:25.000000000 -0500 @@ -26,79 +26,95 @@

#ifdef WIN32

-#include <WinSock2.h> +#include "utils.h" +#include <winsock2.h>

static int pgpipe( int handles[2] ) {

  • SOCKET s;
  • struct sockaddr_in serv_addr;
  • int len = sizeof( serv_addr );

+ SOCKET s; + struct sockaddr_in serv_addr; + int len = sizeof( serv_addr );

  • handles[0] = handles[1] = INVALID_SOCKET;

+ handles[0] = handles[1] = INVALID_SOCKET;

  • if ( ( s = socket( AF_INET, SOCK_STREAM, 0 ) ) == INVALID_SOCKET )
  • {

-/* ereport(LOG, (errmsg_internal("pgpipe failed to create socket: %ui", WSAGetLastError()))); */

  • return -1;
  • }

+ if ( ( s = socket( AF_INET, SOCK_STREAM, 0 ) ) == INVALID_SOCKET ) + { + tr_dbg("pgpipe failed to create socket: %ui", WSAGetLastError()); + return -1; + }

  • memset( &serv_addr, 0, sizeof( serv_addr ) );
  • serv_addr.sin_family = AF_INET;
  • serv_addr.sin_port = htons(0);
  • serv_addr.sin_addr.s_addr = htonl(INADDR_LOOPBACK);
  • if (bind(s, (SOCKADDR *) & serv_addr, len) == SOCKET_ERROR)
  • {

-/* ereport(LOG, (errmsg_internal("pgpipe failed to bind: %ui", WSAGetLastError()))); */

  • closesocket(s);
  • return -1;
  • }
  • if (listen(s, 1) == SOCKET_ERROR)
  • {

-/* ereport(LOG, (errmsg_internal("pgpipe failed to listen: %ui", WSAGetLastError()))); */

  • closesocket(s);
  • return -1;
  • }
  • if (getsockname(s, (SOCKADDR *) & serv_addr, &len) == SOCKET_ERROR)
  • {

-/* ereport(LOG, (errmsg_internal("pgpipe failed to getsockname: %ui", WSAGetLastError()))); */

  • closesocket(s);
  • return -1;
  • }
  • if ((handles[1] = socket(PF_INET, SOCK_STREAM, 0)) == INVALID_SOCKET)
  • {

-/* ereport(LOG, (errmsg_internal("pgpipe failed to create socket 2: %ui", WSAGetLastError()))); */

  • closesocket(s);
  • return -1;
  • }

+ memset( &serv_addr, 0, sizeof( serv_addr ) ); + serv_addr.sin_family = AF_INET; + serv_addr.sin_port = htons(0); + serv_addr.sin_addr.s_addr = htonl(INADDR_LOOPBACK); + if (bind(s, (SOCKADDR *) & serv_addr, len) == SOCKET_ERROR) + { + tr_dbg("pgpipe failed to bind: %ui", WSAGetLastError()); + closesocket(s); + return -1; + } + if (listen(s, 1) == SOCKET_ERROR) + { + tr_ndbg("event","pgpipe failed to listen: %ui", WSAGetLastError()); + closesocket(s); + return -1; + } + if (getsockname(s, (SOCKADDR *) & serv_addr, &len) == SOCKET_ERROR) + { + tr_dbg("pgpipe failed to getsockname: %ui", WSAGetLastError()); + closesocket(s); + return -1; + } + if ((handles[1] = socket(PF_INET, SOCK_STREAM, 0)) == INVALID_SOCKET) + { + tr_dbg("pgpipe failed to create socket 2: %ui", WSAGetLastError()); + closesocket(s); + return -1; + }

  • if (connect(handles[1], (SOCKADDR *) & serv_addr, len) == SOCKET_ERROR)
  • {

-/* ereport(LOG, (errmsg_internal("pgpipe failed to connect socket: %ui", WSAGetLastError()))); */

  • closesocket(s);
  • return -1;
  • }
  • if ((handles[0] = accept(s, (SOCKADDR *) & serv_addr, &len)) == INVALID_SOCKET)
  • {

-/* ereport(LOG, (errmsg_internal("pgpipe failed to accept socket: %ui", WSAGetLastError()))); */

  • closesocket(handles[1]);
  • handles[1] = INVALID_SOCKET;
  • closesocket(s);
  • return -1;
  • }

+ if (connect(handles[1], (SOCKADDR *) & serv_addr, len) == SOCKET_ERROR) + { + tr_dbg("pgpipe failed to connect socket: %ui", WSAGetLastError()); + closesocket(s); + return -1; + } + if ((handles[0] = accept(s, (SOCKADDR *) & serv_addr, &len)) == INVALID_SOCKET) + { + tr_dbg("pgpipe failed to accept socket: %ui", WSAGetLastError()); + closesocket(handles[1]); + handles[1] = INVALID_SOCKET;

closesocket(s);

  • return 0;

+ return -1; + } + closesocket(s); + return 0;

}

static int piperead( int s, char *buf, int len ) {

  • int ret = recv(s, buf, len, 0);

+ int ret = recv(s, buf, len, 0); + int werror = 0;

  • if (ret < 0 && WSAGetLastError() == WSAECONNRESET)
  • /* EOF on the pipe! (win32 socket based implementation) */
  • ret = 0;
  • return ret;

+ if (ret < 0) { + werror= WSAGetLastError(); + switch(werror) { + /* simplified error mapping (not valid for connect) */ + case WSAEWOULDBLOCK: + errno = EAGAIN; + break; + case WSAECONNRESET: + /* EOF on the pipe! (win32 socket based implementation) */ + ret = 0; + /* fall through */ + default: + errno = werror; + break; + } + } else + errno = 0; + return ret;

}

#define pipe(a) pgpipe(a)

diff -NaurX /home/rberber/diff-excludes.txt transmission-2.00-orig/libtransmission/utils.c transmission-2.00/libtransmission/utils.c --- transmission-2.00-orig/libtransmission/utils.c 2010-06-15 20:32:58.000000000 -0500 +++ transmission-2.00/libtransmission/utils.c 2010-06-17 19:07:26.000000000 -0500 @@ -34,6 +34,9 @@

#include <sys/types.h> #include <sys/stat.h> #include <unistd.h> /* usleep, stat, getcwd, getpagesize */

+#ifdef WIN32 +#define getpagesize() 65536 +#endif

#include "event.h"

@@ -481,7 +484,7 @@

struct stat sb; int fd; ssize_t n;

  • const char * err_fmt = _( "Couldn't read \"%1$s\": %2$s" );

+ const char * err_fmt = _( "Couldn't read \"%s\": %s" );

/* try to stat the file */ errno = 0;

@@ -601,7 +604,7 @@

{

const int err = errno; tr_err( _(

  • "Couldn't create \"%1$s\": %2$s" ), path,

+ "Couldn't create \"%s\": %s" ), path,

tr_strerror( err ) );

tr_free( path ); errno = err;

@@ -612,7 +615,7 @@

{

/* Node exists but isn't a folder */ char * buf = tr_strdup_printf( _( "File \"%s\" is in the way" ), path );

  • tr_err( _( "Couldn't create \"%1$s\": %2$s" ), path_in, buf );

+ tr_err( _( "Couldn't create \"%s\": %s" ), path_in, buf );

tr_free( buf ); tr_free( path ); errno = ENOTDIR;

@@ -1429,7 +1432,11 @@

/* copy the file */ in = tr_open_file_for_scanning( oldpath ); out = tr_open_file_for_writing( newpath );

+#ifdef WIN32 + buflen = 4096; +#else

buflen = stat( newpath, &st ) ? 4096 : st.st_blksize;

+#endif

buf = tr_valloc( buflen ); while( bytesLeft > 0 ) {

diff -NaurX /home/rberber/diff-excludes.txt transmission-2.00-orig/libtransmission/web.c transmission-2.00/libtransmission/web.c --- transmission-2.00-orig/libtransmission/web.c 2010-06-15 20:32:58.000000000 -0500 +++ transmission-2.00/libtransmission/web.c 2010-06-17 18:52:25.000000000 -0500 @@ -10,7 +10,9 @@

  • $Id: web.c 10535 2010-04-28 00:32:43Z charles $ */

+#ifndef WIN32

#include <sys/select.h>

+#endif

#include <curl/curl.h> #include <event.h>

@@ -94,7 +96,11 @@

const size_t byteCount = size * nmemb; struct tr_web_task * task = vtask; evbuffer_add( task->response, ptr, byteCount );

+#ifndef WIN32

dbgmsg( "wrote %zu bytes to task %p's buffer", byteCount, task );

+#else + dbgmsg( "wrote %u bytes to task %p's buffer", byteCount, task); +#endif

return byteCount;

}

@@ -274,7 +280,7 @@

while(( task = tr_list_pop_front( &web->tasks ))) {

curl_multi_add_handle( multi, createEasy( session, task ));

  • /*fprintf( stderr, "adding a task.. taskCount is now %d\n", taskCount );*/

+ fprintf( stderr, "adding a task.. taskCount is now %d\n", taskCount );

++taskCount;

} tr_lockUnlock( web->taskLock );

@@ -304,6 +310,9 @@

t.tv_sec = usec / 1000000; t.tv_usec = usec % 1000000;

+#ifdef WIN32 + Sleep(msec); /* Windows' select() doesn't like the parameters below... */ +#endif

select( max_fd+1, &r_fd_set, &w_fd_set, &c_fd_set, &t );

}

@@ -323,7 +332,7 @@

curl_easy_getinfo( e, CURLINFO_RESPONSE_CODE, &task->code ); curl_multi_remove_handle( multi, e ); curl_easy_cleanup( e );

-/*fprintf( stderr, "removing a completed task.. taskCount is now %d (response code: %d, response len: %d)\n", taskCount, (int)task->code, (int)EVBUFFER_LENGTH(task->response) );*/ + fprintf( stderr, "removing a completed task.. taskCount is now %d (response code: %d, response len: %d)\n", taskCount, (int)task->code, (int)EVBUFFER_LENGTH(task->response) );

tr_runInEventThread( task->session, task_finish_func, task ); --taskCount;

}

diff -NaurX /home/rberber/diff-excludes.txt transmission-2.00-orig/qt/qtr.pro transmission-2.00/qt/qtr.pro --- transmission-2.00-orig/qt/qtr.pro 2010-06-15 20:32:59.000000000 -0500 +++ transmission-2.00/qt/qtr.pro 2010-06-17 19:06:14.000000000 -0500 @@ -1,7 +1,7 @@

TARGET = qtr NAME = "Transmission" DESCRIPTION = "Transmission: a fast, easy, and free BitTorrent? client"

-VERSION = 1.60 +VERSION = 2.00

LICENSE = "GPL"

target.path = /bin

@@ -9,7 +9,7 @@

CONFIG += qt qdbus thread debug link_pkgconfig QT += network

-PKGCONFIG = fontconfig libcurl openssl +PKGCONFIG = fontconfig libcurl openssl dbus-1

TRANSMISSION_TOP = .. INCLUDEPATH += $${TRANSMISSION_TOP}

@@ -17,7 +17,10 @@

LIBS += $${TRANSMISSION_TOP}/third-party/dht/libdht.a LIBS += $${TRANSMISSION_TOP}/third-party/miniupnp/libminiupnp.a LIBS += $${TRANSMISSION_TOP}/third-party/libnatpmp/libnatpmp.a

-LIBS += -levent +unix: LIBS += -levent +win32:DEFINES += QT_DBUS +win32:LIBS += -levent -lws2_32 -lintl +win32:LIBS += -lidn -liconv -lwldap32 -liphlpapi

TRANSLATIONS += transmission_en.ts transmission_ru.ts

@@ -31,4 +34,4 @@

torrent-model.cc triconpushbutton.cc utils.cc watchdir.cc

HEADERS += $$replace(SOURCES, .cc, .h) HEADERS += speed.h types.h

- +win32:RC_FILE = qtr.rc diff -NaurX /home/rberber/diff-excludes.txt transmission-2.00-orig/qt/qtr.rc transmission-2.00/qt/qtr.rc --- transmission-2.00-orig/qt/qtr.rc 1969-12-31 18:00:00.000000000 -0600 +++ transmission-2.00/qt/qtr.rc 2010-06-17 18:52:25.000000000 -0500 @@ -0,0 +1 @@ +IDI_ICON1 ICON DISCARDABLE "qtr.ico" diff -NaurX /home/rberber/diff-excludes.txt transmission-2.00-orig/qt/session.cc transmission-2.00/qt/session.cc --- transmission-2.00-orig/qt/session.cc 2010-06-15 20:32:59.000000000 -0500 +++ transmission-2.00/qt/session.cc 2010-06-17 18:52:25.000000000 -0500 @@ -142,6 +142,7 @@

case Prefs
DOWNLOAD_DIR:
case Prefs
DSPEED:
case Prefs
DSPEED_ENABLED:
+ case Prefs :: ENCRYPTION:
case Prefs
INCOMPLETE_DIR:
case Prefs
INCOMPLETE_DIR_ENABLED:
case Prefs
LPD_ENABLED:
diff -NaurX /home/rberber/diff-excludes.txt transmission-2.00-orig/qt/utils.cc transmission-2.00/qt/utils.cc --- transmission-2.00-orig/qt/utils.cc 2010-06-15 20:32:59.000000000 -0500 +++ transmission-2.00/qt/utils.cc 2010-06-17 18:52:25.000000000 -0500 @@ -76,12 +76,12 @@

else if( size < (int64_t)GIGABYTE_FACTOR ) {

displayed_size = (double)size / MEGABYTE_FACTOR;

  • str = tr( "%L1 MiB" ).arg( displayed_size, 0, 'f', 1 );

+ str = tr( "%L1 MiB" ).arg( displayed_size, 0, 'f', 2 );

} else {

displayed_size = (double) size / GIGABYTE_FACTOR;

  • str = tr( "%L1 GiB" ).arg( displayed_size, 0, 'f', 1 );

+ str = tr( "%L1 GiB" ).arg( displayed_size, 0, 'f', 3 );

}

}

diff -NaurX /home/rberber/diff-excludes.txt transmission-2.00-orig/third-party/dht/dht.c transmission-2.00/third-party/dht/dht.c --- transmission-2.00-orig/third-party/dht/dht.c 2010-06-15 20:33:16.000000000 -0500 +++ transmission-2.00/third-party/dht/dht.c 2010-06-17 18:52:25.000000000 -0500 @@ -39,10 +39,18 @@

#include <unistd.h> #include <fcntl.h> #include <sys/time.h>

+#ifndef WIN32

#include <arpa/inet.h> #include <sys/types.h> #include <sys/socket.h> #include <netinet/in.h>

+#else +#define WINVER WindowsXP /* freeaddrinfo(),getaddrinfo(),getnameinfo() */ +#include <ws2tcpip.h> +#define random rand /* int rand() since no long random() */ +const char *inet_ntop(int, const void *, char *, socklen_t); +#define EAFNOSUPPORT WSAEAFNOSUPPORT +#endif

#include "dht.h"

@@ -1530,6 +1538,10 @@

dht_init(int s, int s6, const unsigned char *id, const unsigned char *v) {

int rc;

+#ifdef WIN32 + unsigned long flags = 1; +#endif +

if(dht_socket >= 0
dht_socket6 >= 0 buckets buckets6) {

errno = EBUSY;

@@ -1548,11 +1560,15 @@

return -1;

buckets->af = AF_INET;

+#ifndef WIN32

rc = fcntl(s, F_GETFL, 0); if(rc < 0)

goto fail;

rc = fcntl(s, F_SETFL, (rc | O_NONBLOCK));

+#else + rc = ioctlsocket(s, FIONBIO, &flags); +#endif

if(rc < 0)

goto fail;

}

@@ -1563,11 +1579,15 @@

return -1;

buckets6->af = AF_INET6;

+#ifndef WIN32

rc = fcntl(s6, F_GETFL, 0); if(rc < 0)

goto fail;

rc = fcntl(s6, F_SETFL, (rc | O_NONBLOCK));

+#else + rc = ioctlsocket(s6, FIONBIO, &flags); +#endif

if(rc < 0)

goto fail;

}

@@ -2877,3 +2897,29 @@

debugf("Truncated message.\n"); return -1;

}

+ +#ifdef WIN32 +const char * +inet_ntop (int af, const void *src, char *dst, socklen_t cnt) +{ + if (af == AF_INET) + { + struct sockaddr_in in; + memset(&in, 0, sizeof(in)); + in.sin_family = AF_INET; + memcpy(&in.sin_addr, src, sizeof(struct in_addr)); + getnameinfo((struct sockaddr *)&in, sizeof(struct sockaddr_in), dst, cnt, NULL, 0, NI_NUMERICHOST); + return dst; + } + else if (af == AF_INET6) + { + struct sockaddr_in6 in; + memset(&in, 0, sizeof(in)); + in.sin6_family = AF_INET6; + memcpy(&in.sin6_addr, src, sizeof(struct in_addr6)); + getnameinfo((struct sockaddr *)&in, sizeof(struct sockaddr_in6), dst, cnt, NULL, 0, NI_NUMERICHOST); + return dst; + } + return NULL; +} +#endif diff -NaurX /home/rberber/diff-excludes.txt transmission-2.00-orig/third-party/miniupnp/miniupnpc.c transmission-2.00/third-party/miniupnp/miniupnpc.c --- transmission-2.00-orig/third-party/miniupnp/miniupnpc.c 2010-06-15 20:33:16.000000000 -0500 +++ transmission-2.00/third-party/miniupnp/miniupnpc.c 2010-06-17 19:15:56.000000000 -0500 @@ -24,7 +24,7 @@

#include <winsock2.h> #include <ws2tcpip.h> #include <io.h>

-#include <IPHlpApi.h> +#include <iphlpapi.h>

#define snprintf _snprintf #if defined(_MSC_VER) && (_MSC_VER >= 1400) #define strncasecmp _memicmp