rb07
Joined: 31 May 2009 Posts: 8
|
Posted: Sun May 31, 2009 1:41 am Post subject: [patch] Changes for MinGW (using Fedora cross-tools) |
|
|
This is the complement of the patch for miniupnp I did in the course of building Transmission (1.61) for Windows (Gtk and Qt GUI).
The version included in Transmission is libnatpmp-20090310.
Code: | 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) {
|
Additionally I had to make the following addition to Transmission's configure, this would translate to something similar in Makefile:
Code: | + LDFLAGS="$LDFLAGS -no-undefined"
|
_________________ R.B. |
|