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

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

patch file

diff -NaurX diff-excludes.txt transmission-1.61-orig/configure transmission-1.61/configure --- transmission-1.61-orig/configure 2009-05-12 00:34:04.000000000 +0000 +++ transmission-1.61/configure 2009-05-23 08:25:03.055357401 +0000 @@ -27567,6 +27567,7 @@

have_msw="yes" CXXFLAGS="$CXXFLAGS -mms-bitfields -mwin32 -mwindows" CPPFLAGS="$CPPFLAGS -DWIN32 -D_WIN32 -DWIN32_LEAN_AND_MEAN"

+ LDFLAGS="$LDFLAGS -no-undefined"

LIBS="$LIBS -lshell32 -lws2_32" transmissionlocaledir="locale" if test -z "$host_alias"; then

diff -NaurX diff-excludes.txt transmission-1.61-orig/libtransmission/fdlimit.c transmission-1.61/libtransmission/fdlimit.c --- transmission-1.61-orig/libtransmission/fdlimit.c 2009-05-12 00:32:26.000000000 +0000 +++ transmission-1.61/libtransmission/fdlimit.c 2009-05-23 03:22:11.565354847 +0000 @@ -302,7 +302,7 @@

/* open the file */ flags = doWrite ? ( O_RDWR | O_CREAT ) : O_RDONLY;

#ifdef O_RANDOM

  • flags |= O_RANDOM

+ flags |= O_RANDOM;

#endif #ifdef O_LARGEFILE

flags |= O_LARGEFILE;

diff -NaurX diff-excludes.txt transmission-1.61-orig/libtransmission/net.c transmission-1.61/libtransmission/net.c --- transmission-1.61-orig/libtransmission/net.c 2009-05-12 00:32:26.000000000 +0000 +++ transmission-1.61/libtransmission/net.c 2009-05-23 11:22:53.944463863 +0000 @@ -31,8 +31,8 @@

#include <sys/types.h>

#ifdef WIN32

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

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

#else

#include <arpa/inet.h> /* inet_addr */ #include <netdb.h>

diff -NaurX diff-excludes.txt transmission-1.61-orig/libtransmission/net.h transmission-1.61/libtransmission/net.h --- transmission-1.61-orig/libtransmission/net.h 2009-05-12 00:32:26.000000000 +0000 +++ transmission-1.61/libtransmission/net.h 2009-05-23 03:19:58.135376325 +0000 @@ -32,7 +32,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 diff-excludes.txt transmission-1.61-orig/libtransmission/trevent.c transmission-1.61/libtransmission/trevent.c --- transmission-1.61-orig/libtransmission/trevent.c 2009-05-12 00:32:26.000000000 +0000 +++ transmission-1.61/libtransmission/trevent.c 2009-05-23 03:25:39.131472658 +0000 @@ -23,7 +23,7 @@

#ifdef WIN32

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

static int pgpipe( int handles[2] )

diff -NaurX diff-excludes.txt transmission-1.61-orig/third-party/libnatpmp/getgateway.c transmission-1.61/third-party/libnatpmp/getgateway.c --- transmission-1.61-orig/third-party/libnatpmp/getgateway.c 2009-05-12 00:32:39.000000000 +0000 +++ transmission-1.61/third-party/libnatpmp/getgateway.c 2009-05-23 07:57:31.809390788 +0000 @@ -261,7 +261,7 @@

#endif /* #ifdef USE_SOCKET_ROUTE */

#ifdef USE_WIN32_CODE

-int getdefaultgateway(in_addr_t * addr) +LIBSPEC int getdefaultgateway(in_addr_t * addr)

{

HKEY networkCardsKey; HKEY networkCardKey;

diff -NaurX diff-excludes.txt transmission-1.61-orig/third-party/libnatpmp/natpmp.c transmission-1.61/third-party/libnatpmp/natpmp.c --- transmission-1.61-orig/third-party/libnatpmp/natpmp.c 2009-05-12 00:32:39.000000000 +0000 +++ transmission-1.61/third-party/libnatpmp/natpmp.c 2009-05-23 08:03:09.821359878 +0000 @@ -18,8 +18,9 @@

#include <time.h> #include <sys/time.h> #ifdef WIN32

+#include <errno.h>

#include <winsock2.h>

-#include <Ws2tcpip.h> +#include <ws2tcpip.h>

#include <io.h> #define EWOULDBLOCK WSAEWOULDBLOCK #define ECONNREFUSED WSAECONNREFUSED

@@ -34,7 +35,7 @@

#include "natpmp.h" #include "getgateway.h"

-int initnatpmp(natpmp_t * p) +LIBSPEC int initnatpmp(natpmp_t * p)

{ #ifdef WIN32

u_long ioctlArg = 1;

@@ -70,7 +71,7 @@

return 0;

}

-int closenatpmp(natpmp_t * p) +LIBSPEC int closenatpmp(natpmp_t * p)

{

if(!p)

return NATPMP_ERR_INVALIDARGS;

@@ -113,7 +114,7 @@

return n;

}

-int getnatpmprequesttimeout(natpmp_t * p, struct timeval * timeout) +LIBSPEC int getnatpmprequesttimeout(natpmp_t * p, struct timeval * timeout)

{

struct timeval now;

if(!p
!timeout)

@@ -131,7 +132,7 @@

return 0;

}

-int sendpublicaddressrequest(natpmp_t * p) +LIBSPEC int sendpublicaddressrequest(natpmp_t * p)

{

if(!p)

return NATPMP_ERR_INVALIDARGS;

@@ -143,7 +144,7 @@

return sendnatpmprequest(p);

}

-int sendnewportmappingrequest(natpmp_t * p, int protocol, +LIBSPEC int sendnewportmappingrequest(natpmp_t * p, int protocol,

uint16_t privateport, uint16_t publicport,

uint32_t lifetime)

{

@@ -228,7 +229,7 @@

return n;

}

-int readnatpmpresponseorretry(natpmp_t * p, natpmpresp_t * response) +LIBSPEC int readnatpmpresponseorretry(natpmp_t * p, natpmpresp_t * response)

{

int n;

if(!p
!response)

@@ -268,7 +269,7 @@

}

#ifdef ENABLE_STRNATPMPERR

-const char * strnatpmperr(int r) +LIBSPEC const char * strnatpmperr(int r)

{

const char * s; switch(r) {

diff -NaurX diff-excludes.txt transmission-1.61-orig/third-party/miniupnp/minissdpc.c transmission-1.61/third-party/miniupnp/minissdpc.c --- transmission-1.61-orig/third-party/miniupnp/minissdpc.c 2009-05-12 00:32:38.000000000 +0000 +++ transmission-1.61/third-party/miniupnp/minissdpc.c 2009-05-23 03:17:26.395365582 +0000 @@ -12,8 +12,14 @@

#include <sys/types.h> #ifdef WIN32 #include <winsock2.h>

-#include <Ws2tcpip.h> +#include <ws2tcpip.h>

#include <io.h>

+/* Hack */ +#define UNIX_PATH_LEN 108 +struct sockaddr_un { + uint16_t sun_family; + char sun_path[UNIX_PATH_LEN]; +};

#else #include <sys/socket.h> #include <sys/un.h>

diff -NaurX diff-excludes.txt transmission-1.61-orig/third-party/miniupnp/miniupnpc.c transmission-1.61/third-party/miniupnp/miniupnpc.c --- transmission-1.61-orig/third-party/miniupnp/miniupnpc.c 2009-05-12 00:32:38.000000000 +0000 +++ transmission-1.61/third-party/miniupnp/miniupnpc.c 2009-05-23 08:07:56.859450767 +0000 @@ -10,7 +10,7 @@

#ifdef WIN32 /* Win32 Specific includes and defines */ #include <winsock2.h>

-#include <Ws2tcpip.h> +#include <ws2tcpip.h>

#include <io.h> #define snprintf _snprintf #if defined(_MSC_VER) && (_MSC_VER >= 1400)

@@ -49,7 +49,7 @@

#define SERVICEPREFIX2 'u'

/* root description parsing */

-void parserootdesc(const char * buffer, int bufsize, struct IGDdatas * data) +LIBSPEC void parserootdesc(const char * buffer, int bufsize, struct IGDdatas * data)

{

struct xmlparser parser; /* xmlparser object */

@@ -340,7 +340,7 @@

  • no devices was found.
  • It is up to the caller to free the chained list
  • delay is in millisecond (poll) */

-struct UPNPDev * upnpDiscover(int delay, const char * multicastif, +LIBSPEC struct UPNPDev * upnpDiscover(int delay, const char * multicastif,

const char * minissdpdsock, int sameport)

{

struct UPNPDev * tmp;

@@ -489,7 +489,7 @@

/* freeUPNPDevlist() should be used to

  • free the chained list returned by upnpDiscover() */

-void freeUPNPDevlist(struct UPNPDev * devlist) +LIBSPEC void freeUPNPDevlist(struct UPNPDev * devlist)

{

struct UPNPDev * next; while(devlist)

@@ -525,7 +525,7 @@

/* Prepare the Urls for usage...

*/

-void GetUPNPUrls(struct UPNPUrls * urls, struct IGDdatas * data, +LIBSPEC void GetUPNPUrls(struct UPNPUrls * urls, struct IGDdatas * data,

const char * descURL)

{

char * p;

@@ -568,7 +568,7 @@

#endif }

-void +LIBSPEC void

FreeUPNPUrls(struct UPNPUrls * urls) {

if(!urls)

@@ -655,7 +655,7 @@

  • passed as parameters are set. Donc forget to call FreeUPNPUrls(urls) to
  • free allocated memory. */

-int +LIBSPEC int

UPNP_GetValidIGD(struct UPNPDev * devlist,

struct UPNPUrls * urls,

struct IGDdatas * data,

@@ -722,7 +722,7 @@

  • return value :
  • 0 - Not ok
  • 1 - OK */

-int +LIBSPEC int

UPNP_GetIGDFromUrl(const char * rootdescurl,

struct UPNPUrls * urls, struct IGDdatas * data,

diff -NaurX diff-excludes.txt transmission-1.61-orig/third-party/miniupnp/upnpcommands.c transmission-1.61/third-party/miniupnp/upnpcommands.c --- transmission-1.61-orig/third-party/miniupnp/upnpcommands.c 2009-05-12 00:32:38.000000000 +0000 +++ transmission-1.61/third-party/miniupnp/upnpcommands.c 2009-05-23 08:12:56.793365936 +0000 @@ -19,7 +19,7 @@

/*

  • */

-UNSIGNED_INTEGER +LIBSPEC UNSIGNED_INTEGER

UPNP_GetTotalBytesSent(const char * controlURL,

const char * servicetype)

{

@@ -39,7 +39,7 @@

/*

  • */

-UNSIGNED_INTEGER +LIBSPEC UNSIGNED_INTEGER

UPNP_GetTotalBytesReceived(const char * controlURL,

const char * servicetype)

{

@@ -59,7 +59,7 @@

/*

  • */

-UNSIGNED_INTEGER +LIBSPEC UNSIGNED_INTEGER

UPNP_GetTotalPacketsSent(const char * controlURL,

const char * servicetype)

{

@@ -79,7 +79,7 @@

/*

  • */

-UNSIGNED_INTEGER +LIBSPEC UNSIGNED_INTEGER

UPNP_GetTotalPacketsReceived(const char * controlURL,

const char * servicetype)

{

@@ -99,7 +99,7 @@

/* UPNP_GetStatusInfo() call the corresponding UPNP method

  • returns the current status and uptime */

-int UPNP_GetStatusInfo(const char * controlURL, +LIBSPEC int UPNP_GetStatusInfo(const char * controlURL,

const char * servicetype, char * status, unsigned int * uptime,

@@ -159,7 +159,7 @@

/* UPNP_GetConnectionTypeInfo() call the corresponding UPNP method

  • returns the connection type */

-int UPNP_GetConnectionTypeInfo(const char * controlURL, +LIBSPEC int UPNP_GetConnectionTypeInfo(const char * controlURL,

const char * servicetype, char * connectionType)

{

@@ -198,7 +198,7 @@

-int UPNP_GetLinkLayerMaxBitRates(const char * controlURL, const char * servicetype, unsigned int * bitrateDown, unsigned int* bitrateUp) +LIBSPEC int UPNP_GetLinkLayerMaxBitRates(const char * controlURL, const char * servicetype, unsigned int * bitrateDown, unsigned int* bitrateUp)

{

struct NameValueParserData? pdata; char buffer[4096];

@@ -262,7 +262,7 @@

  • 402 Invalid Args - See UPnP Device Architecture section on Control.
  • 501 Action Failed - See UPnP Device Architecture section on Control. */

-int UPNP_GetExternalIPAddress(const char * controlURL, +LIBSPEC int UPNP_GetExternalIPAddress(const char * controlURL,

const char * servicetype,

char * extIpAdd)

{

@@ -297,7 +297,7 @@

return ret;

}

-int +LIBSPEC int

UPNP_AddPortMapping(const char * controlURL, const char * servicetype,

const char * extPort,

const char * inPort,

@@ -351,7 +351,7 @@

return ret;

}

-int +LIBSPEC int

UPNP_DeletePortMapping(const char * controlURL, const char * servicetype,

const char * extPort, const char * proto, const char * remoteHost)

@@ -391,7 +391,7 @@

return ret;

}

-int UPNP_GetGenericPortMappingEntry(const char * controlURL, +LIBSPEC int UPNP_GetGenericPortMappingEntry(const char * controlURL,

const char * servicetype,

const char * index, char * extPort,

@@ -480,7 +480,7 @@

return r;

}

-int UPNP_GetPortMappingNumberOfEntries(const char * controlURL, const char * servicetype, unsigned int * numEntries) +LIBSPEC int UPNP_GetPortMappingNumberOfEntries(const char * controlURL, const char * servicetype, unsigned int * numEntries)

{

struct NameValueParserData? pdata; char buffer[4096];

@@ -513,7 +513,7 @@

/* UPNP_GetSpecificPortMappingEntry retrieves an existing port mapping

  • the result is returned in the intClient and intPort strings
  • please provide 16 and 6 bytes of data */

-int +LIBSPEC int

UPNP_GetSpecificPortMappingEntry(const char * controlURL,

const char * servicetype, const char * extPort,